Skip to content

The chat server provides the ability to interact with the LLM, including single-round chat, multi-round chat, and multi agent

OpenAI Chat

LangServer API

chat_server = RemoteRunnable(f'{CHAT_SERVICE_URL}/openai')
result = chat_server.invoke({
            "system_message_prompt": "",
            "openai_api_base": "",
            "openai_api_key": "",
            "temperature": 0.7,
            "model": "gpt-3.5-turbo",
            "user_message": "",
            "chat_history": [
                {
                    "event":"bot",
                    "text":""
                },
                {
                    "event":"user",
                    "text":""
                }
            ],
            "conversation_window_size": 6,
            "rag_context": "",
        })
paramdesc
system_message_promptThe prompt to be used to generate the system message
openai_api_baseThe base URL for the OpenAI API
openai_api_keyThe API key for the OpenAI API
temperatureThe temperature to be used for the OpenAI API
modelThe model to be used for the OpenAI API
user_messageThe message from the user
chat_historyThe chat history
conversation_window_sizeThe size of the conversation window
rag_contextbackground on the use of LLM
toolswhen given tools,the chat server will change to llm agent mode,tools is a list of tools that the agent can use,for example ["shell","duckduckgo-search"]

Zhipu Chat

LangServer API

chat_server = RemoteRunnable(f'{CHAT_SERVICE_URL}/zhipu')
result = chat_server.invoke({
            "system_message_prompt": "",
            "api_base": "",
            "api_key": "",
            "temperature": 0.7,
            "model": "glm-4",
            "user_message": "",
            "chat_history": [
                {
                    "event":"bot",
                    "text":""
                },
                {
                    "event":"user",
                    "text":""
                }
            ],
            "conversation_window_size": 6,
            "rag_context": "",
        })
paramdesc
system_message_promptThe prompt to be used to generate the system message
api_baseThe base URL for the Zhipu API
api_keyThe API key for the Zhipu API
temperatureThe temperature to be used for the Zhipu API
modelThe model to be used for the Zhipu API
user_messageThe message from the user
chat_historyThe chat history
conversation_window_sizeThe size of the conversation window
rag_contextbackground on the use of LLM
toolswhen given tools,the chat server will change to llm agent mode,tools is a list of tools that the agent can use,for example ["shell","duckduckgo-search"]