Skip to content

Commit

Permalink
fix: adding info to Agent and related components (langflow-ai#4495)
Browse files Browse the repository at this point in the history
* info added

* Update openai.py

update to Open AI model info

* info changed

* Update tool_calling.py

made info of LLM much simpler

* info updated to be simpler

* Update agent.py
  • Loading branch information
edwinjosechittilappilly authored and diogocabral committed Nov 26, 2024
1 parent 66bc5d6 commit ba2168f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
10 changes: 4 additions & 6 deletions src/backend/base/langflow/base/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,15 @@ class LCAgentComponent(Component):
display_name="Handle Parse Errors",
value=True,
advanced=True,
info="Should the Agent fix errors when reading user input for better processing?",
),
BoolInput(
name="verbose",
display_name="Verbose",
value=True,
advanced=True,
),
BoolInput(name="verbose", display_name="Verbose", value=True, advanced=True),
IntInput(
name="max_iterations",
display_name="Max Iterations",
value=15,
advanced=True,
info="The maximum number of attempts the agent can make to complete its task before it stops.",
),
MultilineInput(
name="agent_description",
Expand Down Expand Up @@ -187,6 +184,7 @@ class LCToolsAgentComponent(LCAgentComponent):
input_types=["Tool", "BaseTool", "StructuredTool"],
is_list=True,
required=True,
info="These are the tools that the agent can use to help with tasks.",
),
*LCAgentComponent._base_inputs,
]
Expand Down
3 changes: 2 additions & 1 deletion src/backend/base/langflow/components/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class AgentComponent(ToolCallingAgentComponent):
DropdownInput(
name="agent_llm",
display_name="Model Provider",
info="The provider of the language model that the agent will use to generate responses.",
options=[*sorted(MODEL_PROVIDERS_DICT.keys()), "Custom"],
value="OpenAI",
real_time_refresh=True,
Expand All @@ -37,7 +38,7 @@ class AgentComponent(ToolCallingAgentComponent):
MultilineInput(
name="system_prompt",
display_name="Agent Instructions",
info="Initial instructions and context provided to guide the agent's behavior.",
info="System Prompt: Initial instructions and context provided to guide the agent's behavior.",
value="You are a helpful assistant that can use tools to answer questions and perform tasks.",
advanced=False,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,26 @@ class ToolCallingAgentComponent(LCToolsAgentComponent):

inputs = [
*LCToolsAgentComponent._base_inputs,
HandleInput(name="llm", display_name="Language Model", input_types=["LanguageModel"], required=True),
HandleInput(
name="llm",
display_name="Language Model",
input_types=["LanguageModel"],
required=True,
info="Language model that the agent utilizes to perform tasks effectively.",
),
MessageTextInput(
name="system_prompt",
display_name="System Prompt",
info="Initial instructions and context provided to guide the agent's behavior.",
value="You are a helpful assistant that can use tools to answer questions and perform tasks.",
),
DataInput(name="chat_history", display_name="Chat Memory", is_list=True, advanced=True),
DataInput(
name="chat_history",
display_name="Chat Memory",
is_list=True,
advanced=True,
info="This input stores the chat history, allowing the agent to remember previous conversations.",
),
]

def get_chat_history_data(self) -> list[Data] | None:
Expand Down
7 changes: 6 additions & 1 deletion src/backend/base/langflow/components/models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ class OpenAIModelComponent(LCModelComponent):
info="The maximum number of tokens to generate. Set to 0 for unlimited tokens.",
range_spec=RangeSpec(min=0, max=128000),
),
DictInput(name="model_kwargs", display_name="Model Kwargs", advanced=True),
DictInput(
name="model_kwargs",
display_name="Model Kwargs",
advanced=True,
info="Additional keyword arguments to pass to the model.",
),
BoolInput(
name="json_mode",
display_name="JSON Mode",
Expand Down

0 comments on commit ba2168f

Please sign in to comment.