This commit is contained in:
Harrison Chase
2023-12-26 21:43:05 -08:00
parent 27f7d38600
commit c8e1135486
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ This categorizes all the available agents along a few dimensions.
**Intended Model Type**
Whether this agent is intended for Chat Models (takes in messages, outputs message) or LLMs (takes in string, outputs string). The main thing this affects is the prompting strategy used. You can use an agent with a different type of model than it is intended for, but it likely won't product as good of results.
Whether this agent is intended for Chat Models (takes in messages, outputs message) or LLMs (takes in string, outputs string). The main thing this affects is the prompting strategy used. You can use an agent with a different type of model than it is intended for, but it likely won't produce results of the same quality.
**Supports Chat History**

View File

@@ -2,6 +2,7 @@ from typing import Any, List, Sequence, Tuple, Union
from langchain_core.agents import AgentAction, AgentFinish
from langchain_core.language_models import BaseLanguageModel
from langchain_core.prompts.base import BasePromptTemplate
from langchain_core.prompts.chat import AIMessagePromptTemplate, ChatPromptTemplate
from langchain_core.runnables import Runnable, RunnablePassthrough
from langchain_core.tools import BaseTool
@@ -105,7 +106,7 @@ class XMLAgent(BaseSingleActionAgent):
def create_xml_agent(
llm: BaseLanguageModel, tools: Sequence[BaseTool], prompt: ChatPromptTemplate
llm: BaseLanguageModel, tools: Sequence[BaseTool], prompt: BasePromptTemplate
) -> Runnable:
"""Create an agent that uses XML to format its logic.
@@ -156,7 +157,6 @@ def create_xml_agent(
prompt = prompt.partial(
tools=render_text_description(list(tools)),
tool_names=", ".join([t.name for t in tools]),
)
llm_with_stop = llm.bind(stop=["</tool_input>"])