Skip to content
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
4 changes: 2 additions & 2 deletions src/strands/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ def structured_output(self, output_model: Type[T], prompt: Optional[str] = None)
instruct the model to output the structured data.

Args:
output_model(Type[BaseModel]): The output model (a JSON schema written as a Pydantic BaseModel)
output_model: The output model (a JSON schema written as a Pydantic BaseModel)
that the agent will use when responding.
prompt(Optional[str]): The prompt to use for the agent.
prompt: The prompt to use for the agent.
"""
messages = self.messages
if not messages and not prompt:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ def apply_management(self, _agent: "Agent") -> None:
"""Does nothing to the conversation history.

Args:
agent: The agent whose conversation history will remain unmodified.
_agent: The agent whose conversation history will remain unmodified.
"""
pass

def reduce_context(self, _agent: "Agent", e: Optional[Exception] = None) -> None:
"""Does not reduce context and raises an exception.

Args:
agent: The agent whose conversation history will remain unmodified.
_agent: The agent whose conversation history will remain unmodified.
e: The exception that triggered the context reduction, if any.

Raises:
Expand Down
4 changes: 2 additions & 2 deletions src/strands/models/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ def structured_output(
"""Get structured output from the model.

Args:
output_model(Type[BaseModel]): The output model to use for the agent.
prompt(Messages): The prompt messages to use for the agent.
output_model: The output model to use for the agent.
prompt: The prompt messages to use for the agent.

Yields:
Model events with the last being the structured output.
Expand Down
4 changes: 2 additions & 2 deletions src/strands/models/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ def structured_output(
"""Get structured output from the model.

Args:
output_model(Type[BaseModel]): The output model to use for the agent.
prompt(Messages): The prompt messages to use for the agent.
output_model: The output model to use for the agent.
prompt: The prompt messages to use for the agent.

Yields:
Model events with the last being the structured output.
Expand Down
4 changes: 2 additions & 2 deletions src/strands/models/litellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def structured_output(
"""Get structured output from the model.

Args:
output_model(Type[BaseModel]): The output model to use for the agent.
prompt(Messages): The prompt messages to use for the agent.
output_model: The output model to use for the agent.
prompt: The prompt messages to use for the agent.

Yields:
Model events with the last being the structured output.
Expand Down
4 changes: 2 additions & 2 deletions src/strands/models/llamaapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ def structured_output(
"""Get structured output from the model.

Args:
output_model(Type[BaseModel]): The output model to use for the agent.
prompt(Messages): The prompt messages to use for the agent.
output_model: The output model to use for the agent.
prompt: The prompt messages to use for the agent.

Yields:
Model events with the last being the structured output.
Expand Down
4 changes: 2 additions & 2 deletions src/strands/models/ollama.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ def structured_output(
"""Get structured output from the model.

Args:
output_model(Type[BaseModel]): The output model to use for the agent.
prompt(Messages): The prompt messages to use for the agent.
output_model: The output model to use for the agent.
prompt: The prompt messages to use for the agent.

Yields:
Model events with the last being the structured output.
Expand Down
4 changes: 2 additions & 2 deletions src/strands/models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def structured_output(
"""Get structured output from the model.

Args:
output_model(Type[BaseModel]): The output model to use for the agent.
prompt(Messages): The prompt messages to use for the agent.
output_model: The output model to use for the agent.
prompt: The prompt messages to use for the agent.

Yields:
Model events with the last being the structured output.
Expand Down
17 changes: 8 additions & 9 deletions src/strands/tools/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,14 @@ def tool( # type: ignore
```python
@tool
def my_tool(name: str, count: int = 1) -> str:
'''Does something useful with the provided parameters.

Args:
name: The name to process
count: Number of times to process (default: 1)

Returns:
A message with the result
'''
# Does something useful with the provided parameters.
#
# Parameters:
# name: The name to process
# count: Number of times to process (default: 1)
#
# Returns:
# A message with the result
return f"Processed {name} {count} times"

agent = Agent(tools=[my_tool])
Expand Down
4 changes: 2 additions & 2 deletions src/strands/types/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def structured_output(
"""Get structured output from the model.

Args:
output_model(Type[BaseModel]): The output model to use for the agent.
prompt(Messages): The prompt messages to use for the agent.
output_model: The output model to use for the agent.
prompt: The prompt messages to use for the agent.

Yields:
Model events with the last being the structured output.
Expand Down
4 changes: 2 additions & 2 deletions src/strands/types/models/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ def structured_output(
"""Get structured output from the model.

Args:
output_model(Type[BaseModel]): The output model to use for the agent.
prompt(Messages): The prompt to use for the agent.
output_model: The output model to use for the agent.
prompt: The prompt to use for the agent.

Yields:
Model events with the last being the structured output.
Expand Down