File size: 459 Bytes
224ff63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

def Chain_Main_Agent(memory):

    from langchain_openai import ChatOpenAI

    from agent.prompt import prompt
    prompt=prompt[memory.isNew]

    llm = ChatOpenAI(model="gpt-3.5-turbo-0125", temperature=0)
    from agent.toolset import converted_tools
    llm_with_tools = llm.bind_functions(converted_tools)

    from agent.datastructures import parser

    chain_main_agent = (
        prompt
        | llm_with_tools
    )

    return chain_main_agent