diff --git a/docs/modules/chat/examples/agent.ipynb b/docs/modules/chat/examples/agent.ipynb index a4040f69dfa..478c283aa73 100644 --- a/docs/modules/chat/examples/agent.ipynb +++ b/docs/modules/chat/examples/agent.ipynb @@ -173,15 +173,16 @@ "\n", "\n", "\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n", - "\u001b[32;1m\u001b[1;3mArrr, ye be in luck, matey! I'll find ye the answer to yer question.\n", + "\u001b[32;1m\u001b[1;3mArrr, ye be in luck, matey! I'll help ye find the answer ye seek.\n", "\n", - "Thought: I need to search for the current population of Canada.\n", + "Thought: Hmm, I don't have this information off the top of me head.\n", "Action: Search\n", - "Action Input: \"current population of Canada 2023\"\n", + "Action Input: \"Canada population 2023\"\n", "\u001b[0m\n", "Observation: \u001b[36;1m\u001b[1;3mThe current population of Canada is 38,627,607 as of Thursday, March 9, 2023, based on Worldometer elaboration of the latest United Nations data.\u001b[0m\n", - "Thought:\u001b[32;1m\u001b[1;3mArrr, that be a fine answer, but I need to make it sound more piratical.\n", - "Final Answer: Avast ye! As of March 9, 2023, the population of Canada be 38,627,607, according to the latest data from the United Nations.\u001b[0m\n", + "Thought:\u001b[32;1m\u001b[1;3mAhoy, me hearties! I have found the answer to yer question.\n", + "\n", + "Final Answer: As of March 9, 2023, the population of Canada is 38,627,607. Arrr!\u001b[0m\n", "\n", "\u001b[1m> Finished chain.\u001b[0m\n" ] @@ -189,7 +190,7 @@ { "data": { "text/plain": [ - "'Avast ye! As of March 9, 2023, the population of Canada be 38,627,607, according to the latest data from the United Nations.'" + "'As of March 9, 2023, the population of Canada is 38,627,607. Arrr!'" ] }, "execution_count": 10, diff --git a/langchain/schema.py b/langchain/schema.py index e510be70abf..5891c1b3c00 100644 --- a/langchain/schema.py +++ b/langchain/schema.py @@ -43,20 +43,24 @@ class BaseMessage(BaseModel): class HumanMessage(BaseMessage): """Type of message that is spoken by the human.""" + _type = "human" class AIMessage(BaseMessage): """Type of message that is spoken by the AI.""" + _type = "ai" class SystemMessage(BaseMessage): """Type of message that is a system message.""" + _type = "system" class ChatMessage(BaseMessage): """Type of message with arbitrary speaker.""" role: str + _type = "chat" class ChatGeneration(Generation):