ExUtcp.Client (ex_utcp v0.2.8)
View SourceMain UTCP client implementation.
This module provides the primary interface for interacting with UTCP providers and tools. It manages provider registration, tool discovery, and tool execution.
Summary
Functions
Calls a specific tool with the given arguments.
Calls a tool with streaming support.
Returns a specification to start this module under a supervisor.
Converts multiple OpenAPI specifications to UTCP tools and registers them.
Converts an OpenAPI specification to UTCP tools and registers them.
Deregisters a tool provider.
Gets the client configuration.
Gets repository statistics.
Gets all available transports.
Registers a tool provider and returns the discovered tools.
Searches for tools matching the given query.
Starts a new UTCP client with the given configuration.
Starts a new UTCP client with the given configuration and name.
Validates an OpenAPI specification.
Functions
@spec call_tool(GenServer.server(), String.t(), map()) :: ExUtcp.Types.call_result()
Calls a specific tool with the given arguments.
@spec call_tool_stream(GenServer.server(), String.t(), map()) :: {:ok, ExUtcp.Types.stream_result()} | {:error, any()}
Calls a tool with streaming support.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec convert_multiple_openapi(GenServer.server(), list(), keyword()) :: ExUtcp.Types.register_result()
Converts multiple OpenAPI specifications to UTCP tools and registers them.
Parameters
client: UTCP clientspecs: List of OpenAPI specificationsopts: Conversion options
Returns
{:ok, tools} on success, {:error, reason} on failure.
@spec convert_openapi(GenServer.server(), map() | String.t(), keyword()) :: ExUtcp.Types.register_result()
Converts an OpenAPI specification to UTCP tools and registers them.
Parameters
client: UTCP clientspec: OpenAPI specification (map, URL, or file path)opts: Conversion options
Returns
{:ok, tools} on success, {:error, reason} on failure.
@spec deregister_tool_provider(GenServer.server(), String.t()) :: ExUtcp.Types.deregister_result()
Deregisters a tool provider.
@spec get_config(GenServer.server()) :: ExUtcp.Types.client_config()
Gets the client configuration.
@spec get_stats(GenServer.server()) :: map()
Gets repository statistics.
@spec get_transports(GenServer.server()) :: %{required(String.t()) => module()}
Gets all available transports.
@spec register_tool_provider(GenServer.server(), ExUtcp.Types.provider()) :: ExUtcp.Types.register_result()
Registers a tool provider and returns the discovered tools.
@spec search_tools(GenServer.server(), String.t(), integer()) :: ExUtcp.Types.search_result()
Searches for tools matching the given query.
@spec start_link(ExUtcp.Types.client_config()) :: GenServer.on_start()
Starts a new UTCP client with the given configuration.
@spec start_link(ExUtcp.Types.client_config(), GenServer.name()) :: GenServer.on_start()
Starts a new UTCP client with the given configuration and name.
@spec validate_openapi(GenServer.server(), map()) :: {:ok, map()} | {:error, term()}
Validates an OpenAPI specification.
Parameters
client: UTCP clientspec: OpenAPI specification
Returns
{:ok, validation_result} on success, {:error, reason} on failure.