langchain_experimental.autonomous_agents.autogpt.prompt_generator.PromptGenerator

class langchain_experimental.autonomous_agents.autogpt.prompt_generator.PromptGenerator[source]

自定义提示字符串的生成器。

根据约束、命令、资源和性能评估来实现这一功能。

初始化PromptGenerator对象。

从空的约束、命令、资源和性能评估列表开始。

Methods

__init__()

初始化PromptGenerator对象。

add_constraint(constraint)

将约束添加到约束列表中。

add_performance_evaluation(evaluation)

将性能评估项目添加到性能评估列表中。

add_resource(resource)

将资源添加到资源列表中。

add_tool(tool)

generate_prompt_string()

生成一个提示字符串。

Return type

None

__init__() None[source]

初始化PromptGenerator对象。

从空的约束、命令、资源和性能评估列表开始。

Return type

None

add_constraint(constraint: str) None[source]

将约束添加到约束列表中。

参数:

constraint (str): 要添加的约束。

Parameters

constraint (str) –

Return type

None

add_performance_evaluation(evaluation: str) None[source]

将性能评估项目添加到性能评估列表中。

参数:

evaluation (str): 要添加的评估项目。

Parameters

evaluation (str) –

Return type

None

add_resource(resource: str) None[source]

将资源添加到资源列表中。

参数:

resource (str): 要添加的资源。

Parameters

resource (str) –

Return type

None

add_tool(tool: BaseTool) None[source]
Parameters

tool (BaseTool) –

Return type

None

generate_prompt_string() str[source]

生成一个提示字符串。

返回:

str: 生成的提示字符串。

Return type

str