Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
},
"exclude_types_from_init_exports": true
},
"originGitCommit": "3fdb45ab45802742325afca544fdc22f5ae58db8"
"originGitCommit": "be0f6236d6bd8286609708d3af6dc8207e569abd"
}
78 changes: 75 additions & 3 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class StartAgentsRequestPropertiesFillerWordsContent(UncheckedBaseModel):
"""
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.
- `generated`: LLM-generated filler words based on recent conversation context.
"""

static_config: typing.Optional[StartAgentsRequestPropertiesFillerWordsContentStaticConfig] = pydantic.Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,29 @@ class StartAgentsRequestPropertiesFillerWordsContentGeneratedConfig(UncheckedBas
pydantic.Field(default=None)
)
"""
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.
OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM.
"""

prompt: typing.Optional[str] = pydantic.Field(default=None)
"""
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.
System prompt used to generate a short filler phrase based on recent conversation context. The generated text should be conversational and must not answer the user's question.
"""

fallback_strategy: typing.Optional[typing.Literal["static"]] = pydantic.Field(default=None)
"""
Fallback strategy when generated filler text is not ready, fails, or returns empty text. Phase 1 only supports `static`.
"""

context_message_limit: typing.Optional[int] = pydantic.Field(default=None)
"""
Maximum number of recent conversation messages used to generate a filler word.
"""

history_character_limit: typing.Optional[int] = pydantic.Field(default=None)
"""
Maximum number of characters from conversation history used to generate a filler word.
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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.
OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM.
"""

url: str = pydantic.Field()
Expand Down
4 changes: 2 additions & 2 deletions src/agora_agent/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ def __init__(

def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"User-Agent": "agora-agents/v2.8.1",
"User-Agent": "agora-agents/v2.9.0",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "agora-agents",
"X-Fern-SDK-Version": "v2.8.1",
"X-Fern-SDK-Version": "v2.9.0",
**(self.get_custom_headers() or {}),
}
headers["Authorization"] = httpx.BasicAuth(self._get_username(), self._get_password())._auth_header
Expand Down
17 changes: 17 additions & 0 deletions src/agora_agent/types/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from .microsoft_asr_params import MicrosoftAsrParams
from .open_ai_asr_params import OpenAiAsrParams
from .sarvam_asr_params import SarvamAsrParams
from .smallest_ai_asr_params import SmallestAiAsrParams
from .speechmatics_asr_params import SpeechmaticsAsrParams
from .tencent_asr_params import TencentAsrParams
from .x_ai_asr_params import XAiAsrParams
Expand Down Expand Up @@ -269,6 +270,21 @@ class Config:
extra = pydantic.Extra.allow


class Asr_Smallestai(UncheckedBaseModel):
vendor: typing.Literal["smallestai"] = "smallestai"
language: typing.Optional[str] = None
params: SmallestAiAsrParams

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


Asr = typing_extensions.Annotated[
typing.Union[
Asr_Ares,
Expand All @@ -287,6 +303,7 @@ class Config:
Asr_Xfyun,
Asr_XfyunBigmodel,
Asr_XfyunDialect,
Asr_Smallestai,
],
UnionMetadata(discriminant="vendor"),
]
7 changes: 4 additions & 3 deletions src/agora_agent/types/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from .llm_greeting_configs import LlmGreetingConfigs
from .llm_params import LlmParams
from .llm_style import LlmStyle
from .llm_tool import LlmTool
from .mcp_server import McpServer
from .rest_tool import RestTool


