diff --git a/src/llama_stack_client/resources/agents/agents.py b/src/llama_stack_client/resources/agents/agents.py index 860fb4fa..314edd7e 100644 --- a/src/llama_stack_client/resources/agents/agents.py +++ b/src/llama_stack_client/resources/agents/agents.py @@ -93,7 +93,11 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AgentCreateResponse: """ + Create an agent with the given configuration. + Args: + agent_config: The configuration for the agent. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -123,6 +127,8 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> None: """ + Delete an agent by its ID. + Args: extra_headers: Send extra headers @@ -188,7 +194,11 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AgentCreateResponse: """ + Create an agent with the given configuration. + Args: + agent_config: The configuration for the agent. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -218,6 +228,8 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> None: """ + Delete an agent by its ID. + Args: extra_headers: Send extra headers diff --git a/src/llama_stack_client/resources/agents/session.py b/src/llama_stack_client/resources/agents/session.py index 9ccb420d..592a94ba 100644 --- a/src/llama_stack_client/resources/agents/session.py +++ b/src/llama_stack_client/resources/agents/session.py @@ -60,7 +60,11 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SessionCreateResponse: """ + Create a new session for an agent. + Args: + session_name: The name of the session to create. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -94,7 +98,11 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Session: """ + Retrieve an agent session by its ID. + Args: + turn_ids: (Optional) List of turn IDs to filter the session by. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -132,6 +140,8 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> None: """ + Delete an agent session by its ID. + Args: extra_headers: Send extra headers @@ -188,7 +198,11 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> SessionCreateResponse: """ + Create a new session for an agent. + Args: + session_name: The name of the session to create. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -222,7 +236,11 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Session: """ + Retrieve an agent session by its ID. + Args: + turn_ids: (Optional) List of turn IDs to filter the session by. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -262,6 +280,8 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> None: """ + Delete an agent session by its ID. + Args: extra_headers: Send extra headers diff --git a/src/llama_stack_client/resources/agents/steps.py b/src/llama_stack_client/resources/agents/steps.py index 1b4ec362..1dc60b92 100644 --- a/src/llama_stack_client/resources/agents/steps.py +++ b/src/llama_stack_client/resources/agents/steps.py @@ -54,6 +54,8 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> StepRetrieveResponse: """ + Retrieve an agent step by its ID. + Args: extra_headers: Send extra headers @@ -115,6 +117,8 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> StepRetrieveResponse: """ + Retrieve an agent step by its ID. + Args: extra_headers: Send extra headers diff --git a/src/llama_stack_client/resources/agents/turn.py b/src/llama_stack_client/resources/agents/turn.py index 6c787e92..2b1e07f4 100644 --- a/src/llama_stack_client/resources/agents/turn.py +++ b/src/llama_stack_client/resources/agents/turn.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Iterable +from typing import List, Union, Iterable from typing_extensions import Literal, overload import httpx @@ -25,6 +25,7 @@ from ..._base_client import make_request_options from ...types.agents import turn_create_params, turn_resume_params from ...types.agents.turn import Turn +from ...types.tool_response_param import ToolResponseParam from ...types.shared_params.tool_response_message import ToolResponseMessage from ...types.agents.agent_turn_response_stream_chunk import AgentTurnResponseStreamChunk @@ -70,8 +71,21 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Turn: """ + Create a new turn for an agent. + Args: - tool_config: Configuration for tool use. + messages: List of messages to start the turn with. + + documents: (Optional) List of documents to create the turn with. + + stream: (Optional) If True, generate an SSE event stream of the response. Defaults to + False. + + tool_config: (Optional) The tool configuration to create the turn with, will be used to + override the agent's tool_config. + + toolgroups: (Optional) List of toolgroups to create the turn with, will be used in addition + to the agent's config toolgroups for the request. extra_headers: Send extra headers @@ -102,8 +116,21 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Stream[AgentTurnResponseStreamChunk]: """ + Create a new turn for an agent. + Args: - tool_config: Configuration for tool use. + messages: List of messages to start the turn with. + + stream: (Optional) If True, generate an SSE event stream of the response. Defaults to + False. + + documents: (Optional) List of documents to create the turn with. + + tool_config: (Optional) The tool configuration to create the turn with, will be used to + override the agent's tool_config. + + toolgroups: (Optional) List of toolgroups to create the turn with, will be used in addition + to the agent's config toolgroups for the request. extra_headers: Send extra headers @@ -134,8 +161,21 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Turn | Stream[AgentTurnResponseStreamChunk]: """ + Create a new turn for an agent. + Args: - tool_config: Configuration for tool use. + messages: List of messages to start the turn with. + + stream: (Optional) If True, generate an SSE event stream of the response. Defaults to + False. + + documents: (Optional) List of documents to create the turn with. + + tool_config: (Optional) The tool configuration to create the turn with, will be used to + override the agent's tool_config. + + toolgroups: (Optional) List of toolgroups to create the turn with, will be used in addition + to the agent's config toolgroups for the request. extra_headers: Send extra headers @@ -203,6 +243,8 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Turn: """ + Retrieve an agent turn by its ID. + Args: extra_headers: Send extra headers @@ -233,7 +275,7 @@ def resume( *, agent_id: str, session_id: str, - tool_responses: Iterable[ToolResponseMessage], + tool_responses: Union[Iterable[ToolResponseParam], Iterable[ToolResponseMessage]], stream: Literal[False] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -250,7 +292,8 @@ def resume( ready. Args: - tool_responses: The tool call responses to resume the turn with. + tool_responses: The tool call responses to resume the turn with. NOTE: ToolResponseMessage will + be deprecated. Use ToolResponse. stream: Whether to stream the response. @@ -272,7 +315,7 @@ def resume( agent_id: str, session_id: str, stream: Literal[True], - tool_responses: Iterable[ToolResponseMessage], + tool_responses: Union[Iterable[ToolResponseParam], Iterable[ToolResponseMessage]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -290,7 +333,8 @@ def resume( Args: stream: Whether to stream the response. - tool_responses: The tool call responses to resume the turn with. + tool_responses: The tool call responses to resume the turn with. NOTE: ToolResponseMessage will + be deprecated. Use ToolResponse. extra_headers: Send extra headers @@ -310,7 +354,7 @@ def resume( agent_id: str, session_id: str, stream: bool, - tool_responses: Iterable[ToolResponseMessage], + tool_responses: Union[Iterable[ToolResponseParam], Iterable[ToolResponseMessage]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -328,7 +372,8 @@ def resume( Args: stream: Whether to stream the response. - tool_responses: The tool call responses to resume the turn with. + tool_responses: The tool call responses to resume the turn with. NOTE: ToolResponseMessage will + be deprecated. Use ToolResponse. extra_headers: Send extra headers @@ -347,7 +392,7 @@ def resume( *, agent_id: str, session_id: str, - tool_responses: Iterable[ToolResponseMessage], + tool_responses: Union[Iterable[ToolResponseParam], Iterable[ToolResponseMessage]], stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -419,8 +464,21 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Turn: """ + Create a new turn for an agent. + Args: - tool_config: Configuration for tool use. + messages: List of messages to start the turn with. + + documents: (Optional) List of documents to create the turn with. + + stream: (Optional) If True, generate an SSE event stream of the response. Defaults to + False. + + tool_config: (Optional) The tool configuration to create the turn with, will be used to + override the agent's tool_config. + + toolgroups: (Optional) List of toolgroups to create the turn with, will be used in addition + to the agent's config toolgroups for the request. extra_headers: Send extra headers @@ -451,8 +509,21 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> AsyncStream[AgentTurnResponseStreamChunk]: """ + Create a new turn for an agent. + Args: - tool_config: Configuration for tool use. + messages: List of messages to start the turn with. + + stream: (Optional) If True, generate an SSE event stream of the response. Defaults to + False. + + documents: (Optional) List of documents to create the turn with. + + tool_config: (Optional) The tool configuration to create the turn with, will be used to + override the agent's tool_config. + + toolgroups: (Optional) List of toolgroups to create the turn with, will be used in addition + to the agent's config toolgroups for the request. extra_headers: Send extra headers @@ -483,8 +554,21 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Turn | AsyncStream[AgentTurnResponseStreamChunk]: """ + Create a new turn for an agent. + Args: - tool_config: Configuration for tool use. + messages: List of messages to start the turn with. + + stream: (Optional) If True, generate an SSE event stream of the response. Defaults to + False. + + documents: (Optional) List of documents to create the turn with. + + tool_config: (Optional) The tool configuration to create the turn with, will be used to + override the agent's tool_config. + + toolgroups: (Optional) List of toolgroups to create the turn with, will be used in addition + to the agent's config toolgroups for the request. extra_headers: Send extra headers @@ -552,6 +636,8 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Turn: """ + Retrieve an agent turn by its ID. + Args: extra_headers: Send extra headers @@ -582,7 +668,7 @@ async def resume( *, agent_id: str, session_id: str, - tool_responses: Iterable[ToolResponseMessage], + tool_responses: Union[Iterable[ToolResponseParam], Iterable[ToolResponseMessage]], stream: Literal[False] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -599,7 +685,8 @@ async def resume( ready. Args: - tool_responses: The tool call responses to resume the turn with. + tool_responses: The tool call responses to resume the turn with. NOTE: ToolResponseMessage will + be deprecated. Use ToolResponse. stream: Whether to stream the response. @@ -621,7 +708,7 @@ async def resume( agent_id: str, session_id: str, stream: Literal[True], - tool_responses: Iterable[ToolResponseMessage], + tool_responses: Union[Iterable[ToolResponseParam], Iterable[ToolResponseMessage]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -639,7 +726,8 @@ async def resume( Args: stream: Whether to stream the response. - tool_responses: The tool call responses to resume the turn with. + tool_responses: The tool call responses to resume the turn with. NOTE: ToolResponseMessage will + be deprecated. Use ToolResponse. extra_headers: Send extra headers @@ -659,7 +747,7 @@ async def resume( agent_id: str, session_id: str, stream: bool, - tool_responses: Iterable[ToolResponseMessage], + tool_responses: Union[Iterable[ToolResponseParam], Iterable[ToolResponseMessage]], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -677,7 +765,8 @@ async def resume( Args: stream: Whether to stream the response. - tool_responses: The tool call responses to resume the turn with. + tool_responses: The tool call responses to resume the turn with. NOTE: ToolResponseMessage will + be deprecated. Use ToolResponse. extra_headers: Send extra headers @@ -696,7 +785,7 @@ async def resume( *, agent_id: str, session_id: str, - tool_responses: Iterable[ToolResponseMessage], + tool_responses: Union[Iterable[ToolResponseParam], Iterable[ToolResponseMessage]], stream: Literal[False] | Literal[True] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. diff --git a/src/llama_stack_client/resources/datasetio.py b/src/llama_stack_client/resources/datasetio.py index c69ee34a..23577926 100644 --- a/src/llama_stack_client/resources/datasetio.py +++ b/src/llama_stack_client/resources/datasetio.py @@ -99,7 +99,17 @@ def get_rows_paginated( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PaginatedRowsResult: """ + Get a paginated list of rows from a dataset. + Args: + dataset_id: The ID of the dataset to get the rows from. + + rows_in_page: The number of rows to get per page. + + filter_condition: (Optional) A condition to filter the rows by. + + page_token: The token to get the next page of rows. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -202,7 +212,17 @@ async def get_rows_paginated( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> PaginatedRowsResult: """ + Get a paginated list of rows from a dataset. + Args: + dataset_id: The ID of the dataset to get the rows from. + + rows_in_page: The number of rows to get per page. + + filter_condition: (Optional) A condition to filter the rows by. + + page_token: The token to get the next page of rows. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/llama_stack_client/resources/eval/eval.py b/src/llama_stack_client/resources/eval/eval.py index 2c2d8d9c..e73f7df1 100644 --- a/src/llama_stack_client/resources/eval/eval.py +++ b/src/llama_stack_client/resources/eval/eval.py @@ -80,7 +80,15 @@ def evaluate_rows( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EvaluateResponse: """ + Evaluate a list of rows on a benchmark. + Args: + benchmark_config: The configuration for the benchmark. + + input_rows: The rows to evaluate. + + scoring_functions: The scoring functions to use for the evaluation. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -122,7 +130,15 @@ def evaluate_rows_alpha( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EvaluateResponse: """ + Evaluate a list of rows on a benchmark. + Args: + benchmark_config: The configuration for the benchmark. + + input_rows: The rows to evaluate. + + scoring_functions: The scoring functions to use for the evaluation. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -162,7 +178,11 @@ def run_eval( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Job: """ + Run an evaluation on a benchmark. + Args: + benchmark_config: The configuration for the benchmark. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -195,7 +215,11 @@ def run_eval_alpha( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Job: """ + Run an evaluation on a benchmark. + Args: + benchmark_config: The configuration for the benchmark. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -257,7 +281,15 @@ async def evaluate_rows( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EvaluateResponse: """ + Evaluate a list of rows on a benchmark. + Args: + benchmark_config: The configuration for the benchmark. + + input_rows: The rows to evaluate. + + scoring_functions: The scoring functions to use for the evaluation. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -299,7 +331,15 @@ async def evaluate_rows_alpha( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EvaluateResponse: """ + Evaluate a list of rows on a benchmark. + Args: + benchmark_config: The configuration for the benchmark. + + input_rows: The rows to evaluate. + + scoring_functions: The scoring functions to use for the evaluation. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -339,7 +379,11 @@ async def run_eval( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Job: """ + Run an evaluation on a benchmark. + Args: + benchmark_config: The configuration for the benchmark. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -374,7 +418,11 @@ async def run_eval_alpha( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Job: """ + Run an evaluation on a benchmark. + Args: + benchmark_config: The configuration for the benchmark. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/llama_stack_client/resources/eval/jobs.py b/src/llama_stack_client/resources/eval/jobs.py index d4d13f42..2b7bd817 100644 --- a/src/llama_stack_client/resources/eval/jobs.py +++ b/src/llama_stack_client/resources/eval/jobs.py @@ -55,6 +55,8 @@ def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EvaluateResponse: """ + Get the result of a job. + Args: extra_headers: Send extra headers @@ -89,6 +91,8 @@ def cancel( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> None: """ + Cancel a job. + Args: extra_headers: Send extra headers @@ -124,6 +128,8 @@ def status( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[JobStatusResponse]: """ + Get the status of a job. + Args: extra_headers: Send extra headers @@ -179,6 +185,8 @@ async def retrieve( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> EvaluateResponse: """ + Get the result of a job. + Args: extra_headers: Send extra headers @@ -213,6 +221,8 @@ async def cancel( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> None: """ + Cancel a job. + Args: extra_headers: Send extra headers @@ -248,6 +258,8 @@ async def status( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> Optional[JobStatusResponse]: """ + Get the status of a job. + Args: extra_headers: Send extra headers diff --git a/src/llama_stack_client/resources/scoring.py b/src/llama_stack_client/resources/scoring.py index be2a60ff..ebe42934 100644 --- a/src/llama_stack_client/resources/scoring.py +++ b/src/llama_stack_client/resources/scoring.py @@ -61,7 +61,13 @@ def score( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScoringScoreResponse: """ + Score a list of rows. + Args: + input_rows: The rows to score. + + scoring_functions: The scoring functions to use for the scoring. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -158,7 +164,13 @@ async def score( timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> ScoringScoreResponse: """ + Score a list of rows. + Args: + input_rows: The rows to score. + + scoring_functions: The scoring functions to use for the scoring. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/llama_stack_client/types/__init__.py b/src/llama_stack_client/types/__init__.py index ed400c28..f0d6c2e2 100644 --- a/src/llama_stack_client/types/__init__.py +++ b/src/llama_stack_client/types/__init__.py @@ -61,6 +61,7 @@ from .route_list_response import RouteListResponse as RouteListResponse from .run_shield_response import RunShieldResponse as RunShieldResponse from .tool_execution_step import ToolExecutionStep as ToolExecutionStep +from .tool_response_param import ToolResponseParam as ToolResponseParam from .eval_candidate_param import EvalCandidateParam as EvalCandidateParam from .eval_run_eval_params import EvalRunEvalParams as EvalRunEvalParams from .list_models_response import ListModelsResponse as ListModelsResponse diff --git a/src/llama_stack_client/types/agent_create_params.py b/src/llama_stack_client/types/agent_create_params.py index cd857d81..525cf1e2 100644 --- a/src/llama_stack_client/types/agent_create_params.py +++ b/src/llama_stack_client/types/agent_create_params.py @@ -11,3 +11,4 @@ class AgentCreateParams(TypedDict, total=False): agent_config: Required[AgentConfig] + """The configuration for the agent.""" diff --git a/src/llama_stack_client/types/agents/session_create_params.py b/src/llama_stack_client/types/agents/session_create_params.py index 048c48f7..5f421ae9 100644 --- a/src/llama_stack_client/types/agents/session_create_params.py +++ b/src/llama_stack_client/types/agents/session_create_params.py @@ -9,3 +9,4 @@ class SessionCreateParams(TypedDict, total=False): session_name: Required[str] + """The name of the session to create.""" diff --git a/src/llama_stack_client/types/agents/session_retrieve_params.py b/src/llama_stack_client/types/agents/session_retrieve_params.py index be9aab53..30337586 100644 --- a/src/llama_stack_client/types/agents/session_retrieve_params.py +++ b/src/llama_stack_client/types/agents/session_retrieve_params.py @@ -12,3 +12,4 @@ class SessionRetrieveParams(TypedDict, total=False): agent_id: Required[str] turn_ids: List[str] + """(Optional) List of turn IDs to filter the session by.""" diff --git a/src/llama_stack_client/types/agents/step_retrieve_response.py b/src/llama_stack_client/types/agents/step_retrieve_response.py index 8102e105..fcf2044b 100644 --- a/src/llama_stack_client/types/agents/step_retrieve_response.py +++ b/src/llama_stack_client/types/agents/step_retrieve_response.py @@ -20,3 +20,4 @@ class StepRetrieveResponse(BaseModel): step: Step + """An inference step in an agent turn.""" diff --git a/src/llama_stack_client/types/agents/turn.py b/src/llama_stack_client/types/agents/turn.py index 408d6446..aa8eeefe 100644 --- a/src/llama_stack_client/types/agents/turn.py +++ b/src/llama_stack_client/types/agents/turn.py @@ -82,9 +82,10 @@ class OutputAttachmentContentURL(BaseModel): class OutputAttachment(BaseModel): content: OutputAttachmentContent - """A image content item""" + """The content of the attachment.""" mime_type: str + """The MIME type of the attachment.""" class Turn(BaseModel): diff --git a/src/llama_stack_client/types/agents/turn_create_params.py b/src/llama_stack_client/types/agents/turn_create_params.py index 357f572c..01e0f64b 100644 --- a/src/llama_stack_client/types/agents/turn_create_params.py +++ b/src/llama_stack_client/types/agents/turn_create_params.py @@ -31,13 +31,22 @@ class TurnCreateParamsBase(TypedDict, total=False): agent_id: Required[str] messages: Required[Iterable[Message]] + """List of messages to start the turn with.""" documents: Iterable[Document] + """(Optional) List of documents to create the turn with.""" tool_config: ToolConfig - """Configuration for tool use.""" + """ + (Optional) The tool configuration to create the turn with, will be used to + override the agent's tool_config. + """ toolgroups: List[Toolgroup] + """ + (Optional) List of toolgroups to create the turn with, will be used in addition + to the agent's config toolgroups for the request. + """ Message: TypeAlias = Union[UserMessage, ToolResponseMessage] @@ -89,9 +98,10 @@ class DocumentContentURL(TypedDict, total=False): class Document(TypedDict, total=False): content: Required[DocumentContent] - """A image content item""" + """The content of the document.""" mime_type: Required[str] + """The MIME type of the document.""" class ToolConfig(TypedDict, total=False): @@ -134,10 +144,18 @@ class ToolgroupAgentToolGroupWithArgs(TypedDict, total=False): class TurnCreateParamsNonStreaming(TurnCreateParamsBase, total=False): stream: Literal[False] + """(Optional) If True, generate an SSE event stream of the response. + + Defaults to False. + """ class TurnCreateParamsStreaming(TurnCreateParamsBase): stream: Required[Literal[True]] + """(Optional) If True, generate an SSE event stream of the response. + + Defaults to False. + """ TurnCreateParams = Union[TurnCreateParamsNonStreaming, TurnCreateParamsStreaming] diff --git a/src/llama_stack_client/types/agents/turn_response_event_payload.py b/src/llama_stack_client/types/agents/turn_response_event_payload.py index e3315cb3..345a7ec4 100644 --- a/src/llama_stack_client/types/agents/turn_response_event_payload.py +++ b/src/llama_stack_client/types/agents/turn_response_event_payload.py @@ -30,6 +30,7 @@ class AgentTurnResponseStepStartPayload(BaseModel): step_id: str step_type: Literal["inference", "tool_execution", "shield_call", "memory_retrieval"] + """Type of the step in an agent turn.""" metadata: Optional[Dict[str, Union[bool, float, str, List[object], object, None]]] = None @@ -42,6 +43,7 @@ class AgentTurnResponseStepProgressPayload(BaseModel): step_id: str step_type: Literal["inference", "tool_execution", "shield_call", "memory_retrieval"] + """Type of the step in an agent turn.""" AgentTurnResponseStepCompletePayloadStepDetails: TypeAlias = Annotated[ @@ -54,10 +56,12 @@ class AgentTurnResponseStepCompletePayload(BaseModel): event_type: Literal["step_complete"] step_details: AgentTurnResponseStepCompletePayloadStepDetails + """An inference step in an agent turn.""" step_id: str step_type: Literal["inference", "tool_execution", "shield_call", "memory_retrieval"] + """Type of the step in an agent turn.""" class AgentTurnResponseTurnStartPayload(BaseModel): diff --git a/src/llama_stack_client/types/agents/turn_resume_params.py b/src/llama_stack_client/types/agents/turn_resume_params.py index b79cdb27..dc153d5e 100644 --- a/src/llama_stack_client/types/agents/turn_resume_params.py +++ b/src/llama_stack_client/types/agents/turn_resume_params.py @@ -5,6 +5,7 @@ from typing import Union, Iterable from typing_extensions import Literal, Required, TypedDict +from ..tool_response_param import ToolResponseParam from ..shared_params.tool_response_message import ToolResponseMessage __all__ = ["TurnResumeParamsBase", "TurnResumeParamsNonStreaming", "TurnResumeParamsStreaming"] @@ -15,8 +16,11 @@ class TurnResumeParamsBase(TypedDict, total=False): session_id: Required[str] - tool_responses: Required[Iterable[ToolResponseMessage]] - """The tool call responses to resume the turn with.""" + tool_responses: Required[Union[Iterable[ToolResponseParam], Iterable[ToolResponseMessage]]] + """The tool call responses to resume the turn with. + + NOTE: ToolResponseMessage will be deprecated. Use ToolResponse. + """ class TurnResumeParamsNonStreaming(TurnResumeParamsBase, total=False): diff --git a/src/llama_stack_client/types/benchmark_config_param.py b/src/llama_stack_client/types/benchmark_config_param.py index f958833a..740bf99b 100644 --- a/src/llama_stack_client/types/benchmark_config_param.py +++ b/src/llama_stack_client/types/benchmark_config_param.py @@ -13,7 +13,16 @@ class BenchmarkConfigParam(TypedDict, total=False): eval_candidate: Required[EvalCandidateParam] + """The candidate to evaluate.""" scoring_params: Required[Dict[str, ScoringFnParamsParam]] + """ + Map between scoring function id and parameters for each scoring function you + want to run + """ num_examples: int + """(Optional) The number of examples to evaluate. + + If not provided, all examples in the dataset will be evaluated + """ diff --git a/src/llama_stack_client/types/datasetio_get_rows_paginated_params.py b/src/llama_stack_client/types/datasetio_get_rows_paginated_params.py index 8082691e..7566c992 100644 --- a/src/llama_stack_client/types/datasetio_get_rows_paginated_params.py +++ b/src/llama_stack_client/types/datasetio_get_rows_paginated_params.py @@ -9,9 +9,13 @@ class DatasetioGetRowsPaginatedParams(TypedDict, total=False): dataset_id: Required[str] + """The ID of the dataset to get the rows from.""" rows_in_page: Required[int] + """The number of rows to get per page.""" filter_condition: str + """(Optional) A condition to filter the rows by.""" page_token: str + """The token to get the next page of rows.""" diff --git a/src/llama_stack_client/types/eval_candidate_param.py b/src/llama_stack_client/types/eval_candidate_param.py index 77c3c806..be1b21c8 100644 --- a/src/llama_stack_client/types/eval_candidate_param.py +++ b/src/llama_stack_client/types/eval_candidate_param.py @@ -14,17 +14,20 @@ class ModelCandidate(TypedDict, total=False): model: Required[str] + """The model ID to evaluate.""" sampling_params: Required[SamplingParams] + """The sampling parameters for the model.""" type: Required[Literal["model"]] system_message: SystemMessage - """A system message providing instructions or context to the model.""" + """(Optional) The system message providing instructions or context to the model.""" class AgentCandidate(TypedDict, total=False): config: Required[AgentConfig] + """The configuration for the agent candidate.""" type: Required[Literal["agent"]] diff --git a/src/llama_stack_client/types/eval_evaluate_rows_alpha_params.py b/src/llama_stack_client/types/eval_evaluate_rows_alpha_params.py index 125a0760..eb9443b0 100644 --- a/src/llama_stack_client/types/eval_evaluate_rows_alpha_params.py +++ b/src/llama_stack_client/types/eval_evaluate_rows_alpha_params.py @@ -12,7 +12,10 @@ class EvalEvaluateRowsAlphaParams(TypedDict, total=False): benchmark_config: Required[BenchmarkConfigParam] + """The configuration for the benchmark.""" input_rows: Required[Iterable[Dict[str, Union[bool, float, str, Iterable[object], object, None]]]] + """The rows to evaluate.""" scoring_functions: Required[List[str]] + """The scoring functions to use for the evaluation.""" diff --git a/src/llama_stack_client/types/eval_evaluate_rows_params.py b/src/llama_stack_client/types/eval_evaluate_rows_params.py index f0671298..37e7b978 100644 --- a/src/llama_stack_client/types/eval_evaluate_rows_params.py +++ b/src/llama_stack_client/types/eval_evaluate_rows_params.py @@ -12,7 +12,10 @@ class EvalEvaluateRowsParams(TypedDict, total=False): benchmark_config: Required[BenchmarkConfigParam] + """The configuration for the benchmark.""" input_rows: Required[Iterable[Dict[str, Union[bool, float, str, Iterable[object], object, None]]]] + """The rows to evaluate.""" scoring_functions: Required[List[str]] + """The scoring functions to use for the evaluation.""" diff --git a/src/llama_stack_client/types/eval_run_eval_alpha_params.py b/src/llama_stack_client/types/eval_run_eval_alpha_params.py index 4716dd49..e07393b3 100644 --- a/src/llama_stack_client/types/eval_run_eval_alpha_params.py +++ b/src/llama_stack_client/types/eval_run_eval_alpha_params.py @@ -11,3 +11,4 @@ class EvalRunEvalAlphaParams(TypedDict, total=False): benchmark_config: Required[BenchmarkConfigParam] + """The configuration for the benchmark.""" diff --git a/src/llama_stack_client/types/eval_run_eval_params.py b/src/llama_stack_client/types/eval_run_eval_params.py index a5e46d42..33596fc2 100644 --- a/src/llama_stack_client/types/eval_run_eval_params.py +++ b/src/llama_stack_client/types/eval_run_eval_params.py @@ -11,3 +11,4 @@ class EvalRunEvalParams(TypedDict, total=False): benchmark_config: Required[BenchmarkConfigParam] + """The configuration for the benchmark.""" diff --git a/src/llama_stack_client/types/evaluate_response.py b/src/llama_stack_client/types/evaluate_response.py index 365bd3bf..8e463352 100644 --- a/src/llama_stack_client/types/evaluate_response.py +++ b/src/llama_stack_client/types/evaluate_response.py @@ -10,5 +10,7 @@ class EvaluateResponse(BaseModel): generations: List[Dict[str, Union[bool, float, str, List[object], object, None]]] + """The generations from the evaluation.""" scores: Dict[str, ScoringResult] + """The scores from the evaluation.""" diff --git a/src/llama_stack_client/types/inference_step.py b/src/llama_stack_client/types/inference_step.py index d2c1ed8e..bfd92166 100644 --- a/src/llama_stack_client/types/inference_step.py +++ b/src/llama_stack_client/types/inference_step.py @@ -14,14 +14,18 @@ class InferenceStep(BaseModel): api_model_response: CompletionMessage = FieldInfo(alias="model_response") - """A message containing the model's (assistant) response in a chat conversation.""" + """The response from the LLM.""" step_id: str + """The ID of the step.""" step_type: Literal["inference"] turn_id: str + """The ID of the turn.""" completed_at: Optional[datetime] = None + """The time the step completed.""" started_at: Optional[datetime] = None + """The time the step started.""" diff --git a/src/llama_stack_client/types/memory_retrieval_step.py b/src/llama_stack_client/types/memory_retrieval_step.py index 6f37c93a..bd8ab735 100644 --- a/src/llama_stack_client/types/memory_retrieval_step.py +++ b/src/llama_stack_client/types/memory_retrieval_step.py @@ -12,16 +12,21 @@ class MemoryRetrievalStep(BaseModel): inserted_context: InterleavedContent - """A image content item""" + """The context retrieved from the vector databases.""" step_id: str + """The ID of the step.""" step_type: Literal["memory_retrieval"] turn_id: str + """The ID of the turn.""" vector_db_ids: str + """The IDs of the vector databases to retrieve context from.""" completed_at: Optional[datetime] = None + """The time the step completed.""" started_at: Optional[datetime] = None + """The time the step started.""" diff --git a/src/llama_stack_client/types/paginated_rows_result.py b/src/llama_stack_client/types/paginated_rows_result.py index 15eb53e2..4eccb803 100644 --- a/src/llama_stack_client/types/paginated_rows_result.py +++ b/src/llama_stack_client/types/paginated_rows_result.py @@ -9,7 +9,10 @@ class PaginatedRowsResult(BaseModel): rows: List[Dict[str, Union[bool, float, str, List[object], object, None]]] + """The rows in the current page.""" total_count: int + """The total number of rows in the dataset.""" next_page_token: Optional[str] = None + """The token to get the next page of rows.""" diff --git a/src/llama_stack_client/types/scoring_score_params.py b/src/llama_stack_client/types/scoring_score_params.py index a0af7890..baac066e 100644 --- a/src/llama_stack_client/types/scoring_score_params.py +++ b/src/llama_stack_client/types/scoring_score_params.py @@ -12,5 +12,7 @@ class ScoringScoreParams(TypedDict, total=False): input_rows: Required[Iterable[Dict[str, Union[bool, float, str, Iterable[object], object, None]]]] + """The rows to score.""" scoring_functions: Required[Dict[str, Optional[ScoringFnParamsParam]]] + """The scoring functions to use for the scoring.""" diff --git a/src/llama_stack_client/types/scoring_score_response.py b/src/llama_stack_client/types/scoring_score_response.py index 4efc9b91..083416e5 100644 --- a/src/llama_stack_client/types/scoring_score_response.py +++ b/src/llama_stack_client/types/scoring_score_response.py @@ -10,3 +10,4 @@ class ScoringScoreResponse(BaseModel): results: Dict[str, ScoringResult] + """A map of scoring function name to ScoringResult.""" diff --git a/src/llama_stack_client/types/shared/scoring_result.py b/src/llama_stack_client/types/shared/scoring_result.py index e19e8e6a..61ad9b54 100644 --- a/src/llama_stack_client/types/shared/scoring_result.py +++ b/src/llama_stack_client/types/shared/scoring_result.py @@ -9,5 +9,7 @@ class ScoringResult(BaseModel): aggregated_results: Dict[str, Union[bool, float, str, List[object], object, None]] + """Map of metric name to aggregated value""" score_rows: List[Dict[str, Union[bool, float, str, List[object], object, None]]] + """The scoring result for each row. Each row is a map of column name to value.""" diff --git a/src/llama_stack_client/types/shield_call_step.py b/src/llama_stack_client/types/shield_call_step.py index 8c539d0b..38ca0b5c 100644 --- a/src/llama_stack_client/types/shield_call_step.py +++ b/src/llama_stack_client/types/shield_call_step.py @@ -12,13 +12,18 @@ class ShieldCallStep(BaseModel): step_id: str + """The ID of the step.""" step_type: Literal["shield_call"] turn_id: str + """The ID of the turn.""" completed_at: Optional[datetime] = None + """The time the step completed.""" started_at: Optional[datetime] = None + """The time the step started.""" violation: Optional[SafetyViolation] = None + """The violation from the shield call.""" diff --git a/src/llama_stack_client/types/tool_execution_step.py b/src/llama_stack_client/types/tool_execution_step.py index c4ad5d68..5eb2c23b 100644 --- a/src/llama_stack_client/types/tool_execution_step.py +++ b/src/llama_stack_client/types/tool_execution_step.py @@ -13,15 +13,21 @@ class ToolExecutionStep(BaseModel): step_id: str + """The ID of the step.""" step_type: Literal["tool_execution"] tool_calls: List[ToolCall] + """The tool calls to execute.""" tool_responses: List[ToolResponse] + """The tool responses from the tool calls.""" turn_id: str + """The ID of the turn.""" completed_at: Optional[datetime] = None + """The time the step completed.""" started_at: Optional[datetime] = None + """The time the step started.""" diff --git a/src/llama_stack_client/types/tool_response_param.py b/src/llama_stack_client/types/tool_response_param.py new file mode 100644 index 00000000..8ac14862 --- /dev/null +++ b/src/llama_stack_client/types/tool_response_param.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable +from typing_extensions import Literal, Required, TypedDict + +from .shared_params.interleaved_content import InterleavedContent + +__all__ = ["ToolResponseParam"] + + +class ToolResponseParam(TypedDict, total=False): + call_id: Required[str] + + content: Required[InterleavedContent] + """A image content item""" + + tool_name: Required[Union[Literal["brave_search", "wolfram_alpha", "photogen", "code_interpreter"], str]] + + metadata: Dict[str, Union[bool, float, str, Iterable[object], object, None]] diff --git a/tests/api_resources/agents/test_turn.py b/tests/api_resources/agents/test_turn.py index 311dfcd8..3eacbba0 100644 --- a/tests/api_resources/agents/test_turn.py +++ b/tests/api_resources/agents/test_turn.py @@ -303,7 +303,6 @@ def test_method_resume_overload_1(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -320,8 +319,8 @@ def test_method_resume_with_all_params_overload_1(self, client: LlamaStackClient { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", + "metadata": {"foo": True}, } ], stream=False, @@ -338,7 +337,6 @@ def test_raw_response_resume_overload_1(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -359,7 +357,6 @@ def test_streaming_response_resume_overload_1(self, client: LlamaStackClient) -> { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -383,7 +380,6 @@ def test_path_params_resume_overload_1(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -398,7 +394,6 @@ def test_path_params_resume_overload_1(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -413,7 +408,6 @@ def test_path_params_resume_overload_1(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -430,7 +424,6 @@ def test_method_resume_overload_2(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -448,7 +441,6 @@ def test_raw_response_resume_overload_2(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -469,7 +461,6 @@ def test_streaming_response_resume_overload_2(self, client: LlamaStackClient) -> { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -494,7 +485,6 @@ def test_path_params_resume_overload_2(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -510,7 +500,6 @@ def test_path_params_resume_overload_2(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -526,7 +515,6 @@ def test_path_params_resume_overload_2(self, client: LlamaStackClient) -> None: { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -822,7 +810,6 @@ async def test_method_resume_overload_1(self, async_client: AsyncLlamaStackClien { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -839,8 +826,8 @@ async def test_method_resume_with_all_params_overload_1(self, async_client: Asyn { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", + "metadata": {"foo": True}, } ], stream=False, @@ -857,7 +844,6 @@ async def test_raw_response_resume_overload_1(self, async_client: AsyncLlamaStac { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -878,7 +864,6 @@ async def test_streaming_response_resume_overload_1(self, async_client: AsyncLla { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -902,7 +887,6 @@ async def test_path_params_resume_overload_1(self, async_client: AsyncLlamaStack { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -917,7 +901,6 @@ async def test_path_params_resume_overload_1(self, async_client: AsyncLlamaStack { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -932,7 +915,6 @@ async def test_path_params_resume_overload_1(self, async_client: AsyncLlamaStack { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -949,7 +931,6 @@ async def test_method_resume_overload_2(self, async_client: AsyncLlamaStackClien { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -967,7 +948,6 @@ async def test_raw_response_resume_overload_2(self, async_client: AsyncLlamaStac { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -988,7 +968,6 @@ async def test_streaming_response_resume_overload_2(self, async_client: AsyncLla { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -1013,7 +992,6 @@ async def test_path_params_resume_overload_2(self, async_client: AsyncLlamaStack { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -1029,7 +1007,6 @@ async def test_path_params_resume_overload_2(self, async_client: AsyncLlamaStack { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ], @@ -1045,7 +1022,6 @@ async def test_path_params_resume_overload_2(self, async_client: AsyncLlamaStack { "call_id": "call_id", "content": "string", - "role": "tool", "tool_name": "brave_search", } ],