From 6f7f2ea76ff9690a2d74e44a6e8ad6b74e03fc0b Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:29:52 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-python-sdk: 4.37.0 --- .fern/metadata.json | 2 +- .gitignore | 2 - src/agora_agent/agent_management/client.py | 6 ++ .../agent_management/raw_client.py | 6 ++ ..._management_request_on_listening_action.py | 2 +- ...t_management_request_on_speaking_action.py | 4 +- ...t_management_request_on_thinking_action.py | 4 +- .../types/start_agents_request_properties.py | 1 + ..._agents_request_properties_filler_words.py | 1 + ...request_properties_filler_words_content.py | 19 +++++- ...s_filler_words_content_generated_config.py | 40 +++++++++++++ ...s_content_generated_config_llm_provider.py | 37 ++++++++++++ ...st_properties_filler_words_content_mode.py | 5 ++ ...ties_filler_words_content_static_config.py | 3 +- src/agora_agent/core/client_wrapper.py | 4 +- src/agora_agent/types/ares_asr.py | 5 ++ src/agora_agent/types/ares_asr_params.py | 24 +------- src/agora_agent/types/asr.py | 2 + src/agora_agent/types/fengming_asr.py | 5 ++ src/agora_agent/types/fengming_asr_params.py | 24 +------- src/agora_agent/types/llm.py | 14 +++++ src/agora_agent/types/llm_tool.py | 35 +++++++++++ src/agora_agent/types/llm_tool_execution.py | 27 +++++++++ src/agora_agent/types/llm_tool_function.py | 38 ++++++++++++ .../types/llm_tool_function_parameters.py | 37 ++++++++++++ src/agora_agent/types/llm_tool_server.py | 59 +++++++++++++++++++ .../types/llm_tool_server_method.py | 5 ++ 27 files changed, 354 insertions(+), 57 deletions(-) create mode 100644 src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_generated_config.py create mode 100644 src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_generated_config_llm_provider.py create mode 100644 src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_mode.py create mode 100644 src/agora_agent/types/llm_tool.py create mode 100644 src/agora_agent/types/llm_tool_execution.py create mode 100644 src/agora_agent/types/llm_tool_function.py create mode 100644 src/agora_agent/types/llm_tool_function_parameters.py create mode 100644 src/agora_agent/types/llm_tool_server.py create mode 100644 src/agora_agent/types/llm_tool_server_method.py diff --git a/.fern/metadata.json b/.fern/metadata.json index 38df215..3e6a357 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -14,5 +14,5 @@ }, "exclude_types_from_init_exports": true }, - "originGitCommit": "5628d83c49f74825c20264a58866202f18d481ff" + "originGitCommit": "f4b5b1d56fb73c4e26c11486424723c12e6376bc" } \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3e30921..d2e4ca8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,3 @@ __pycache__/ dist/ poetry.toml -.venv/ -docs/superpowers/ diff --git a/src/agora_agent/agent_management/client.py b/src/agora_agent/agent_management/client.py index 6140649..4dc2add 100644 --- a/src/agora_agent/agent_management/client.py +++ b/src/agora_agent/agent_management/client.py @@ -74,16 +74,19 @@ def agent_think( - `inject`: Inject the custom text instruction into the current turn without interrupting it. - `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue. - `ignore`: Ignore the request. + - `append`: Do not interrupt the user. Wait for the user's ASR text to be sent to the LLM and for the resulting response to finish, then send the custom text instruction to the LLM. on_thinking_action : typing.Optional[AgentThinkAgentManagementRequestOnThinkingAction] The action to take when the agent is in a thinking state: - `interrupt`: Interrupt the current state and start a new conversation turn. - `ignore`: Ignore the request. + - `append`: Do not interrupt the current LLM inference. Allow the current turn to finish generating and playing its response first. After the current turn's LLM output is complete, send the queued custom text instruction to the LLM. on_speaking_action : typing.Optional[AgentThinkAgentManagementRequestOnSpeakingAction] The action to take when the agent is in a speaking state: - `interrupt`: Interrupt the current state and start a new conversation turn. - `ignore`: Ignore the request. + - `append`: Do not interrupt the current TTS playback; the audio stream continues. After the current turn's LLM output is complete, send the custom text instruction directly to the LLM. interruptable : typing.Optional[bool] Whether user speech can interrupt the injected instruction: @@ -189,16 +192,19 @@ async def agent_think( - `inject`: Inject the custom text instruction into the current turn without interrupting it. - `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue. - `ignore`: Ignore the request. + - `append`: Do not interrupt the user. Wait for the user's ASR text to be sent to the LLM and for the resulting response to finish, then send the custom text instruction to the LLM. on_thinking_action : typing.Optional[AgentThinkAgentManagementRequestOnThinkingAction] The action to take when the agent is in a thinking state: - `interrupt`: Interrupt the current state and start a new conversation turn. - `ignore`: Ignore the request. + - `append`: Do not interrupt the current LLM inference. Allow the current turn to finish generating and playing its response first. After the current turn's LLM output is complete, send the queued custom text instruction to the LLM. on_speaking_action : typing.Optional[AgentThinkAgentManagementRequestOnSpeakingAction] The action to take when the agent is in a speaking state: - `interrupt`: Interrupt the current state and start a new conversation turn. - `ignore`: Ignore the request. + - `append`: Do not interrupt the current TTS playback; the audio stream continues. After the current turn's LLM output is complete, send the custom text instruction directly to the LLM. interruptable : typing.Optional[bool] Whether user speech can interrupt the injected instruction: diff --git a/src/agora_agent/agent_management/raw_client.py b/src/agora_agent/agent_management/raw_client.py index 4af36fe..3a95240 100644 --- a/src/agora_agent/agent_management/raw_client.py +++ b/src/agora_agent/agent_management/raw_client.py @@ -67,16 +67,19 @@ def agent_think( - `inject`: Inject the custom text instruction into the current turn without interrupting it. - `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue. - `ignore`: Ignore the request. + - `append`: Do not interrupt the user. Wait for the user's ASR text to be sent to the LLM and for the resulting response to finish, then send the custom text instruction to the LLM. on_thinking_action : typing.Optional[AgentThinkAgentManagementRequestOnThinkingAction] The action to take when the agent is in a thinking state: - `interrupt`: Interrupt the current state and start a new conversation turn. - `ignore`: Ignore the request. + - `append`: Do not interrupt the current LLM inference. Allow the current turn to finish generating and playing its response first. After the current turn's LLM output is complete, send the queued custom text instruction to the LLM. on_speaking_action : typing.Optional[AgentThinkAgentManagementRequestOnSpeakingAction] The action to take when the agent is in a speaking state: - `interrupt`: Interrupt the current state and start a new conversation turn. - `ignore`: Ignore the request. + - `append`: Do not interrupt the current TTS playback; the audio stream continues. After the current turn's LLM output is complete, send the custom text instruction directly to the LLM. interruptable : typing.Optional[bool] Whether user speech can interrupt the injected instruction: @@ -170,16 +173,19 @@ async def agent_think( - `inject`: Inject the custom text instruction into the current turn without interrupting it. - `interrupt`: Immediately interrupt the current flow and initiate a new round of dialogue. - `ignore`: Ignore the request. + - `append`: Do not interrupt the user. Wait for the user's ASR text to be sent to the LLM and for the resulting response to finish, then send the custom text instruction to the LLM. on_thinking_action : typing.Optional[AgentThinkAgentManagementRequestOnThinkingAction] The action to take when the agent is in a thinking state: - `interrupt`: Interrupt the current state and start a new conversation turn. - `ignore`: Ignore the request. + - `append`: Do not interrupt the current LLM inference. Allow the current turn to finish generating and playing its response first. After the current turn's LLM output is complete, send the queued custom text instruction to the LLM. on_speaking_action : typing.Optional[AgentThinkAgentManagementRequestOnSpeakingAction] The action to take when the agent is in a speaking state: - `interrupt`: Interrupt the current state and start a new conversation turn. - `ignore`: Ignore the request. + - `append`: Do not interrupt the current TTS playback; the audio stream continues. After the current turn's LLM output is complete, send the custom text instruction directly to the LLM. interruptable : typing.Optional[bool] Whether user speech can interrupt the injected instruction: diff --git a/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_listening_action.py b/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_listening_action.py index 3812a6e..667565c 100644 --- a/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_listening_action.py +++ b/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_listening_action.py @@ -3,5 +3,5 @@ import typing AgentThinkAgentManagementRequestOnListeningAction = typing.Union[ - typing.Literal["inject", "interrupt", "ignore"], typing.Any + typing.Literal["inject", "interrupt", "ignore", "append"], typing.Any ] diff --git a/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_speaking_action.py b/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_speaking_action.py index 3cfe7a4..e2147b1 100644 --- a/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_speaking_action.py +++ b/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_speaking_action.py @@ -2,4 +2,6 @@ import typing -AgentThinkAgentManagementRequestOnSpeakingAction = typing.Union[typing.Literal["interrupt", "ignore"], typing.Any] +AgentThinkAgentManagementRequestOnSpeakingAction = typing.Union[ + typing.Literal["interrupt", "ignore", "append"], typing.Any +] diff --git a/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_thinking_action.py b/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_thinking_action.py index 996272f..961e5a1 100644 --- a/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_thinking_action.py +++ b/src/agora_agent/agent_management/types/agent_think_agent_management_request_on_thinking_action.py @@ -2,4 +2,6 @@ import typing -AgentThinkAgentManagementRequestOnThinkingAction = typing.Union[typing.Literal["interrupt", "ignore"], typing.Any] +AgentThinkAgentManagementRequestOnThinkingAction = typing.Union[ + typing.Literal["interrupt", "ignore", "append"], typing.Any +] diff --git a/src/agora_agent/agents/types/start_agents_request_properties.py b/src/agora_agent/agents/types/start_agents_request_properties.py index d1945ea..21236fd 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties.py +++ b/src/agora_agent/agents/types/start_agents_request_properties.py @@ -120,6 +120,7 @@ class StartAgentsRequestProperties(UncheckedBaseModel): filler_words: typing.Optional[StartAgentsRequestPropertiesFillerWords] = pydantic.Field(default=None) """ Filler word configuration. Plays filler words while waiting for LLM responses to reduce user anxiety and improve conversation flow. + When `enable` is `true`, `content.static_config.phrases` must be present and non-empty, even when `content.mode` is `generated`, because generated mode still falls back to static filler words. """ parameters: typing.Optional[StartAgentsRequestPropertiesParameters] = pydantic.Field(default=None) diff --git a/src/agora_agent/agents/types/start_agents_request_properties_filler_words.py b/src/agora_agent/agents/types/start_agents_request_properties_filler_words.py index 18b34fb..136077e 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_filler_words.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_filler_words.py @@ -12,6 +12,7 @@ class StartAgentsRequestPropertiesFillerWords(UncheckedBaseModel): """ Filler word configuration. Plays filler words while waiting for LLM responses to reduce user anxiety and improve conversation flow. + When `enable` is `true`, `content.static_config.phrases` must be present and non-empty, even when `content.mode` is `generated`, because generated mode still falls back to static filler words. """ enable: typing.Optional[bool] = pydantic.Field(default=None) diff --git a/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content.py b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content.py index 47deff3..9dfc0b6 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content.py @@ -5,6 +5,12 @@ import pydantic from ...core.pydantic_utilities import IS_PYDANTIC_V2 from ...core.unchecked_base_model import UncheckedBaseModel +from .start_agents_request_properties_filler_words_content_generated_config import ( + StartAgentsRequestPropertiesFillerWordsContentGeneratedConfig, +) +from .start_agents_request_properties_filler_words_content_mode import ( + StartAgentsRequestPropertiesFillerWordsContentMode, +) from .start_agents_request_properties_filler_words_content_static_config import ( StartAgentsRequestPropertiesFillerWordsContentStaticConfig, ) @@ -15,17 +21,26 @@ class StartAgentsRequestPropertiesFillerWordsContent(UncheckedBaseModel): Filler word content configuration. Defines the source and selection rules for filler words. """ - mode: typing.Optional[typing.Literal["static"]] = pydantic.Field(default=None) + mode: typing.Optional[StartAgentsRequestPropertiesFillerWordsContentMode] = pydantic.Field(default=None) """ Filler word content mode: - `static`: Static filler words. Uses a predefined list of filler words. + - `generated`: LLM-generated filler words based on the last user message. Falls back to static filler words when generation is not ready, fails, or returns empty text. """ static_config: typing.Optional[StartAgentsRequestPropertiesFillerWordsContentStaticConfig] = pydantic.Field( default=None ) """ - Static filler word configuration. Used when `mode` is `static`. + Static filler word configuration. Required when `mode` is `static`. + Also required whenever `filler_words.enable` is `true`, including when `mode` is `generated`, because generated mode uses static filler words as fallback. + """ + + generated_config: typing.Optional[StartAgentsRequestPropertiesFillerWordsContentGeneratedConfig] = pydantic.Field( + default=None + ) + """ + Generated filler word configuration. Required when `content.mode` is `generated`. """ if IS_PYDANTIC_V2: diff --git a/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_generated_config.py b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_generated_config.py new file mode 100644 index 0000000..2a2f4d2 --- /dev/null +++ b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_generated_config.py @@ -0,0 +1,40 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel +from .start_agents_request_properties_filler_words_content_generated_config_llm_provider import ( + StartAgentsRequestPropertiesFillerWordsContentGeneratedConfigLlmProvider, +) + + +class StartAgentsRequestPropertiesFillerWordsContentGeneratedConfig(UncheckedBaseModel): + """ + Generated filler word configuration. Required when `content.mode` is `generated`. + """ + + llm_provider: StartAgentsRequestPropertiesFillerWordsContentGeneratedConfigLlmProvider = pydantic.Field() + """ + OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM and only uses the last user message as input. + """ + + prompt: str = pydantic.Field() + """ + System prompt used to generate a short filler phrase based on the last user message. The generated text should be conversational and must not answer the user's question. + """ + + fallback_strategy: typing.Literal["static"] = pydantic.Field(default="static") + """ + Fallback strategy when generated filler text is not ready, fails, or returns empty text. Phase 1 only supports `static`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_generated_config_llm_provider.py b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_generated_config_llm_provider.py new file mode 100644 index 0000000..f8896fd --- /dev/null +++ b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_generated_config_llm_provider.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ...core.pydantic_utilities import IS_PYDANTIC_V2 +from ...core.unchecked_base_model import UncheckedBaseModel + + +class StartAgentsRequestPropertiesFillerWordsContentGeneratedConfigLlmProvider(UncheckedBaseModel): + """ + OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM and only uses the last user message as input. + """ + + base_url: str = pydantic.Field() + """ + Base URL of the OpenAI-compatible chat completions endpoint. If the URL does not end with `/chat/completions`, the engine appends it automatically. + """ + + api_key: str = pydantic.Field() + """ + API key for authenticating requests to the filler LLM provider. + """ + + params: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + """ + Additional request parameters merged into the generated filler LLM request body, such as `model`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_mode.py b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_mode.py new file mode 100644 index 0000000..a36d620 --- /dev/null +++ b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_mode.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +StartAgentsRequestPropertiesFillerWordsContentMode = typing.Union[typing.Literal["static", "generated"], typing.Any] diff --git a/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_static_config.py b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_static_config.py index 7fe264c..f68de0c 100644 --- a/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_static_config.py +++ b/src/agora_agent/agents/types/start_agents_request_properties_filler_words_content_static_config.py @@ -12,7 +12,8 @@ class StartAgentsRequestPropertiesFillerWordsContentStaticConfig(UncheckedBaseModel): """ - Static filler word configuration. Used when `mode` is `static`. + Static filler word configuration. Required when `mode` is `static`. + Also required whenever `filler_words.enable` is `true`, including when `mode` is `generated`, because generated mode uses static filler words as fallback. """ phrases: typing.List[str] = pydantic.Field() diff --git a/src/agora_agent/core/client_wrapper.py b/src/agora_agent/core/client_wrapper.py index b4179b8..d217bcd 100644 --- a/src/agora_agent/core/client_wrapper.py +++ b/src/agora_agent/core/client_wrapper.py @@ -26,10 +26,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "agora-agents/v2.6.0", + "User-Agent": "agora-agents/v2.7.0", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "agora-agents", - "X-Fern-SDK-Version": "v2.6.0", + "X-Fern-SDK-Version": "v2.7.0", **(self.get_custom_headers() or {}), } headers["Authorization"] = httpx.BasicAuth(self._get_username(), self._get_password())._auth_header diff --git a/src/agora_agent/types/ares_asr.py b/src/agora_agent/types/ares_asr.py index cf42216..001bb97 100644 --- a/src/agora_agent/types/ares_asr.py +++ b/src/agora_agent/types/ares_asr.py @@ -15,6 +15,11 @@ class AresAsr(UncheckedBaseModel): """ language: typing.Optional[AsrLanguage] = None + keywords: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of hotwords to improve ASR accuracy. + """ + params: typing.Optional[AresAsrParams] = None if IS_PYDANTIC_V2: diff --git a/src/agora_agent/types/ares_asr_params.py b/src/agora_agent/types/ares_asr_params.py index be409ae..afa1d76 100644 --- a/src/agora_agent/types/ares_asr_params.py +++ b/src/agora_agent/types/ares_asr_params.py @@ -2,26 +2,4 @@ import typing -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class AresAsrParams(UncheckedBaseModel): - """ - ARES ASR configuration parameters. - """ - - keywords: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of hotwords to improve ASR accuracy. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow +AresAsrParams = typing.Dict[str, typing.Any] diff --git a/src/agora_agent/types/asr.py b/src/agora_agent/types/asr.py index fea592b..8e02cde 100644 --- a/src/agora_agent/types/asr.py +++ b/src/agora_agent/types/asr.py @@ -29,6 +29,7 @@ class Asr_Ares(UncheckedBaseModel): vendor: typing.Literal["ares"] = "ares" language: typing.Optional[AsrLanguage] = None + keywords: typing.Optional[typing.List[str]] = None params: typing.Optional[AresAsrParams] = None if IS_PYDANTIC_V2: @@ -44,6 +45,7 @@ class Config: class Asr_Fengming(UncheckedBaseModel): vendor: typing.Literal["fengming"] = "fengming" language: typing.Optional[AsrLanguage] = None + keywords: typing.Optional[typing.List[str]] = None params: typing.Optional[FengmingAsrParams] = None if IS_PYDANTIC_V2: diff --git a/src/agora_agent/types/fengming_asr.py b/src/agora_agent/types/fengming_asr.py index bb45b68..17f72ce 100644 --- a/src/agora_agent/types/fengming_asr.py +++ b/src/agora_agent/types/fengming_asr.py @@ -15,6 +15,11 @@ class FengmingAsr(UncheckedBaseModel): """ language: typing.Optional[AsrLanguage] = None + keywords: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + A list of hotwords to improve ASR accuracy. + """ + params: typing.Optional[FengmingAsrParams] = None if IS_PYDANTIC_V2: diff --git a/src/agora_agent/types/fengming_asr_params.py b/src/agora_agent/types/fengming_asr_params.py index 1a32523..87f0878 100644 --- a/src/agora_agent/types/fengming_asr_params.py +++ b/src/agora_agent/types/fengming_asr_params.py @@ -2,26 +2,4 @@ import typing -import pydantic -from ..core.pydantic_utilities import IS_PYDANTIC_V2 -from ..core.unchecked_base_model import UncheckedBaseModel - - -class FengmingAsrParams(UncheckedBaseModel): - """ - Agora Fengming ASR configuration parameters. - """ - - keywords: typing.Optional[typing.List[str]] = pydantic.Field(default=None) - """ - A list of hotwords to improve ASR accuracy. - """ - - if IS_PYDANTIC_V2: - model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 - else: - - class Config: - frozen = True - smart_union = True - extra = pydantic.Extra.allow +FengmingAsrParams = typing.Dict[str, typing.Any] diff --git a/src/agora_agent/types/llm.py b/src/agora_agent/types/llm.py index 214b025..8101636 100644 --- a/src/agora_agent/types/llm.py +++ b/src/agora_agent/types/llm.py @@ -8,6 +8,7 @@ from .llm_greeting_configs import LlmGreetingConfigs from .llm_params import LlmParams from .llm_style import LlmStyle +from .llm_tool import LlmTool class Llm(UncheckedBaseModel): @@ -111,6 +112,19 @@ class Llm(UncheckedBaseModel): MCP server configuration. """ + tools: typing.Optional[typing.List[LlmTool]] = pydantic.Field(default=None) + """ + Inline REST (pass-through sync) tool definitions for standard text LLM function calling. + Required fields per tool: `type`, `function.name`, `function.parameters` + (`type: object` with `properties`), `server.method` (`GET` or `POST`), and `server.url`. + The combination of `type: function` and `server` identifies a REST tool. + Phase 1a supports GET and POST only; `execution.mode` defaults to and only accepts `sync`. + Template rules: + - Values must be a constant, or exactly one single-level placeholder. + - `{{args.}}`: `server.url` and `server.body` only; not allowed in headers. + - `{{template_variables.}}` and `{{tool_call_id}}`: `server.url`, `server.headers`, and `server.body`. + """ + headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) """ Custom headers to include in requests to the LLM. diff --git a/src/agora_agent/types/llm_tool.py b/src/agora_agent/types/llm_tool.py new file mode 100644 index 0000000..2ab8e40 --- /dev/null +++ b/src/agora_agent/types/llm_tool.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .llm_tool_execution import LlmToolExecution +from .llm_tool_function import LlmToolFunction +from .llm_tool_server import LlmToolServer + + +class LlmTool(UncheckedBaseModel): + """ + Inline REST tool definition. `type: function` combined with `server` declares a REST tool. + Phase 1a executes the HTTP request synchronously and returns the raw result to the model context. + """ + + type: typing.Literal["function"] = pydantic.Field(default="function") + """ + Tool type. Must be `function`. + """ + + function: LlmToolFunction + execution: typing.Optional[LlmToolExecution] = None + server: LlmToolServer + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/agora_agent/types/llm_tool_execution.py b/src/agora_agent/types/llm_tool_execution.py new file mode 100644 index 0000000..ee8d578 --- /dev/null +++ b/src/agora_agent/types/llm_tool_execution.py @@ -0,0 +1,27 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class LlmToolExecution(UncheckedBaseModel): + """ + Tool execution configuration. Defaults to `{"mode": "sync"}`. Phase 1a only allows `sync`. + """ + + mode: typing.Optional[typing.Literal["sync"]] = pydantic.Field(default=None) + """ + Execution mode. Phase 1a only accepts `sync`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/agora_agent/types/llm_tool_function.py b/src/agora_agent/types/llm_tool_function.py new file mode 100644 index 0000000..f574764 --- /dev/null +++ b/src/agora_agent/types/llm_tool_function.py @@ -0,0 +1,38 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .llm_tool_function_parameters import LlmToolFunctionParameters + + +class LlmToolFunction(UncheckedBaseModel): + """ + Tool interface exposed to the model. `parameters` defines LLM arguments, not the HTTP request shape. + """ + + name: str = pydantic.Field() + """ + Function name visible to the model. Used as the REST tool index key (ASCII case-insensitive). + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + Function description visible to the model. + """ + + parameters: LlmToolFunctionParameters = pydantic.Field() + """ + JSON Schema defining the LLM tool-call arguments (`args`). Must be an object schema with `type: object` and `properties`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/agora_agent/types/llm_tool_function_parameters.py b/src/agora_agent/types/llm_tool_function_parameters.py new file mode 100644 index 0000000..21d9897 --- /dev/null +++ b/src/agora_agent/types/llm_tool_function_parameters.py @@ -0,0 +1,37 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel + + +class LlmToolFunctionParameters(UncheckedBaseModel): + """ + JSON Schema defining the LLM tool-call arguments (`args`). Must be an object schema with `type: object` and `properties`. + """ + + type: typing.Literal["object"] = pydantic.Field(default="object") + """ + JSON Schema type. Must be `object`. + """ + + properties: typing.Dict[str, typing.Any] = pydantic.Field() + """ + Argument property definitions keyed by argument name. + """ + + required: typing.Optional[typing.List[str]] = pydantic.Field(default=None) + """ + List of required argument names. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/agora_agent/types/llm_tool_server.py b/src/agora_agent/types/llm_tool_server.py new file mode 100644 index 0000000..5120304 --- /dev/null +++ b/src/agora_agent/types/llm_tool_server.py @@ -0,0 +1,59 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ..core.pydantic_utilities import IS_PYDANTIC_V2 +from ..core.unchecked_base_model import UncheckedBaseModel +from .llm_tool_server_method import LlmToolServerMethod + + +class LlmToolServer(UncheckedBaseModel): + """ + Actual HTTP request configuration for this REST tool. + Does not use top-level `parameters`, `path_params`, standalone `query`, + `response`, `json_path`, or `max_chars`. + """ + + method: LlmToolServerMethod = pydantic.Field() + """ + HTTP method. Must be `GET` or `POST`. + """ + + url: str = pydantic.Field() + """ + Full request URL. Write path and query templates directly in the URL. + Placeholders allowed: `{{args.}}`, `{{template_variables.}}`, + and `{{tool_call_id}}`. URL values may be string, number, or boolean. + """ + + headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None) + """ + Request headers as a string dictionary. + Each header value must be a constant or exactly one placeholder. + Placeholders allowed: `{{template_variables.}}` and `{{tool_call_id}}`. + `{{args.*}}` is not allowed in headers. + """ + + body: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) + """ + POST JSON body template. Must not be configured for `GET` requests. + Supports arbitrary nested JSON. Only fields declared in `server.body` are sent. + Leaf values may be constants or exactly one of `{{args.}}`, + `{{template_variables.}}`, or `{{tool_call_id}}`. + JSON body preserves original types after rendering. + """ + + timeout_ms: typing.Optional[int] = pydantic.Field(default=None) + """ + Request timeout in milliseconds. Defaults to `10000`. Valid range is `1000` to `100000`. + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/agora_agent/types/llm_tool_server_method.py b/src/agora_agent/types/llm_tool_server_method.py new file mode 100644 index 0000000..9c9450e --- /dev/null +++ b/src/agora_agent/types/llm_tool_server_method.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +LlmToolServerMethod = typing.Union[typing.Literal["GET", "POST"], typing.Any] From 0a041453fb149e03c7e23f6dcfac14f7d2cb0cb0 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 13:29:52 +0000 Subject: [PATCH 2/2] [fern-replay] Applied customizations Patches applied (1): - patch-13d8e068: chore: ignore local venv and planning docs --- .fern/replay.lock | 10 ++++++++-- .gitignore | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index 7f3c6b3..cea052a 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -42,14 +42,20 @@ generations: cli_version: unknown generator_versions: fernapi/fern-python-sdk: 4.37.0 -current_generation: d45d59e496f49e87c4b94f49f4b80449e3d84dac + - commit_sha: c210d15d50ce28b5edf1a02b33fe0f2855b69b8f + tree_hash: 8c6c3d9abe19637590b92d95cddeb93f06ec030b + timestamp: 2026-08-19T13:29:49.213Z + cli_version: unknown + generator_versions: + fernapi/fern-python-sdk: 4.37.0 +current_generation: c210d15d50ce28b5edf1a02b33fe0f2855b69b8f patches: - id: patch-13d8e068 content_hash: sha256:97d879ab169016b9abaf1866427a8ebc45af608f69e063a07e5126c9613c329b original_commit: 13d8e0683ffa08bcfc9a381eb9604adf5abdbe0b original_message: "chore: ignore local venv and planning docs" original_author: plutoless - base_generation: d45d59e496f49e87c4b94f49f4b80449e3d84dac + base_generation: c210d15d50ce28b5edf1a02b33fe0f2855b69b8f files: - .gitignore patch_content: | diff --git a/.gitignore b/.gitignore index d2e4ca8..3e30921 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ __pycache__/ dist/ poetry.toml +.venv/ +docs/superpowers/