mirror of
https://github.com/hwchase17/langchain.git
synced 2026-02-03 15:55:44 +00:00
cr
This commit is contained in:
@@ -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**
|
||||
|
||||
|
||||
@@ -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>"])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user