class Llm(UncheckedBaseModel):
Expand Down Expand Up @@ -107,12 +108,12 @@ class Llm(UncheckedBaseModel):
Template parameter configuration.
"""

mcp_servers: typing.Optional[typing.List[typing.Dict[str, typing.Any]]] = pydantic.Field(default=None)
mcp_servers: typing.Optional[typing.List[McpServer]] = pydantic.Field(default=None)
"""
MCP server configuration.
"""

tools: typing.Optional[typing.List[LlmTool]] = pydantic.Field(default=None)
tools: typing.Optional[typing.List[RestTool]] = 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`
Expand Down
54 changes: 54 additions & 0 deletions src/agora_agent/types/mcp_server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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 McpServer(UncheckedBaseModel):
name: str = pydantic.Field()
"""
A unique identifier for the MCP server. Maximum 48 characters. Accepts only English letters and numbers.
"""

endpoint: str = pydantic.Field()
"""
The endpoint address of the MCP server. The agent uses this to communicate with the MCP server.
"""

transport: typing.Optional[typing.Literal["streamable_http"]] = pydantic.Field(default=None)
"""
Transport protocol type.
- `streamable_http`: Streaming HTTP protocol
"""

headers: typing.Optional[typing.Dict[str, str]] = pydantic.Field(default=None)
"""
HTTP header information to include when requesting the MCP server, such as authentication information.
"""

allowed_tools: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
"""
A list of tools that the agent is allowed to invoke. The agent can only use tools on this list.
- Empty or omitted: All tools are enabled.
- Empty array `[]`: No tools are enabled.
- `["*"]`: All tools are enabled.
- Specific tools `["aa", "bb"]`: Only listed tools are enabled.
- Mix with wildcard `["aa", "*"]`: All tools are enabled (wildcard takes precedence).
"""

timeout_ms: typing.Optional[int] = pydantic.Field(default=None)
"""
The MCP server request timeout in milliseconds. After timeout, the agent stops waiting for the MCP server's response and continues executing subsequent logic.
"""

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
20 changes: 20 additions & 0 deletions src/agora_agent/types/mllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .mcp_server import McpServer
from .mllm_params import MllmParams
from .mllm_turn_detection import MllmTurnDetection
from .mllm_vendor import MllmVendor
from .rest_tool import RestTool


class Mllm(UncheckedBaseModel):
Expand Down Expand Up @@ -76,6 +78,24 @@ class Mllm(UncheckedBaseModel):
Agent failure message.
"""

tools: typing.Optional[typing.List[RestTool]] = 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.<name>}}`: `server.url` and `server.body` only; not allowed in headers.
- `{{template_variables.<name>}}` and `{{tool_call_id}}`: `server.url`, `server.headers`, and `server.body`.
"""

mcp_servers: typing.Optional[typing.List[McpServer]] = pydantic.Field(default=None)
"""
MCP server configuration.
"""

vendor: typing.Optional[MllmVendor] = pydantic.Field(default=None)
"""
MLLM provider.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
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
from .rest_tool_execution import RestToolExecution
from .rest_tool_function import RestToolFunction
from .rest_tool_server import RestToolServer


class LlmTool(UncheckedBaseModel):
class RestTool(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.
Expand All @@ -21,9 +21,22 @@ class LlmTool(UncheckedBaseModel):
Tool type. Must be `function`.
"""

function: LlmToolFunction
execution: typing.Optional[LlmToolExecution] = None
server: LlmToolServer
function: RestToolFunction = pydantic.Field()
"""
Tool interface exposed to the model. `parameters` is the JSON Schema for LLM arguments, not the HTTP request shape.
"""

execution: typing.Optional[RestToolExecution] = pydantic.Field(default=None)
"""
Tool execution configuration. Defaults to `{"mode": "sync"}`. Phase 1a only allows `sync`.
"""

server: RestToolServer = pydantic.Field()
"""
Actual HTTP request configuration for this REST tool.
Does not use top-level `parameters`, `path_params`, standalone `query`,
`response`, `json_path`, or `max_chars`.
"""

if IS_PYDANTIC_V2:
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ..core.unchecked_base_model import UncheckedBaseModel


class LlmToolExecution(UncheckedBaseModel):
class RestToolExecution(UncheckedBaseModel):
"""
Tool execution configuration. Defaults to `{"mode": "sync"}`. Phase 1a only allows `sync`.
"""
Expand Down
Loading
Loading