Tools domain
class yandex_ai_studio_sdk._tools.domain.AsyncTools
Class for tools functionality.
Tools are specialized utilities that extend the capabilities of language models and AI assistants by providing access to external functions, data sources, and computational resources. They enable models to perform actions beyond text generation, such as searching through knowledge bases, executing custom functions, and processing structured data.
This class serves as the foundation for tool management in both synchronous and asynchronous contexts, providing a unified interface for tools. For more information see the description of members of this class.
Tools are particularly useful in:
- AI Assistants: Extending conversational agents with external capabilities like web search, database queries, or API calls
- Completions: Enabling language models to invoke functions during text generation for dynamic content creation and problem-solving
The tools framework supports both streaming and non-streaming operations, making it suitable for real-time applications and batch processing scenarios.
property function: FunctionToolsTypeT
Get the function sub-domain for creating function tools.
generative_search(*, description, site=Undefined, host=Undefined, url=Undefined, enable_nrfm_docs=Undefined, search_filters=Undefined)
Creates GeberativeSearch tool which provide access to generative search by Search API for LLMs.
Not to be confused with sdk.search_api.generative. Tools domain is for creating tools for using in LLMs/Assistants and search_api domain is for using Search API directly.
To learn more about parameters and their formats and possible values, refer to generative search documentation
NB: All of the site, host, url parameters are mutually exclusive.
|
Parameters |
|
|
Return type |
property rephraser: RephraserFunction
Get the rephraser for creating query transformation models.
The rephraser provides access to specialized language models designed to intelligently rewrite and enhance user search queries by incorporating conversational context. This is particularly useful in multi-turn conversations where the latest user message may lack context from previous exchanges.
The rephraser works by: - Analyzing the conversation history and current user query - Reformulating the query to be more specific and contextually complete - Improving search relevance by expanding abbreviated or ambiguous terms - Maintaining semantic intent while adding necessary context
The rephraser returns a factory that can create Rephraser model instances with different configurations, supporting various model types including the default ‘rephraser’ model or custom rephrasing models.
search_index(indexes, *, max_num_results=Undefined, rephraser=Undefined, call_strategy=Undefined)
Creates SearchIndexTool (not to be confused with SearchIndex/AsyncSearchIndex).
|
Parameters |
|
|
Return type |
Types
class yandex_ai_studio_sdk._tools.tool_call.AsyncToolCall
A tool call returned by models as a result of server-side tool calls.
This class encapsulates the response from language models when they invoke tools during conversation or completion. It contains information about the specific tool that was called, including its unique identifier and the associated function call with parameters and results.
Unique tool call identifier
function: FunctionCallTypeT | None
Function call associated with this tool call
class yandex_ai_studio_sdk._tools.function_call.AsyncFunctionCall
Represents a function call returned by models as a result of server-side tool calls.
This class encapsulates the details of a function call that was invoked by the model during processing, including the function name and the arguments passed to it.
name: str
Name of the function being called
arguments: JsonObject
Arguments passed to the function