Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adding info to Agent and related components #4495

Merged
merged 8 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/backend/base/langflow/base/agents/agent.py
edwinjosechittilappilly marked this conversation as resolved.
Show resolved Hide resolved
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
Loading