ExUtcp.Types (ex_utcp v0.2.8)

View Source

Core types and data structures for the UTCP protocol.

Summary

Types

api_key_auth()

@type api_key_auth() :: %{
  type: String.t(),
  api_key: String.t(),
  location: String.t(),
  var_name: String.t()
}

auth()

@type auth() :: %{type: String.t(), __struct__: module()}

basic_auth()

@type basic_auth() :: %{type: String.t(), username: String.t(), password: String.t()}

call_result()

@type call_result() :: {:ok, any()} | {:error, any()}

cli_provider()

@type cli_provider() :: %{
  name: String.t(),
  type: :cli,
  command_name: String.t(),
  working_dir: String.t() | nil,
  env_vars: %{required(String.t()) => String.t()}
}

client_config()

@type client_config() :: %{
  variables: %{required(String.t()) => String.t()},
  providers_file_path: String.t() | nil,
  load_variables_from: [module()]
}

deregister_result()

@type deregister_result() :: :ok | {:error, any()}

graphql_provider()

@type graphql_provider() :: %{
  name: String.t(),
  type: :graphql,
  url: String.t(),
  auth: auth() | nil,
  headers: %{required(String.t()) => String.t()}
}

grpc_provider()

@type grpc_provider() :: %{
  name: String.t(),
  type: :grpc,
  host: String.t(),
  port: integer(),
  service_name: String.t(),
  method_name: String.t(),
  target: String.t() | nil,
  use_ssl: boolean(),
  auth: auth() | nil
}

http_provider()

@type http_provider() :: %{
  name: String.t(),
  type: :http,
  http_method: String.t(),
  url: String.t(),
  content_type: String.t(),
  auth: auth() | nil,
  headers: %{required(String.t()) => String.t()},
  body_field: String.t() | nil,
  header_fields: [String.t()]
}

manual()

@type manual() :: %{name: String.t(), description: String.t(), tools: [tool()]}

mcp_provider()

@type mcp_provider() :: %{
  name: String.t(),
  type: :mcp,
  url: String.t(),
  auth: auth() | nil
}

oauth2_auth()

@type oauth2_auth() :: %{
  type: String.t(),
  client_id: String.t(),
  client_secret: String.t(),
  token_url: String.t(),
  scope: String.t()
}

provider()

@type provider() :: %{name: String.t(), type: provider_type(), __struct__: module()}

provider_type()

@type provider_type() ::
  :http
  | :sse
  | :http_stream
  | :cli
  | :websocket
  | :grpc
  | :graphql
  | :tcp
  | :udp
  | :webrtc
  | :mcp
  | :text

register_result()

@type register_result() :: {:ok, [tool()]} | {:error, any()}

search_result()

@type search_result() :: {:ok, [tool()]} | {:error, any()}

sse_provider()

@type sse_provider() :: %{
  name: String.t(),
  type: :sse,
  url: String.t(),
  auth: auth() | nil,
  headers: %{required(String.t()) => String.t()}
}

stream_call_result()

@type stream_call_result() :: {:ok, stream_result()} | {:error, any()}

stream_chunk()

@type stream_chunk() :: %{
  data: any(),
  metadata: %{required(String.t()) => any()} | nil,
  timestamp: integer() | nil,
  sequence: integer() | nil
}

stream_end()

@type stream_end() :: %{type: :end, metadata: %{required(String.t()) => any()} | nil}

stream_error()

@type stream_error() :: %{
  type: :error,
  error: String.t(),
  code: integer() | nil,
  metadata: %{required(String.t()) => any()} | nil
}

stream_event()

@type stream_event() :: stream_chunk() | stream_error() | stream_end()

stream_result()

@type stream_result() :: %{
  type: :stream,
  data: [stream_chunk()] | Enumerable.t(),
  metadata: %{required(String.t()) => any()} | nil
}

streamable_http_provider()

@type streamable_http_provider() :: %{
  name: String.t(),
  type: :http_stream,
  url: String.t(),
  auth: auth() | nil,
  headers: %{required(String.t()) => String.t()}
}

tcp_provider()

@type tcp_provider() :: %{
  name: String.t(),
  type: :tcp,
  protocol: :tcp,
  host: String.t(),
  port: integer(),
  timeout: integer(),
  auth: auth() | nil
}

text_provider()

@type text_provider() :: %{name: String.t(), type: :text, file_path: String.t()}

tool()

@type tool() :: %{
  name: String.t(),
  description: String.t(),
  inputs: tool_input_output_schema(),
  outputs: tool_input_output_schema(),
  tags: [String.t()],
  average_response_size: integer() | nil,
  provider: provider()
}

tool_input_output_schema()

@type tool_input_output_schema() :: %{
  type: String.t(),
  properties: %{required(String.t()) => any()},
  required: [String.t()],
  description: String.t(),
  title: String.t(),
  items: %{required(String.t()) => any()},
  enum: [any()],
  minimum: float() | nil,
  maximum: float() | nil,
  format: String.t()
}

tool_repository()

@type tool_repository() :: %{
  tools: %{required(String.t()) => [tool()]},
  providers: %{required(String.t()) => provider()}
}

transport()

@type transport() :: module()

udp_provider()

@type udp_provider() :: %{
  name: String.t(),
  type: :udp,
  protocol: :udp,
  host: String.t(),
  port: integer(),
  timeout: integer(),
  auth: auth() | nil
}

variable_not_found()

@type variable_not_found() :: %{__exception__: true, variable_name: String.t()}

webrtc_provider()

@type webrtc_provider() :: %{
  name: String.t(),
  type: :webrtc,
  url: String.t(),
  auth: auth() | nil
}

websocket_provider()

@type websocket_provider() :: %{
  name: String.t(),
  type: :websocket,
  url: String.t(),
  protocol: String.t() | nil,
  keep_alive: boolean(),
  auth: auth() | nil,
  headers: %{required(String.t()) => String.t()},
  header_fields: [String.t()]
}