在哪里修改使用openai的接口之类的,没kx上网不能自定义agent问答 #2531
Replies: 1 comment
-
🤖 你好,@CyanMystery!我是一个帮助你解决问题,回答疑问,并成为贡献者的机器人,Dosu。在等待人类维护者的同时,我在这里帮助你。很高兴能和你交流! 您可以在 例如,如果您想要修改agent的输出解析器,您可以修改 class StructuredGLM3ChatAgent(Agent):
"""Structured Chat Agent."""
output_parser: AgentOutputParser = Field(
default_factory=YourCustomOutputParser
)
"""Output parser for the agent.""" 同样,如果您想要修改agent的行为,您可以覆盖 @classmethod
def from_llm_and_tools(
cls,
llm: BaseLanguageModel,
tools: Sequence[BaseTool],
prompt: str = None,
callback_manager: Optional[BaseCallbackManager] = None,
output_parser: Optional[AgentOutputParser] = None,
human_message_template: str = HUMAN_MESSAGE_TEMPLATE,
input_variables: Optional[List[str]] = None,
memory_prompts: Optional[List[BasePromptTemplate]] = None,
**kwargs: Any,
) -> Agent:
"""Construct an agent from an LLM and tools."""
# Your custom logic here 请注意,这些修改需要对Python编程和Langchain-Chatchat的代码结构有深入的理解。如果您需要更多的帮助,可以参考这个问题的讨论。 SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
在哪里修改使用openai的接口之类的,没kx上网不能自定义agent问答
Beta Was this translation helpful? Give feedback.
All reactions