ExUtcp.Transports.Behaviour behaviour (ex_utcp v0.3.2)

Copy Markdown View Source

Behaviour definition for UTCP transports.

All transport implementations must implement this behaviour to ensure consistent interface across different communication protocols.

Summary

Callbacks

Calls a specific tool with the given arguments.

Calls a tool with streaming support.

Closes the transport and cleans up resources.

Deregisters a tool provider.

Registers a tool provider and returns the discovered tools.

Checks if the transport supports streaming.

Gets the transport name.

Callbacks

call_tool(t, map, provider)

@callback call_tool(String.t(), map(), ExUtcp.Types.provider()) ::
  ExUtcp.Types.call_result()

Calls a specific tool with the given arguments.

call_tool_stream(t, map, provider)

@callback call_tool_stream(String.t(), map(), ExUtcp.Types.provider()) ::
  ExUtcp.Types.stream_call_result()

Calls a tool with streaming support.

close()

@callback close() :: :ok | {:error, any()}

Closes the transport and cleans up resources.

deregister_tool_provider(provider)

@callback deregister_tool_provider(ExUtcp.Types.provider()) ::
  ExUtcp.Types.deregister_result()

Deregisters a tool provider.

register_tool_provider(provider)

@callback register_tool_provider(ExUtcp.Types.provider()) ::
  ExUtcp.Types.register_result()

Registers a tool provider and returns the discovered tools.

supports_streaming?()

@callback supports_streaming?() :: boolean()

Checks if the transport supports streaming.

transport_name()

@callback transport_name() :: String.t()

Gets the transport name.