Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AgentBatchRunParams
- type AgentBatchRunResponse
- type AgentBatchService
- type AgentCompletionHistoryUnionParam
- type AgentCompletionParam
- type AgentListResponse
- type AgentRunParams
- type AgentRunResponse
- type AgentService
- type AgentSpecMcpConfigsParam
- type AgentSpecParam
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) GetRoot(ctx context.Context, opts ...option.RequestOption) (res *GetRootResponse, err error)
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type ClientAdvancedResearchBatchNewCompletionParams
- type ClientAdvancedResearchBatchNewCompletionParamsInputSchema
- type ClientAdvancedResearchBatchNewCompletionParamsInputSchemaConfig
- type ClientAdvancedResearchBatchNewCompletionResponse
- type ClientAdvancedResearchBatchService
- type ClientAdvancedResearchNewCompletionParams
- type ClientAdvancedResearchNewCompletionParamsConfig
- type ClientAdvancedResearchNewCompletionResponse
- type ClientAdvancedResearchService
- type ClientAutoSwarmBuilderNewCompletionParams
- type ClientAutoSwarmBuilderNewCompletionParamsExecutionType
- type ClientAutoSwarmBuilderNewCompletionResponse
- type ClientAutoSwarmBuilderService
- func (r *ClientAutoSwarmBuilderService) ListExecutionTypes(ctx context.Context, opts ...option.RequestOption) (res *[]string, err error)
- func (r *ClientAutoSwarmBuilderService) NewCompletion(ctx context.Context, body ClientAutoSwarmBuilderNewCompletionParams, ...) (res *ClientAutoSwarmBuilderNewCompletionResponse, err error)
- type ClientBatchedGridWorkflowCompleteWorkflowParams
- type ClientBatchedGridWorkflowCompleteWorkflowResponse
- type ClientBatchedGridWorkflowCompleteWorkflowResponseUsage
- type ClientBatchedGridWorkflowService
- type ClientGraphWorkflowExecuteWorkflowParams
- type ClientGraphWorkflowExecuteWorkflowParamsEdgeEdgeSpec
- type ClientGraphWorkflowExecuteWorkflowParamsEdgeUnion
- type ClientGraphWorkflowExecuteWorkflowResponse
- type ClientGraphWorkflowExecuteWorkflowResponseUsage
- type ClientGraphWorkflowService
- type ClientMarketplaceNewAgentParams
- type ClientMarketplaceNewAgentResponse
- type ClientMarketplaceNewAgentResponsePrompt
- type ClientMarketplaceNewAgentResponsePromptCategoryUnion
- func (u ClientMarketplaceNewAgentResponsePromptCategoryUnion) AsString() (v string)
- func (u ClientMarketplaceNewAgentResponsePromptCategoryUnion) AsStringArray() (v []string)
- func (u ClientMarketplaceNewAgentResponsePromptCategoryUnion) RawJSON() string
- func (r *ClientMarketplaceNewAgentResponsePromptCategoryUnion) UnmarshalJSON(data []byte) error
- type ClientMarketplaceNewAgentResponsePromptLinksUnion
- func (u ClientMarketplaceNewAgentResponsePromptLinksUnion) AsMapOfAnyMap() (v []map[string]any)
- func (u ClientMarketplaceNewAgentResponsePromptLinksUnion) AsStringArray() (v []string)
- func (u ClientMarketplaceNewAgentResponsePromptLinksUnion) RawJSON() string
- func (r *ClientMarketplaceNewAgentResponsePromptLinksUnion) UnmarshalJSON(data []byte) error
- type ClientMarketplaceNewAgentResponsePromptUseCasesUnion
- func (u ClientMarketplaceNewAgentResponsePromptUseCasesUnion) AsAnyMap() (v map[string]any)
- func (u ClientMarketplaceNewAgentResponsePromptUseCasesUnion) AsMapOfAnyMap() (v []map[string]any)
- func (u ClientMarketplaceNewAgentResponsePromptUseCasesUnion) RawJSON() string
- func (r *ClientMarketplaceNewAgentResponsePromptUseCasesUnion) UnmarshalJSON(data []byte) error
- type ClientMarketplaceService
- type ClientRateGetLimitsResponse
- type ClientRateGetLimitsResponseLimits
- type ClientRateGetLimitsResponseRateLimits
- type ClientRateService
- type ClientService
- type ClientToolListAvailableResponse
- type ClientToolService
- type Error
- type GetRootResponse
- type HealthCheckResponse
- type HealthService
- type McpConnectionParam
- type ModelListAvailableResponse
- type ModelService
- type RateLimitWindow
- type ReasoningAgentListTypesResponse
- type ReasoningAgentNewCompletionParams
- type ReasoningAgentNewCompletionParamsOutputType
- type ReasoningAgentNewCompletionParamsSwarmType
- type ReasoningAgentNewCompletionResponse
- type ReasoningAgentService
- func (r *ReasoningAgentService) ListTypes(ctx context.Context, opts ...option.RequestOption) (res *ReasoningAgentListTypesResponse, err error)
- func (r *ReasoningAgentService) NewCompletion(ctx context.Context, body ReasoningAgentNewCompletionParams, ...) (res *ReasoningAgentNewCompletionResponse, err error)
- type SwarmBatchRunParams
- type SwarmBatchRunResponse
- type SwarmBatchService
- type SwarmCheckAvailableResponse
- type SwarmGetLogsResponse
- type SwarmRunParams
- type SwarmRunResponse
- type SwarmService
- func (r *SwarmService) CheckAvailable(ctx context.Context, opts ...option.RequestOption) (res *SwarmCheckAvailableResponse, err error)
- func (r *SwarmService) GetLogs(ctx context.Context, opts ...option.RequestOption) (res *SwarmGetLogsResponse, err error)
- func (r *SwarmService) Run(ctx context.Context, body SwarmRunParams, opts ...option.RequestOption) (res *SwarmRunResponse, err error)
- type SwarmSpecMessagesUnionParam
- type SwarmSpecParam
- type SwarmSpecSwarmType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (SWARMS_API_KEY, SWARMS_CLIENT_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AgentBatchRunParams ¶
type AgentBatchRunParams struct {
Body []AgentCompletionParam
// contains filtered or unexported fields
}
func (AgentBatchRunParams) MarshalJSON ¶
func (r AgentBatchRunParams) MarshalJSON() (data []byte, err error)
func (*AgentBatchRunParams) UnmarshalJSON ¶
func (r *AgentBatchRunParams) UnmarshalJSON(data []byte) error
type AgentBatchRunResponse ¶
type AgentBatchRunResponse struct {
// The unique identifier for the agent batch completion.
BatchID string `json:"batch_id" api:"nullable"`
// The execution time of the agent batch completion.
ExecutionTime float64 `json:"execution_time" api:"nullable"`
// The outputs generated by the agent.
Results any `json:"results"`
// The timestamp when the agent batch completion was created.
Timestamp string `json:"timestamp" api:"nullable"`
// The total number of requests in the batch.
TotalRequests int64 `json:"total_requests" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BatchID respjson.Field
ExecutionTime respjson.Field
Results respjson.Field
Timestamp respjson.Field
TotalRequests respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentBatchRunResponse) RawJSON ¶
func (r AgentBatchRunResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentBatchRunResponse) UnmarshalJSON ¶
func (r *AgentBatchRunResponse) UnmarshalJSON(data []byte) error
type AgentBatchService ¶
type AgentBatchService struct {
Options []option.RequestOption
}
AgentBatchService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAgentBatchService method instead.
func NewAgentBatchService ¶
func NewAgentBatchService(opts ...option.RequestOption) (r AgentBatchService)
NewAgentBatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AgentBatchService) Run ¶
func (r *AgentBatchService) Run(ctx context.Context, body AgentBatchRunParams, opts ...option.RequestOption) (res *AgentBatchRunResponse, err error)
Run a batch of agents with the specified tasks using a thread pool.
type AgentCompletionHistoryUnionParam ¶
type AgentCompletionHistoryUnionParam struct {
OfAnyMap map[string]any `json:",omitzero,inline"`
OfMapOfStringMap []map[string]string `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (AgentCompletionHistoryUnionParam) MarshalJSON ¶
func (u AgentCompletionHistoryUnionParam) MarshalJSON() ([]byte, error)
func (*AgentCompletionHistoryUnionParam) UnmarshalJSON ¶
func (u *AgentCompletionHistoryUnionParam) UnmarshalJSON(data []byte) error
type AgentCompletionParam ¶
type AgentCompletionParam struct {
// An optional image URL that may be associated with the agent's task or
// representation.
Img param.Opt[string] `json:"img,omitzero"`
// The task to be completed by the agent.
Task param.Opt[string] `json:"task,omitzero"`
// The history of the agent's previous tasks and responses. Can be either a
// dictionary or a list of message objects.
History AgentCompletionHistoryUnionParam `json:"history,omitzero"`
// A list of image URLs that may be associated with the agent's task or
// representation.
Imgs []string `json:"imgs,omitzero"`
// A list of tools that the agent should use to complete its task.
ToolsEnabled []string `json:"tools_enabled,omitzero"`
// The configuration of the agent to be completed.
AgentConfig AgentSpecParam `json:"agent_config,omitzero"`
// contains filtered or unexported fields
}
func (AgentCompletionParam) MarshalJSON ¶
func (r AgentCompletionParam) MarshalJSON() (data []byte, err error)
func (*AgentCompletionParam) UnmarshalJSON ¶
func (r *AgentCompletionParam) UnmarshalJSON(data []byte) error
type AgentListResponse ¶
type AgentRunParams ¶
type AgentRunParams struct {
AgentCompletion AgentCompletionParam
// contains filtered or unexported fields
}
func (AgentRunParams) MarshalJSON ¶
func (r AgentRunParams) MarshalJSON() (data []byte, err error)
func (*AgentRunParams) UnmarshalJSON ¶
func (r *AgentRunParams) UnmarshalJSON(data []byte) error
type AgentRunResponse ¶
type AgentRunResponse struct {
// A description of the agent or completion.
Description string `json:"description" api:"nullable"`
// The unique identifier for the agent completion.
JobID string `json:"job_id" api:"nullable"`
// The name of the agent.
Name string `json:"name" api:"nullable"`
// The outputs generated by the agent.
Outputs any `json:"outputs"`
// Indicates whether the agent completion was successful.
Success bool `json:"success" api:"nullable"`
// The temperature setting used for the agent's response generation.
Temperature float64 `json:"temperature" api:"nullable"`
// The timestamp when the agent completion was created.
Timestamp string `json:"timestamp" api:"nullable"`
// Usage statistics or metadata for the agent completion.
Usage map[string]any `json:"usage" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Description respjson.Field
JobID respjson.Field
Name respjson.Field
Outputs respjson.Field
Success respjson.Field
Temperature respjson.Field
Timestamp respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AgentRunResponse) RawJSON ¶
func (r AgentRunResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AgentRunResponse) UnmarshalJSON ¶
func (r *AgentRunResponse) UnmarshalJSON(data []byte) error
type AgentService ¶
type AgentService struct {
Options []option.RequestOption
Batch AgentBatchService
}
AgentService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAgentService method instead.
func NewAgentService ¶
func NewAgentService(opts ...option.RequestOption) (r AgentService)
NewAgentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AgentService) List ¶
func (r *AgentService) List(ctx context.Context, opts ...option.RequestOption) (res *AgentListResponse, err error)
Get all unique agent configurations that the user has created or used, without task details. Allows users to reuse agent configs with new tasks.
func (*AgentService) Run ¶
func (r *AgentService) Run(ctx context.Context, body AgentRunParams, opts ...option.RequestOption) (res *AgentRunResponse, err error)
Run an agent with the specified task. Supports streaming when stream=True.
type AgentSpecMcpConfigsParam ¶
type AgentSpecMcpConfigsParam struct {
// List of MCP connections
Connections []McpConnectionParam `json:"connections,omitzero" api:"required"`
// contains filtered or unexported fields
}
The MCP connections to use for the agent. This is a list of MCP connections. Includes multiple MCP connections.
The property Connections is required.
func (AgentSpecMcpConfigsParam) MarshalJSON ¶
func (r AgentSpecMcpConfigsParam) MarshalJSON() (data []byte, err error)
func (*AgentSpecMcpConfigsParam) UnmarshalJSON ¶
func (r *AgentSpecMcpConfigsParam) UnmarshalJSON(data []byte) error
type AgentSpecParam ¶
type AgentSpecParam struct {
// The unique name assigned to the agent, which identifies its role and
// functionality within the swarm.
AgentName param.Opt[string] `json:"agent_name,omitzero" api:"required"`
// A flag indicating whether the agent should automatically create prompts based on
// the task requirements.
AutoGeneratePrompt param.Opt[bool] `json:"auto_generate_prompt,omitzero"`
// A detailed explanation of the agent's purpose, capabilities, and any specific
// tasks it is designed to perform.
Description param.Opt[string] `json:"description,omitzero"`
// A flag indicating whether the agent should dynamically adjust its temperature
// based on the task.
DynamicTemperatureEnabled param.Opt[bool] `json:"dynamic_temperature_enabled,omitzero"`
// The maximum number of times the agent is allowed to repeat its task, enabling
// iterative processing if necessary.
MaxLoops param.Opt[int64] `json:"max_loops,omitzero"`
// The maximum number of tokens that the agent is allowed to generate in its
// responses, limiting output length.
MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
// The URL of the MCP server that the agent can use to complete its task.
McpURL param.Opt[string] `json:"mcp_url,omitzero"`
// The name of the AI model that the agent will utilize for processing tasks and
// generating outputs. For example: gpt-4o, gpt-4o-mini, openai/o3-mini
ModelName param.Opt[string] `json:"model_name,omitzero"`
// The effort to put into reasoning.
ReasoningEffort param.Opt[string] `json:"reasoning_effort,omitzero"`
// A parameter enabling an agent to use reasoning.
ReasoningEnabled param.Opt[bool] `json:"reasoning_enabled,omitzero"`
// The designated role of the agent within the swarm, which influences its behavior
// and interaction with other agents.
Role param.Opt[string] `json:"role,omitzero"`
// A flag indicating whether the agent should stream its output.
StreamingOn param.Opt[bool] `json:"streaming_on,omitzero"`
// The initial instruction or context provided to the agent, guiding its behavior
// and responses during execution.
SystemPrompt param.Opt[string] `json:"system_prompt,omitzero"`
// A parameter that controls the randomness of the agent's output; lower values
// result in more deterministic responses.
Temperature param.Opt[float64] `json:"temperature,omitzero"`
// The number of tokens to use for thinking.
ThinkingTokens param.Opt[int64] `json:"thinking_tokens,omitzero"`
// A parameter enabling an agent to summarize tool calls.
ToolCallSummary param.Opt[bool] `json:"tool_call_summary,omitzero"`
// Additional arguments to pass to the LLM such as top_p, frequency_penalty,
// presence_penalty, etc.
LlmArgs map[string]any `json:"llm_args,omitzero"`
// The MCP connections to use for the agent. This is a list of MCP connections.
// Includes multiple MCP connections.
McpConfigs AgentSpecMcpConfigsParam `json:"mcp_configs,omitzero"`
// A dictionary of tools that the agent can use to complete its task.
ToolsListDictionary []map[string]any `json:"tools_list_dictionary,omitzero"`
// The MCP connection to use for the agent.
McpConfig McpConnectionParam `json:"mcp_config,omitzero"`
// contains filtered or unexported fields
}
The property AgentName is required.
func (AgentSpecParam) MarshalJSON ¶
func (r AgentSpecParam) MarshalJSON() (data []byte, err error)
func (*AgentSpecParam) UnmarshalJSON ¶
func (r *AgentSpecParam) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
Health HealthService
Agent AgentService
Models ModelService
Swarms SwarmService
ReasoningAgents ReasoningAgentService
Client ClientService
}
Client creates a struct with services and top level methods that help with interacting with the swarms-client API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (SWARMS_API_KEY, SWARMS_CLIENT_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned [url.Values] will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) GetRoot ¶
func (r *Client) GetRoot(ctx context.Context, opts ...option.RequestOption) (res *GetRootResponse, err error)
Root
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ClientAdvancedResearchBatchNewCompletionParams ¶
type ClientAdvancedResearchBatchNewCompletionParams struct {
// The input schemas for the advanced research
InputSchemas []ClientAdvancedResearchBatchNewCompletionParamsInputSchema `json:"input_schemas,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (ClientAdvancedResearchBatchNewCompletionParams) MarshalJSON ¶
func (r ClientAdvancedResearchBatchNewCompletionParams) MarshalJSON() (data []byte, err error)
func (*ClientAdvancedResearchBatchNewCompletionParams) UnmarshalJSON ¶
func (r *ClientAdvancedResearchBatchNewCompletionParams) UnmarshalJSON(data []byte) error
type ClientAdvancedResearchBatchNewCompletionParamsInputSchema ¶
type ClientAdvancedResearchBatchNewCompletionParamsInputSchema struct {
// The task to be completed
Task param.Opt[string] `json:"task,omitzero" api:"required"`
// The configuration for the advanced research
Config ClientAdvancedResearchBatchNewCompletionParamsInputSchemaConfig `json:"config,omitzero" api:"required"`
// The image to be used for the advanced research
Img param.Opt[string] `json:"img,omitzero"`
// contains filtered or unexported fields
}
The properties Config, Task are required.
func (ClientAdvancedResearchBatchNewCompletionParamsInputSchema) MarshalJSON ¶
func (r ClientAdvancedResearchBatchNewCompletionParamsInputSchema) MarshalJSON() (data []byte, err error)
func (*ClientAdvancedResearchBatchNewCompletionParamsInputSchema) UnmarshalJSON ¶
func (r *ClientAdvancedResearchBatchNewCompletionParamsInputSchema) UnmarshalJSON(data []byte) error
type ClientAdvancedResearchBatchNewCompletionParamsInputSchemaConfig ¶
type ClientAdvancedResearchBatchNewCompletionParamsInputSchemaConfig struct {
// Description of the advanced research session
Description param.Opt[string] `json:"description,omitzero"`
// Name of the director agent
DirectorAgentName param.Opt[string] `json:"director_agent_name,omitzero"`
// Maximum loops for the director agent
DirectorMaxLoops param.Opt[int64] `json:"director_max_loops,omitzero"`
// Maximum tokens for the director agent's output
DirectorMaxTokens param.Opt[int64] `json:"director_max_tokens,omitzero"`
// Model name for the director agent
DirectorModelName param.Opt[string] `json:"director_model_name,omitzero"`
// Maximum characters to return from the Exa search tool
ExaSearchMaxCharacters param.Opt[int64] `json:"exa_search_max_characters,omitzero"`
// Number of results to return from the Exa search tool
ExaSearchNumResults param.Opt[int64] `json:"exa_search_num_results,omitzero"`
// Number of research loops to run
MaxLoops param.Opt[int64] `json:"max_loops,omitzero"`
// Name of the advanced research session
Name param.Opt[string] `json:"name,omitzero"`
// Model name for worker agents
WorkerModelName param.Opt[string] `json:"worker_model_name,omitzero"`
// contains filtered or unexported fields
}
The configuration for the advanced research
func (ClientAdvancedResearchBatchNewCompletionParamsInputSchemaConfig) MarshalJSON ¶
func (r ClientAdvancedResearchBatchNewCompletionParamsInputSchemaConfig) MarshalJSON() (data []byte, err error)
func (*ClientAdvancedResearchBatchNewCompletionParamsInputSchemaConfig) UnmarshalJSON ¶
func (r *ClientAdvancedResearchBatchNewCompletionParamsInputSchemaConfig) UnmarshalJSON(data []byte) error
type ClientAdvancedResearchBatchNewCompletionResponse ¶
type ClientAdvancedResearchBatchNewCompletionResponse struct {
// The id of the advanced research session
ID string `json:"id" api:"required"`
// The number of characters per source used for the advanced research session
CharactersPerSource int64 `json:"characters_per_source" api:"required"`
// The description of the advanced research session
Description string `json:"description" api:"required"`
// The name of the advanced research session
Name string `json:"name" api:"required"`
// The outputs of the advanced research session
Outputs any `json:"outputs" api:"required"`
// The number of sources used for the advanced research session
Sources int64 `json:"sources" api:"required"`
// The timestamp of the advanced research session
Timestamp string `json:"timestamp" api:"required"`
// The usage of the advanced research session
Usage map[string]any `json:"usage" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CharactersPerSource respjson.Field
Description respjson.Field
Name respjson.Field
Outputs respjson.Field
Sources respjson.Field
Timestamp respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ClientAdvancedResearchBatchNewCompletionResponse) RawJSON ¶
func (r ClientAdvancedResearchBatchNewCompletionResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientAdvancedResearchBatchNewCompletionResponse) UnmarshalJSON ¶
func (r *ClientAdvancedResearchBatchNewCompletionResponse) UnmarshalJSON(data []byte) error
type ClientAdvancedResearchBatchService ¶
type ClientAdvancedResearchBatchService struct {
Options []option.RequestOption
}
ClientAdvancedResearchBatchService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientAdvancedResearchBatchService method instead.
func NewClientAdvancedResearchBatchService ¶
func NewClientAdvancedResearchBatchService(opts ...option.RequestOption) (r ClientAdvancedResearchBatchService)
NewClientAdvancedResearchBatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClientAdvancedResearchBatchService) NewCompletion ¶
func (r *ClientAdvancedResearchBatchService) NewCompletion(ctx context.Context, body ClientAdvancedResearchBatchNewCompletionParams, opts ...option.RequestOption) (res *[]ClientAdvancedResearchBatchNewCompletionResponse, err error)
Execute multiple advanced research sessions concurrently with independent configurations for high-throughput research workflows.
type ClientAdvancedResearchNewCompletionParams ¶
type ClientAdvancedResearchNewCompletionParams struct {
// The task to be completed
Task param.Opt[string] `json:"task,omitzero" api:"required"`
// The configuration for the advanced research
Config ClientAdvancedResearchNewCompletionParamsConfig `json:"config,omitzero" api:"required"`
// The image to be used for the advanced research
Img param.Opt[string] `json:"img,omitzero"`
// contains filtered or unexported fields
}
func (ClientAdvancedResearchNewCompletionParams) MarshalJSON ¶
func (r ClientAdvancedResearchNewCompletionParams) MarshalJSON() (data []byte, err error)
func (*ClientAdvancedResearchNewCompletionParams) UnmarshalJSON ¶
func (r *ClientAdvancedResearchNewCompletionParams) UnmarshalJSON(data []byte) error
type ClientAdvancedResearchNewCompletionParamsConfig ¶
type ClientAdvancedResearchNewCompletionParamsConfig struct {
// Description of the advanced research session
Description param.Opt[string] `json:"description,omitzero"`
// Name of the director agent
DirectorAgentName param.Opt[string] `json:"director_agent_name,omitzero"`
// Maximum loops for the director agent
DirectorMaxLoops param.Opt[int64] `json:"director_max_loops,omitzero"`
// Maximum tokens for the director agent's output
DirectorMaxTokens param.Opt[int64] `json:"director_max_tokens,omitzero"`
// Model name for the director agent
DirectorModelName param.Opt[string] `json:"director_model_name,omitzero"`
// Maximum characters to return from the Exa search tool
ExaSearchMaxCharacters param.Opt[int64] `json:"exa_search_max_characters,omitzero"`
// Number of results to return from the Exa search tool
ExaSearchNumResults param.Opt[int64] `json:"exa_search_num_results,omitzero"`
// Number of research loops to run
MaxLoops param.Opt[int64] `json:"max_loops,omitzero"`
// Name of the advanced research session
Name param.Opt[string] `json:"name,omitzero"`
// Model name for worker agents
WorkerModelName param.Opt[string] `json:"worker_model_name,omitzero"`
// contains filtered or unexported fields
}
The configuration for the advanced research
func (ClientAdvancedResearchNewCompletionParamsConfig) MarshalJSON ¶
func (r ClientAdvancedResearchNewCompletionParamsConfig) MarshalJSON() (data []byte, err error)
func (*ClientAdvancedResearchNewCompletionParamsConfig) UnmarshalJSON ¶
func (r *ClientAdvancedResearchNewCompletionParamsConfig) UnmarshalJSON(data []byte) error
type ClientAdvancedResearchNewCompletionResponse ¶
type ClientAdvancedResearchNewCompletionResponse struct {
// The id of the advanced research session
ID string `json:"id" api:"required"`
// The number of characters per source used for the advanced research session
CharactersPerSource int64 `json:"characters_per_source" api:"required"`
// The description of the advanced research session
Description string `json:"description" api:"required"`
// The name of the advanced research session
Name string `json:"name" api:"required"`
// The outputs of the advanced research session
Outputs any `json:"outputs" api:"required"`
// The number of sources used for the advanced research session
Sources int64 `json:"sources" api:"required"`
// The timestamp of the advanced research session
Timestamp string `json:"timestamp" api:"required"`
// The usage of the advanced research session
Usage map[string]any `json:"usage" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CharactersPerSource respjson.Field
Description respjson.Field
Name respjson.Field
Outputs respjson.Field
Sources respjson.Field
Timestamp respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ClientAdvancedResearchNewCompletionResponse) RawJSON ¶
func (r ClientAdvancedResearchNewCompletionResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientAdvancedResearchNewCompletionResponse) UnmarshalJSON ¶
func (r *ClientAdvancedResearchNewCompletionResponse) UnmarshalJSON(data []byte) error
type ClientAdvancedResearchService ¶
type ClientAdvancedResearchService struct {
Options []option.RequestOption
Batch ClientAdvancedResearchBatchService
}
ClientAdvancedResearchService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientAdvancedResearchService method instead.
func NewClientAdvancedResearchService ¶
func NewClientAdvancedResearchService(opts ...option.RequestOption) (r ClientAdvancedResearchService)
NewClientAdvancedResearchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClientAdvancedResearchService) NewCompletion ¶
func (r *ClientAdvancedResearchService) NewCompletion(ctx context.Context, body ClientAdvancedResearchNewCompletionParams, opts ...option.RequestOption) (res *ClientAdvancedResearchNewCompletionResponse, err error)
Execute comprehensive research sessions with multi-source data collection, analysis, and synthesis capabilities.
type ClientAutoSwarmBuilderNewCompletionParams ¶
type ClientAutoSwarmBuilderNewCompletionParams struct {
// A description of the swarm.
Description param.Opt[string] `json:"description,omitzero"`
// Maximum number of loops to run.
MaxLoops param.Opt[int64] `json:"max_loops,omitzero"`
// The maximum number of tokens to use for the swarm.
MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
// The model name to use for the swarm.
ModelName param.Opt[string] `json:"model_name,omitzero"`
// The name of the swarm.
Name param.Opt[string] `json:"name,omitzero"`
// The task for the swarm, if any.
Task param.Opt[string] `json:"task,omitzero"`
// The type of execution to perform.
//
// Any of "return-agents", "return-swarm-router-config", "return-agents-objects".
ExecutionType ClientAutoSwarmBuilderNewCompletionParamsExecutionType `json:"execution_type,omitzero"`
// contains filtered or unexported fields
}
func (ClientAutoSwarmBuilderNewCompletionParams) MarshalJSON ¶
func (r ClientAutoSwarmBuilderNewCompletionParams) MarshalJSON() (data []byte, err error)
func (*ClientAutoSwarmBuilderNewCompletionParams) UnmarshalJSON ¶
func (r *ClientAutoSwarmBuilderNewCompletionParams) UnmarshalJSON(data []byte) error
type ClientAutoSwarmBuilderNewCompletionParamsExecutionType ¶
type ClientAutoSwarmBuilderNewCompletionParamsExecutionType string
The type of execution to perform.
const ( ClientAutoSwarmBuilderNewCompletionParamsExecutionTypeReturnAgents ClientAutoSwarmBuilderNewCompletionParamsExecutionType = "return-agents" ClientAutoSwarmBuilderNewCompletionParamsExecutionTypeReturnSwarmRouterConfig ClientAutoSwarmBuilderNewCompletionParamsExecutionType = "return-swarm-router-config" ClientAutoSwarmBuilderNewCompletionParamsExecutionTypeReturnAgentsObjects ClientAutoSwarmBuilderNewCompletionParamsExecutionType = "return-agents-objects" )
type ClientAutoSwarmBuilderNewCompletionResponse ¶
type ClientAutoSwarmBuilderNewCompletionResponse struct {
// Whether the swarm was built successfully.
Success bool `json:"success" api:"required"`
// The job ID of the swarm.
JobID string `json:"job_id" api:"nullable"`
// The outputs of the auto swarms builder.
Outputs map[string]any `json:"outputs" api:"nullable"`
// The timestamp of the swarm execution.
Timestamp string `json:"timestamp" api:"nullable"`
// The type of the swarm execution.
Type string `json:"type" api:"nullable"`
// The usage of the swarm execution.
Usage map[string]any `json:"usage" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
JobID respjson.Field
Outputs respjson.Field
Timestamp respjson.Field
Type respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Schema for the Auto Swarm Builder API response.
Attributes: success (bool): Whether the swarm was built successfully. job_id (Optional[str]): The job ID of the swarm. outputs (Optional[dict]): The outputs of the auto swarms builder. type (Optional[str]): The type of the swarm execution. timestamp (Optional[str]): The timestamp of the swarm execution. usage (Optional[dict]): The usage statistics of the swarm execution.
func (ClientAutoSwarmBuilderNewCompletionResponse) RawJSON ¶
func (r ClientAutoSwarmBuilderNewCompletionResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientAutoSwarmBuilderNewCompletionResponse) UnmarshalJSON ¶
func (r *ClientAutoSwarmBuilderNewCompletionResponse) UnmarshalJSON(data []byte) error
type ClientAutoSwarmBuilderService ¶
type ClientAutoSwarmBuilderService struct {
Options []option.RequestOption
}
ClientAutoSwarmBuilderService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientAutoSwarmBuilderService method instead.
func NewClientAutoSwarmBuilderService ¶
func NewClientAutoSwarmBuilderService(opts ...option.RequestOption) (r ClientAutoSwarmBuilderService)
NewClientAutoSwarmBuilderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClientAutoSwarmBuilderService) ListExecutionTypes ¶
func (r *ClientAutoSwarmBuilderService) ListExecutionTypes(ctx context.Context, opts ...option.RequestOption) (res *[]string, err error)
Retrieve all available execution types and return formats for the Auto Swarm Builder endpoint.
func (*ClientAutoSwarmBuilderService) NewCompletion ¶
func (r *ClientAutoSwarmBuilderService) NewCompletion(ctx context.Context, body ClientAutoSwarmBuilderNewCompletionParams, opts ...option.RequestOption) (res *ClientAutoSwarmBuilderNewCompletionResponse, err error)
Generate and orchestrate agent swarms autonomously using AI-powered swarm composition and task decomposition.
type ClientBatchedGridWorkflowCompleteWorkflowParams ¶
type ClientBatchedGridWorkflowCompleteWorkflowParams struct {
// The description of the batched grid workflow.
Description param.Opt[string] `json:"description,omitzero"`
// The maximum number of loops to be completed by the batched grid workflow.
MaxLoops param.Opt[int64] `json:"max_loops,omitzero"`
// The name of the batched grid workflow.
Name param.Opt[string] `json:"name,omitzero"`
// The agent completions to be completed by the batched grid workflow.
AgentCompletions []AgentSpecParam `json:"agent_completions,omitzero"`
// The images to be used by the batched grid workflow.
Imgs []string `json:"imgs,omitzero"`
// The tasks to be completed by the batched grid workflow.
Tasks []string `json:"tasks,omitzero"`
// contains filtered or unexported fields
}
func (ClientBatchedGridWorkflowCompleteWorkflowParams) MarshalJSON ¶
func (r ClientBatchedGridWorkflowCompleteWorkflowParams) MarshalJSON() (data []byte, err error)
func (*ClientBatchedGridWorkflowCompleteWorkflowParams) UnmarshalJSON ¶
func (r *ClientBatchedGridWorkflowCompleteWorkflowParams) UnmarshalJSON(data []byte) error
type ClientBatchedGridWorkflowCompleteWorkflowResponse ¶
type ClientBatchedGridWorkflowCompleteWorkflowResponse struct {
// The description of the batched grid workflow.
Description string `json:"description" api:"required"`
// The job ID of the batched grid workflow.
JobID string `json:"job_id" api:"required"`
// The name of the batched grid workflow.
Name string `json:"name" api:"required"`
// The outputs of the batched grid workflow.
Outputs any `json:"outputs" api:"required"`
// The status of the batched grid workflow.
Status string `json:"status" api:"required"`
// The timestamp of the batched grid workflow.
Timestamp string `json:"timestamp" api:"required"`
// The usage of the batched grid workflow.
Usage ClientBatchedGridWorkflowCompleteWorkflowResponseUsage `json:"usage" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Description respjson.Field
JobID respjson.Field
Name respjson.Field
Outputs respjson.Field
Status respjson.Field
Timestamp respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ClientBatchedGridWorkflowCompleteWorkflowResponse) RawJSON ¶
func (r ClientBatchedGridWorkflowCompleteWorkflowResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientBatchedGridWorkflowCompleteWorkflowResponse) UnmarshalJSON ¶
func (r *ClientBatchedGridWorkflowCompleteWorkflowResponse) UnmarshalJSON(data []byte) error
type ClientBatchedGridWorkflowCompleteWorkflowResponseUsage ¶
type ClientBatchedGridWorkflowCompleteWorkflowResponseUsage struct {
// The cost in credits for the agents.
CostPerAgent float64 `json:"cost_per_agent" api:"required"`
// The number of input tokens.
InputTokens int64 `json:"input_tokens" api:"required"`
// The number of output tokens.
OutputTokens int64 `json:"output_tokens" api:"required"`
// The cost in credits for the tokens.
TokenCost float64 `json:"token_cost" api:"required"`
// The total number of tokens.
TotalTokens int64 `json:"total_tokens" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CostPerAgent respjson.Field
InputTokens respjson.Field
OutputTokens respjson.Field
TokenCost respjson.Field
TotalTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The usage of the batched grid workflow.
func (ClientBatchedGridWorkflowCompleteWorkflowResponseUsage) RawJSON ¶
func (r ClientBatchedGridWorkflowCompleteWorkflowResponseUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientBatchedGridWorkflowCompleteWorkflowResponseUsage) UnmarshalJSON ¶
func (r *ClientBatchedGridWorkflowCompleteWorkflowResponseUsage) UnmarshalJSON(data []byte) error
type ClientBatchedGridWorkflowService ¶
type ClientBatchedGridWorkflowService struct {
Options []option.RequestOption
}
ClientBatchedGridWorkflowService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientBatchedGridWorkflowService method instead.
func NewClientBatchedGridWorkflowService ¶
func NewClientBatchedGridWorkflowService(opts ...option.RequestOption) (r ClientBatchedGridWorkflowService)
NewClientBatchedGridWorkflowService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClientBatchedGridWorkflowService) CompleteWorkflow ¶
func (r *ClientBatchedGridWorkflowService) CompleteWorkflow(ctx context.Context, body ClientBatchedGridWorkflowCompleteWorkflowParams, opts ...option.RequestOption) (res *ClientBatchedGridWorkflowCompleteWorkflowResponse, err error)
Complete a batched grid workflow with the specified input data. Enables you to run a grid workflow with multiple agents and tasks in a single request.
type ClientGraphWorkflowExecuteWorkflowParams ¶
type ClientGraphWorkflowExecuteWorkflowParams struct {
// Whether to automatically compile the workflow for optimization.
AutoCompile param.Opt[bool] `json:"auto_compile,omitzero"`
// The description of the graph workflow.
Description param.Opt[string] `json:"description,omitzero"`
// Optional image path for vision-enabled agents.
Img param.Opt[string] `json:"img,omitzero"`
// The maximum number of execution loops for the workflow.
MaxLoops param.Opt[int64] `json:"max_loops,omitzero"`
// The name of the graph workflow.
Name param.Opt[string] `json:"name,omitzero"`
// The task to be executed by the workflow.
Task param.Opt[string] `json:"task,omitzero"`
// Whether to enable detailed logging.
Verbose param.Opt[bool] `json:"verbose,omitzero"`
// List of agent specifications to be used as nodes in the workflow graph.
Agents []AgentSpecParam `json:"agents,omitzero"`
// List of edges connecting nodes. Can be EdgeSpec objects or dictionaries with
// 'source' and 'target' keys.
Edges []ClientGraphWorkflowExecuteWorkflowParamsEdgeUnion `json:"edges,omitzero"`
// List of node IDs that serve as ending points for the workflow.
EndPoints []string `json:"end_points,omitzero"`
// List of node IDs that serve as starting points for the workflow.
EntryPoints []string `json:"entry_points,omitzero"`
// contains filtered or unexported fields
}
func (ClientGraphWorkflowExecuteWorkflowParams) MarshalJSON ¶
func (r ClientGraphWorkflowExecuteWorkflowParams) MarshalJSON() (data []byte, err error)
func (*ClientGraphWorkflowExecuteWorkflowParams) UnmarshalJSON ¶
func (r *ClientGraphWorkflowExecuteWorkflowParams) UnmarshalJSON(data []byte) error
type ClientGraphWorkflowExecuteWorkflowParamsEdgeEdgeSpec ¶
type ClientGraphWorkflowExecuteWorkflowParamsEdgeEdgeSpec struct {
// The source node ID.
Source string `json:"source" api:"required"`
// The target node ID.
Target string `json:"target" api:"required"`
// Optional metadata for the edge.
Metadata map[string]any `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
Schema for defining an edge between nodes in the workflow graph.
The properties Source, Target are required.
func (ClientGraphWorkflowExecuteWorkflowParamsEdgeEdgeSpec) MarshalJSON ¶
func (r ClientGraphWorkflowExecuteWorkflowParamsEdgeEdgeSpec) MarshalJSON() (data []byte, err error)
func (*ClientGraphWorkflowExecuteWorkflowParamsEdgeEdgeSpec) UnmarshalJSON ¶
func (r *ClientGraphWorkflowExecuteWorkflowParamsEdgeEdgeSpec) UnmarshalJSON(data []byte) error
type ClientGraphWorkflowExecuteWorkflowParamsEdgeUnion ¶
type ClientGraphWorkflowExecuteWorkflowParamsEdgeUnion struct {
OfEdgeSpec *ClientGraphWorkflowExecuteWorkflowParamsEdgeEdgeSpec `json:",omitzero,inline"`
OfAnyMap map[string]any `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (ClientGraphWorkflowExecuteWorkflowParamsEdgeUnion) MarshalJSON ¶
func (u ClientGraphWorkflowExecuteWorkflowParamsEdgeUnion) MarshalJSON() ([]byte, error)
func (*ClientGraphWorkflowExecuteWorkflowParamsEdgeUnion) UnmarshalJSON ¶
func (u *ClientGraphWorkflowExecuteWorkflowParamsEdgeUnion) UnmarshalJSON(data []byte) error
type ClientGraphWorkflowExecuteWorkflowResponse ¶
type ClientGraphWorkflowExecuteWorkflowResponse struct {
// The job ID of the graph workflow.
JobID string `json:"job_id" api:"required"`
// The outputs of the graph workflow.
Outputs any `json:"outputs" api:"required"`
// The status of the graph workflow.
Status string `json:"status" api:"required"`
// The timestamp of the graph workflow execution.
Timestamp string `json:"timestamp" api:"required"`
// The usage statistics of the workflow.
Usage ClientGraphWorkflowExecuteWorkflowResponseUsage `json:"usage" api:"required"`
// The description of the graph workflow.
Description string `json:"description" api:"nullable"`
// The name of the graph workflow.
Name string `json:"name" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
JobID respjson.Field
Outputs respjson.Field
Status respjson.Field
Timestamp respjson.Field
Usage respjson.Field
Description respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Output schema for GraphWorkflow completion responses.
func (ClientGraphWorkflowExecuteWorkflowResponse) RawJSON ¶
func (r ClientGraphWorkflowExecuteWorkflowResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientGraphWorkflowExecuteWorkflowResponse) UnmarshalJSON ¶
func (r *ClientGraphWorkflowExecuteWorkflowResponse) UnmarshalJSON(data []byte) error
type ClientGraphWorkflowExecuteWorkflowResponseUsage ¶
type ClientGraphWorkflowExecuteWorkflowResponseUsage struct {
// The cost in credits for the agents.
CostPerAgent float64 `json:"cost_per_agent" api:"required"`
// The number of input tokens.
InputTokens int64 `json:"input_tokens" api:"required"`
// The number of output tokens.
OutputTokens int64 `json:"output_tokens" api:"required"`
// The cost in credits for the tokens.
TokenCost float64 `json:"token_cost" api:"required"`
// The total number of tokens.
TotalTokens int64 `json:"total_tokens" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CostPerAgent respjson.Field
InputTokens respjson.Field
OutputTokens respjson.Field
TokenCost respjson.Field
TotalTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The usage statistics of the workflow.
func (ClientGraphWorkflowExecuteWorkflowResponseUsage) RawJSON ¶
func (r ClientGraphWorkflowExecuteWorkflowResponseUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientGraphWorkflowExecuteWorkflowResponseUsage) UnmarshalJSON ¶
func (r *ClientGraphWorkflowExecuteWorkflowResponseUsage) UnmarshalJSON(data []byte) error
type ClientGraphWorkflowService ¶
type ClientGraphWorkflowService struct {
Options []option.RequestOption
}
ClientGraphWorkflowService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientGraphWorkflowService method instead.
func NewClientGraphWorkflowService ¶
func NewClientGraphWorkflowService(opts ...option.RequestOption) (r ClientGraphWorkflowService)
NewClientGraphWorkflowService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClientGraphWorkflowService) ExecuteWorkflow ¶
func (r *ClientGraphWorkflowService) ExecuteWorkflow(ctx context.Context, body ClientGraphWorkflowExecuteWorkflowParams, opts ...option.RequestOption) (res *ClientGraphWorkflowExecuteWorkflowResponse, err error)
Execute a graph workflow with directed agent nodes and edges. Enables complex multi-agent collaboration with parallel execution, automatic compilation, and comprehensive workflow orchestration.
type ClientMarketplaceNewAgentParams ¶
type ClientMarketplaceNewAgentParams struct {
// Number of items to return
NumberOfItems param.Opt[int64] `json:"number_of_items,omitzero"`
// contains filtered or unexported fields
}
func (ClientMarketplaceNewAgentParams) MarshalJSON ¶
func (r ClientMarketplaceNewAgentParams) MarshalJSON() (data []byte, err error)
func (*ClientMarketplaceNewAgentParams) UnmarshalJSON ¶
func (r *ClientMarketplaceNewAgentParams) UnmarshalJSON(data []byte) error
type ClientMarketplaceNewAgentResponse ¶
type ClientMarketplaceNewAgentResponse struct {
// List of marketplace prompts
Prompts []ClientMarketplaceNewAgentResponsePrompt `json:"prompts" api:"required"`
// Total number of prompts available
TotalCount int64 `json:"total_count" api:"required"`
// The status of the marketplace prompts response.
Status string `json:"status" api:"nullable"`
// The timestamp of the marketplace prompts response.
Timestamp string `json:"timestamp" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Prompts respjson.Field
TotalCount respjson.Field
Status respjson.Field
Timestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response schema for marketplace prompts endpoint.
func (ClientMarketplaceNewAgentResponse) RawJSON ¶
func (r ClientMarketplaceNewAgentResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientMarketplaceNewAgentResponse) UnmarshalJSON ¶
func (r *ClientMarketplaceNewAgentResponse) UnmarshalJSON(data []byte) error
type ClientMarketplaceNewAgentResponsePrompt ¶
type ClientMarketplaceNewAgentResponsePrompt struct {
// Unique identifier for the prompt
ID string `json:"id" api:"required"`
// Timestamp when the prompt was created
CreatedAt string `json:"created_at" api:"required"`
// ID of the user who created the prompt
UserID string `json:"user_id" api:"required"`
// Category name(s) - can be string or list
Category ClientMarketplaceNewAgentResponsePromptCategoryUnion `json:"category" api:"nullable"`
// Description of the prompt
Description string `json:"description" api:"nullable"`
// Associated links - can be list of dicts or strings
Links ClientMarketplaceNewAgentResponsePromptLinksUnion `json:"links" api:"nullable"`
// Name of the prompt
Name string `json:"name" api:"nullable"`
// The actual prompt text
Prompt string `json:"prompt" api:"nullable"`
// Status of the prompt
Status string `json:"status" api:"nullable"`
// Tags associated with the prompt
Tags string `json:"tags" api:"nullable"`
// Use cases - can be dict or list of dicts
UseCases ClientMarketplaceNewAgentResponsePromptUseCasesUnion `json:"use_cases" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
UserID respjson.Field
Category respjson.Field
Description respjson.Field
Links respjson.Field
Name respjson.Field
Prompt respjson.Field
Status respjson.Field
Tags respjson.Field
UseCases respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Schema for marketplace prompts from the swarms_cloud_prompts table.
func (ClientMarketplaceNewAgentResponsePrompt) RawJSON ¶
func (r ClientMarketplaceNewAgentResponsePrompt) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientMarketplaceNewAgentResponsePrompt) UnmarshalJSON ¶
func (r *ClientMarketplaceNewAgentResponsePrompt) UnmarshalJSON(data []byte) error
type ClientMarketplaceNewAgentResponsePromptCategoryUnion ¶
type ClientMarketplaceNewAgentResponsePromptCategoryUnion struct {
// This field will be present if the value is a [string] instead of an object.
OfString string `json:",inline"`
// This field will be present if the value is a [[]string] instead of an object.
OfStringArray []string `json:",inline"`
JSON struct {
OfString respjson.Field
OfStringArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ClientMarketplaceNewAgentResponsePromptCategoryUnion contains all possible properties and values from [string], [[]string].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfString OfStringArray]
func (ClientMarketplaceNewAgentResponsePromptCategoryUnion) AsString ¶
func (u ClientMarketplaceNewAgentResponsePromptCategoryUnion) AsString() (v string)
func (ClientMarketplaceNewAgentResponsePromptCategoryUnion) AsStringArray ¶
func (u ClientMarketplaceNewAgentResponsePromptCategoryUnion) AsStringArray() (v []string)
func (ClientMarketplaceNewAgentResponsePromptCategoryUnion) RawJSON ¶
func (u ClientMarketplaceNewAgentResponsePromptCategoryUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientMarketplaceNewAgentResponsePromptCategoryUnion) UnmarshalJSON ¶
func (r *ClientMarketplaceNewAgentResponsePromptCategoryUnion) UnmarshalJSON(data []byte) error
type ClientMarketplaceNewAgentResponsePromptLinksUnion ¶
type ClientMarketplaceNewAgentResponsePromptLinksUnion struct {
// This field will be present if the value is a [[]map[string]any] instead of an
// object.
OfMapOfAnyMap []map[string]any `json:",inline"`
// This field will be present if the value is a [[]string] instead of an object.
OfStringArray []string `json:",inline"`
JSON struct {
OfMapOfAnyMap respjson.Field
OfStringArray respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ClientMarketplaceNewAgentResponsePromptLinksUnion contains all possible properties and values from [[]map[string]any], [[]string].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfMapOfAnyMap OfStringArray]
func (ClientMarketplaceNewAgentResponsePromptLinksUnion) AsMapOfAnyMap ¶
func (u ClientMarketplaceNewAgentResponsePromptLinksUnion) AsMapOfAnyMap() (v []map[string]any)
func (ClientMarketplaceNewAgentResponsePromptLinksUnion) AsStringArray ¶
func (u ClientMarketplaceNewAgentResponsePromptLinksUnion) AsStringArray() (v []string)
func (ClientMarketplaceNewAgentResponsePromptLinksUnion) RawJSON ¶
func (u ClientMarketplaceNewAgentResponsePromptLinksUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientMarketplaceNewAgentResponsePromptLinksUnion) UnmarshalJSON ¶
func (r *ClientMarketplaceNewAgentResponsePromptLinksUnion) UnmarshalJSON(data []byte) error
type ClientMarketplaceNewAgentResponsePromptUseCasesUnion ¶
type ClientMarketplaceNewAgentResponsePromptUseCasesUnion struct {
// This field will be present if the value is a [any] instead of an object.
OfClientMarketplaceNewAgentResponsePromptUseCasesMapItem any `json:",inline"`
// This field will be present if the value is a [[]map[string]any] instead of an
// object.
OfMapOfAnyMap []map[string]any `json:",inline"`
JSON struct {
OfClientMarketplaceNewAgentResponsePromptUseCasesMapItem respjson.Field
OfMapOfAnyMap respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ClientMarketplaceNewAgentResponsePromptUseCasesUnion contains all possible properties and values from [map[string]any], [[]map[string]any].
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfClientMarketplaceNewAgentResponsePromptUseCasesMapItem OfMapOfAnyMap]
func (ClientMarketplaceNewAgentResponsePromptUseCasesUnion) AsAnyMap ¶
func (u ClientMarketplaceNewAgentResponsePromptUseCasesUnion) AsAnyMap() (v map[string]any)
func (ClientMarketplaceNewAgentResponsePromptUseCasesUnion) AsMapOfAnyMap ¶
func (u ClientMarketplaceNewAgentResponsePromptUseCasesUnion) AsMapOfAnyMap() (v []map[string]any)
func (ClientMarketplaceNewAgentResponsePromptUseCasesUnion) RawJSON ¶
func (u ClientMarketplaceNewAgentResponsePromptUseCasesUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientMarketplaceNewAgentResponsePromptUseCasesUnion) UnmarshalJSON ¶
func (r *ClientMarketplaceNewAgentResponsePromptUseCasesUnion) UnmarshalJSON(data []byte) error
type ClientMarketplaceService ¶
type ClientMarketplaceService struct {
Options []option.RequestOption
}
ClientMarketplaceService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientMarketplaceService method instead.
func NewClientMarketplaceService ¶
func NewClientMarketplaceService(opts ...option.RequestOption) (r ClientMarketplaceService)
NewClientMarketplaceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClientMarketplaceService) NewAgent ¶
func (r *ClientMarketplaceService) NewAgent(ctx context.Context, body ClientMarketplaceNewAgentParams, opts ...option.RequestOption) (res *ClientMarketplaceNewAgentResponse, err error)
Retrieve free agents from the marketplace.
type ClientRateGetLimitsResponse ¶
type ClientRateGetLimitsResponse struct {
// The configured rate limits based on the user's subscription tier.
Limits ClientRateGetLimitsResponseLimits `json:"limits" api:"required"`
// Current rate limit usage information for different time windows.
RateLimits ClientRateGetLimitsResponseRateLimits `json:"rate_limits" api:"required"`
// The user's current subscription tier (free or premium).
Tier string `json:"tier" api:"required"`
// ISO timestamp when the rate limits information was retrieved.
Timestamp string `json:"timestamp" api:"required"`
// Indicates whether the rate limits request was successful.
Success bool `json:"success" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Limits respjson.Field
RateLimits respjson.Field
Tier respjson.Field
Timestamp respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ClientRateGetLimitsResponse) RawJSON ¶
func (r ClientRateGetLimitsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientRateGetLimitsResponse) UnmarshalJSON ¶
func (r *ClientRateGetLimitsResponse) UnmarshalJSON(data []byte) error
type ClientRateGetLimitsResponseLimits ¶
type ClientRateGetLimitsResponseLimits struct {
// The maximum number of requests allowed per day.
MaximumRequestsPerDay int64 `json:"maximum_requests_per_day" api:"required"`
// The maximum number of requests allowed per hour.
MaximumRequestsPerHour int64 `json:"maximum_requests_per_hour" api:"required"`
// The maximum number of requests allowed per minute.
MaximumRequestsPerMinute int64 `json:"maximum_requests_per_minute" api:"required"`
// The maximum number of tokens allowed per agent.
TokensPerAgent int64 `json:"tokens_per_agent" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MaximumRequestsPerDay respjson.Field
MaximumRequestsPerHour respjson.Field
MaximumRequestsPerMinute respjson.Field
TokensPerAgent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The configured rate limits based on the user's subscription tier.
func (ClientRateGetLimitsResponseLimits) RawJSON ¶
func (r ClientRateGetLimitsResponseLimits) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientRateGetLimitsResponseLimits) UnmarshalJSON ¶
func (r *ClientRateGetLimitsResponseLimits) UnmarshalJSON(data []byte) error
type ClientRateGetLimitsResponseRateLimits ¶
type ClientRateGetLimitsResponseRateLimits struct {
// Rate limit information for the last day.
Day RateLimitWindow `json:"day" api:"required"`
// Rate limit information for the last hour.
Hour RateLimitWindow `json:"hour" api:"required"`
// Rate limit information for the last minute.
Minute RateLimitWindow `json:"minute" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Day respjson.Field
Hour respjson.Field
Minute respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Current rate limit usage information for different time windows.
func (ClientRateGetLimitsResponseRateLimits) RawJSON ¶
func (r ClientRateGetLimitsResponseRateLimits) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientRateGetLimitsResponseRateLimits) UnmarshalJSON ¶
func (r *ClientRateGetLimitsResponseRateLimits) UnmarshalJSON(data []byte) error
type ClientRateService ¶
type ClientRateService struct {
Options []option.RequestOption
}
ClientRateService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientRateService method instead.
func NewClientRateService ¶
func NewClientRateService(opts ...option.RequestOption) (r ClientRateService)
NewClientRateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClientRateService) GetLimits ¶
func (r *ClientRateService) GetLimits(ctx context.Context, opts ...option.RequestOption) (res *ClientRateGetLimitsResponse, err error)
Get the rate limits and current usage for the user associated with the provided API key.
type ClientService ¶
type ClientService struct {
Options []option.RequestOption
Rate ClientRateService
AutoSwarmBuilder ClientAutoSwarmBuilderService
AdvancedResearch ClientAdvancedResearchService
Tools ClientToolService
Marketplace ClientMarketplaceService
BatchedGridWorkflow ClientBatchedGridWorkflowService
GraphWorkflow ClientGraphWorkflowService
}
ClientService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientService method instead.
func NewClientService ¶
func NewClientService(opts ...option.RequestOption) (r ClientService)
NewClientService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type ClientToolListAvailableResponse ¶
type ClientToolListAvailableResponse struct {
// The status of the available tools.
Status string `json:"status" api:"nullable"`
// The list of available tools.
Tools []string `json:"tools" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
Tools respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ClientToolListAvailableResponse) RawJSON ¶
func (r ClientToolListAvailableResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ClientToolListAvailableResponse) UnmarshalJSON ¶
func (r *ClientToolListAvailableResponse) UnmarshalJSON(data []byte) error
type ClientToolService ¶
type ClientToolService struct {
Options []option.RequestOption
}
ClientToolService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientToolService method instead.
func NewClientToolService ¶
func NewClientToolService(opts ...option.RequestOption) (r ClientToolService)
NewClientToolService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClientToolService) ListAvailable ¶
func (r *ClientToolService) ListAvailable(ctx context.Context, opts ...option.RequestOption) (res *ClientToolListAvailableResponse, err error)
Retrieve comprehensive information about all available tools and capabilities supported by the Swarms API.
type GetRootResponse ¶
type GetRootResponse = any
type HealthCheckResponse ¶
type HealthCheckResponse struct {
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (HealthCheckResponse) RawJSON ¶
func (r HealthCheckResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*HealthCheckResponse) UnmarshalJSON ¶
func (r *HealthCheckResponse) UnmarshalJSON(data []byte) error
type HealthService ¶
type HealthService struct {
Options []option.RequestOption
}
HealthService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHealthService method instead.
func NewHealthService ¶
func NewHealthService(opts ...option.RequestOption) (r HealthService)
NewHealthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*HealthService) Check ¶
func (r *HealthService) Check(ctx context.Context, opts ...option.RequestOption) (res *HealthCheckResponse, err error)
Health
type McpConnectionParam ¶
type McpConnectionParam struct {
// Authentication token for accessing the MCP server
AuthorizationToken param.Opt[string] `json:"authorization_token,omitzero"`
// Timeout for the MCP server
Timeout param.Opt[int64] `json:"timeout,omitzero"`
// The transport protocol to use for the MCP server
Transport param.Opt[string] `json:"transport,omitzero"`
// The type of connection, defaults to 'mcp'
Type param.Opt[string] `json:"type,omitzero"`
// The URL endpoint for the MCP server
URL param.Opt[string] `json:"url,omitzero"`
// Headers to send to the MCP server
Headers map[string]string `json:"headers,omitzero"`
// Dictionary containing configuration settings for MCP tools
ToolConfigurations map[string]any `json:"tool_configurations,omitzero"`
ExtraFields map[string]any `json:"-"`
// contains filtered or unexported fields
}
func (McpConnectionParam) MarshalJSON ¶
func (r McpConnectionParam) MarshalJSON() (data []byte, err error)
func (*McpConnectionParam) UnmarshalJSON ¶
func (r *McpConnectionParam) UnmarshalJSON(data []byte) error
type ModelListAvailableResponse ¶
type ModelListAvailableResponse struct {
Models any `json:"models"`
Success bool `json:"success" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Models respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ModelListAvailableResponse) RawJSON ¶
func (r ModelListAvailableResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ModelListAvailableResponse) UnmarshalJSON ¶
func (r *ModelListAvailableResponse) UnmarshalJSON(data []byte) error
type ModelService ¶
type ModelService struct {
Options []option.RequestOption
}
ModelService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelService method instead.
func NewModelService ¶
func NewModelService(opts ...option.RequestOption) (r ModelService)
NewModelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ModelService) ListAvailable ¶
func (r *ModelService) ListAvailable(ctx context.Context, opts ...option.RequestOption) (res *ModelListAvailableResponse, err error)
Get all available models.
type RateLimitWindow ¶
type RateLimitWindow struct {
// The number of requests made in this time window.
Count int64 `json:"count" api:"required"`
// Whether the rate limit has been exceeded for this time window.
Exceeded bool `json:"exceeded" api:"required"`
// The maximum number of requests allowed in this time window.
Limit int64 `json:"limit" api:"required"`
// The number of requests remaining before hitting the limit.
Remaining int64 `json:"remaining" api:"required"`
// ISO timestamp when the rate limit will reset.
ResetTime string `json:"reset_time" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Exceeded respjson.Field
Limit respjson.Field
Remaining respjson.Field
ResetTime respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RateLimitWindow) RawJSON ¶
func (r RateLimitWindow) RawJSON() string
Returns the unmodified JSON received from the API
func (*RateLimitWindow) UnmarshalJSON ¶
func (r *RateLimitWindow) UnmarshalJSON(data []byte) error
type ReasoningAgentNewCompletionParams ¶
type ReasoningAgentNewCompletionParams struct {
// The unique name assigned to the reasoning agent.
AgentName param.Opt[string] `json:"agent_name,omitzero"`
// A detailed explanation of the reasoning agent's purpose and capabilities.
Description param.Opt[string] `json:"description,omitzero"`
// The maximum number of times the reasoning agent is allowed to repeat its task.
MaxLoops param.Opt[int64] `json:"max_loops,omitzero"`
// The memory capacity for the reasoning agent.
MemoryCapacity param.Opt[int64] `json:"memory_capacity,omitzero"`
// The name of the AI model that the reasoning agent will utilize.
ModelName param.Opt[string] `json:"model_name,omitzero"`
// The number of knowledge items to use for the reasoning agent.
NumKnowledgeItems param.Opt[int64] `json:"num_knowledge_items,omitzero"`
// The number of samples to generate for the reasoning agent.
NumSamples param.Opt[int64] `json:"num_samples,omitzero"`
// The initial instruction or context provided to the reasoning agent.
SystemPrompt param.Opt[string] `json:"system_prompt,omitzero"`
// The task to be completed by the reasoning agent.
Task param.Opt[string] `json:"task,omitzero"`
// The type of output format for the reasoning agent.
//
// Any of "list", "dict", "dictionary", "string", "str", "final", "last", "json",
// "all", "yaml", "xml", "dict-all-except-first", "str-all-except-first",
// "basemodel", "dict-final", "list-final".
OutputType ReasoningAgentNewCompletionParamsOutputType `json:"output_type,omitzero"`
// The type of reasoning swarm to use (e.g., reasoning duo, self-consistency, IRE).
//
// Any of "reasoning-duo", "self-consistency", "ire", "reasoning-agent",
// "consistency-agent", "ire-agent", "ReflexionAgent", "GKPAgent", "AgentJudge".
SwarmType ReasoningAgentNewCompletionParamsSwarmType `json:"swarm_type,omitzero"`
// contains filtered or unexported fields
}
func (ReasoningAgentNewCompletionParams) MarshalJSON ¶
func (r ReasoningAgentNewCompletionParams) MarshalJSON() (data []byte, err error)
func (*ReasoningAgentNewCompletionParams) UnmarshalJSON ¶
func (r *ReasoningAgentNewCompletionParams) UnmarshalJSON(data []byte) error
type ReasoningAgentNewCompletionParamsOutputType ¶
type ReasoningAgentNewCompletionParamsOutputType string
The type of output format for the reasoning agent.
const ( ReasoningAgentNewCompletionParamsOutputTypeList ReasoningAgentNewCompletionParamsOutputType = "list" ReasoningAgentNewCompletionParamsOutputTypeDict ReasoningAgentNewCompletionParamsOutputType = "dict" ReasoningAgentNewCompletionParamsOutputTypeDictionary ReasoningAgentNewCompletionParamsOutputType = "dictionary" ReasoningAgentNewCompletionParamsOutputTypeString ReasoningAgentNewCompletionParamsOutputType = "string" ReasoningAgentNewCompletionParamsOutputTypeStr ReasoningAgentNewCompletionParamsOutputType = "str" ReasoningAgentNewCompletionParamsOutputTypeFinal ReasoningAgentNewCompletionParamsOutputType = "final" ReasoningAgentNewCompletionParamsOutputTypeLast ReasoningAgentNewCompletionParamsOutputType = "last" ReasoningAgentNewCompletionParamsOutputTypeJson ReasoningAgentNewCompletionParamsOutputType = "json" ReasoningAgentNewCompletionParamsOutputTypeAll ReasoningAgentNewCompletionParamsOutputType = "all" ReasoningAgentNewCompletionParamsOutputTypeYaml ReasoningAgentNewCompletionParamsOutputType = "yaml" ReasoningAgentNewCompletionParamsOutputTypeXml ReasoningAgentNewCompletionParamsOutputType = "xml" ReasoningAgentNewCompletionParamsOutputTypeDictAllExceptFirst ReasoningAgentNewCompletionParamsOutputType = "dict-all-except-first" ReasoningAgentNewCompletionParamsOutputTypeStrAllExceptFirst ReasoningAgentNewCompletionParamsOutputType = "str-all-except-first" ReasoningAgentNewCompletionParamsOutputTypeBasemodel ReasoningAgentNewCompletionParamsOutputType = "basemodel" ReasoningAgentNewCompletionParamsOutputTypeDictFinal ReasoningAgentNewCompletionParamsOutputType = "dict-final" ReasoningAgentNewCompletionParamsOutputTypeListFinal ReasoningAgentNewCompletionParamsOutputType = "list-final" )
type ReasoningAgentNewCompletionParamsSwarmType ¶
type ReasoningAgentNewCompletionParamsSwarmType string
The type of reasoning swarm to use (e.g., reasoning duo, self-consistency, IRE).
const ( ReasoningAgentNewCompletionParamsSwarmTypeReasoningDuo ReasoningAgentNewCompletionParamsSwarmType = "reasoning-duo" ReasoningAgentNewCompletionParamsSwarmTypeSelfConsistency ReasoningAgentNewCompletionParamsSwarmType = "self-consistency" ReasoningAgentNewCompletionParamsSwarmTypeIre ReasoningAgentNewCompletionParamsSwarmType = "ire" ReasoningAgentNewCompletionParamsSwarmTypeReasoningAgent ReasoningAgentNewCompletionParamsSwarmType = "reasoning-agent" ReasoningAgentNewCompletionParamsSwarmTypeConsistencyAgent ReasoningAgentNewCompletionParamsSwarmType = "consistency-agent" ReasoningAgentNewCompletionParamsSwarmTypeIreAgent ReasoningAgentNewCompletionParamsSwarmType = "ire-agent" ReasoningAgentNewCompletionParamsSwarmTypeReflexionAgent ReasoningAgentNewCompletionParamsSwarmType = "ReflexionAgent" ReasoningAgentNewCompletionParamsSwarmTypeGkpAgent ReasoningAgentNewCompletionParamsSwarmType = "GKPAgent" ReasoningAgentNewCompletionParamsSwarmTypeAgentJudge ReasoningAgentNewCompletionParamsSwarmType = "AgentJudge" )
type ReasoningAgentService ¶
type ReasoningAgentService struct {
Options []option.RequestOption
}
ReasoningAgentService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewReasoningAgentService method instead.
func NewReasoningAgentService ¶
func NewReasoningAgentService(opts ...option.RequestOption) (r ReasoningAgentService)
NewReasoningAgentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ReasoningAgentService) ListTypes ¶
func (r *ReasoningAgentService) ListTypes(ctx context.Context, opts ...option.RequestOption) (res *ReasoningAgentListTypesResponse, err error)
Get the types of reasoning agents available.
func (*ReasoningAgentService) NewCompletion ¶
func (r *ReasoningAgentService) NewCompletion(ctx context.Context, body ReasoningAgentNewCompletionParams, opts ...option.RequestOption) (res *ReasoningAgentNewCompletionResponse, err error)
Run a reasoning agent with the specified task.
type SwarmBatchRunParams ¶
type SwarmBatchRunParams struct {
Body []SwarmSpecParam
// contains filtered or unexported fields
}
func (SwarmBatchRunParams) MarshalJSON ¶
func (r SwarmBatchRunParams) MarshalJSON() (data []byte, err error)
func (*SwarmBatchRunParams) UnmarshalJSON ¶
func (r *SwarmBatchRunParams) UnmarshalJSON(data []byte) error
type SwarmBatchRunResponse ¶
type SwarmBatchService ¶
type SwarmBatchService struct {
Options []option.RequestOption
}
SwarmBatchService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSwarmBatchService method instead.
func NewSwarmBatchService ¶
func NewSwarmBatchService(opts ...option.RequestOption) (r SwarmBatchService)
NewSwarmBatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SwarmBatchService) Run ¶
func (r *SwarmBatchService) Run(ctx context.Context, body SwarmBatchRunParams, opts ...option.RequestOption) (res *[]SwarmBatchRunResponse, err error)
Run a batch of swarms with the specified tasks using a thread pool.
type SwarmCheckAvailableResponse ¶
type SwarmCheckAvailableResponse struct {
Success bool `json:"success" api:"nullable"`
SwarmTypes []string `json:"swarm_types" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
SwarmTypes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SwarmCheckAvailableResponse) RawJSON ¶
func (r SwarmCheckAvailableResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SwarmCheckAvailableResponse) UnmarshalJSON ¶
func (r *SwarmCheckAvailableResponse) UnmarshalJSON(data []byte) error
type SwarmGetLogsResponse ¶
type SwarmGetLogsResponse struct {
Count int64 `json:"count" api:"nullable"`
Logs any `json:"logs"`
Status string `json:"status" api:"nullable"`
Timestamp string `json:"timestamp" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Logs respjson.Field
Status respjson.Field
Timestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SwarmGetLogsResponse) RawJSON ¶
func (r SwarmGetLogsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SwarmGetLogsResponse) UnmarshalJSON ¶
func (r *SwarmGetLogsResponse) UnmarshalJSON(data []byte) error
type SwarmRunParams ¶
type SwarmRunParams struct {
SwarmSpec SwarmSpecParam
// contains filtered or unexported fields
}
func (SwarmRunParams) MarshalJSON ¶
func (r SwarmRunParams) MarshalJSON() (data []byte, err error)
func (*SwarmRunParams) UnmarshalJSON ¶
func (r *SwarmRunParams) UnmarshalJSON(data []byte) error
type SwarmRunResponse ¶
type SwarmRunResponse struct {
// The description of the swarm.
Description string `json:"description" api:"required"`
// The execution time of the swarm.
ExecutionTime float64 `json:"execution_time" api:"required"`
// The unique identifier for the swarm completion.
JobID string `json:"job_id" api:"required"`
// The number of agents in the swarm.
NumberOfAgents int64 `json:"number_of_agents" api:"required"`
// The output of the swarm.
Output any `json:"output" api:"required"`
// The service tier of the swarm.
ServiceTier string `json:"service_tier" api:"required"`
// The status of the swarm completion.
Status string `json:"status" api:"required"`
// The name of the swarm.
SwarmName string `json:"swarm_name" api:"required"`
// The type of the swarm.
SwarmType string `json:"swarm_type" api:"required"`
// The usage of the swarm.
Usage map[string]any `json:"usage" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Description respjson.Field
ExecutionTime respjson.Field
JobID respjson.Field
NumberOfAgents respjson.Field
Output respjson.Field
ServiceTier respjson.Field
Status respjson.Field
SwarmName respjson.Field
SwarmType respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SwarmRunResponse) RawJSON ¶
func (r SwarmRunResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SwarmRunResponse) UnmarshalJSON ¶
func (r *SwarmRunResponse) UnmarshalJSON(data []byte) error
type SwarmService ¶
type SwarmService struct {
Options []option.RequestOption
Batch SwarmBatchService
}
SwarmService contains methods and other services that help with interacting with the swarms-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSwarmService method instead.
func NewSwarmService ¶
func NewSwarmService(opts ...option.RequestOption) (r SwarmService)
NewSwarmService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SwarmService) CheckAvailable ¶
func (r *SwarmService) CheckAvailable(ctx context.Context, opts ...option.RequestOption) (res *SwarmCheckAvailableResponse, err error)
Check the available swarm types.
func (*SwarmService) GetLogs ¶
func (r *SwarmService) GetLogs(ctx context.Context, opts ...option.RequestOption) (res *SwarmGetLogsResponse, err error)
Get all API request logs for all API keys associated with the user identified by the provided API key, excluding any logs that contain a client_ip field in their data.
func (*SwarmService) Run ¶
func (r *SwarmService) Run(ctx context.Context, body SwarmRunParams, opts ...option.RequestOption) (res *SwarmRunResponse, err error)
Run a swarm with the specified task. Supports streaming when stream=True.
type SwarmSpecMessagesUnionParam ¶
type SwarmSpecMessagesUnionParam struct {
OfMapOfAnyMap []map[string]any `json:",omitzero,inline"`
OfAnyMap map[string]any `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (SwarmSpecMessagesUnionParam) MarshalJSON ¶
func (u SwarmSpecMessagesUnionParam) MarshalJSON() ([]byte, error)
func (*SwarmSpecMessagesUnionParam) UnmarshalJSON ¶
func (u *SwarmSpecMessagesUnionParam) UnmarshalJSON(data []byte) error
type SwarmSpecParam ¶
type SwarmSpecParam struct {
// A comprehensive description of the swarm's objectives, capabilities, and
// intended outcomes.
Description param.Opt[string] `json:"description,omitzero"`
// The number of loops to run per agent in the heavy swarm.
HeavySwarmLoopsPerAgent param.Opt[int64] `json:"heavy_swarm_loops_per_agent,omitzero"`
// The model name to use for the question agent in the heavy swarm.
HeavySwarmQuestionAgentModelName param.Opt[string] `json:"heavy_swarm_question_agent_model_name,omitzero"`
// The model name to use for the worker agent in the heavy swarm.
HeavySwarmWorkerModelName param.Opt[string] `json:"heavy_swarm_worker_model_name,omitzero"`
// An optional image URL that may be associated with the swarm's task or
// representation.
Img param.Opt[string] `json:"img,omitzero"`
// The maximum number of execution loops allowed for the swarm, enabling repeated
// processing if needed.
MaxLoops param.Opt[int64] `json:"max_loops,omitzero"`
// The name of the swarm, which serves as an identifier for the group of agents and
// their collective task.
Name param.Opt[string] `json:"name,omitzero"`
// Instructions on how to rearrange the flow of tasks among agents, if applicable.
RearrangeFlow param.Opt[string] `json:"rearrange_flow,omitzero"`
// Guidelines or constraints that govern the behavior and interactions of the
// agents within the swarm.
Rules param.Opt[string] `json:"rules,omitzero"`
// The service tier to use for processing. Options: 'standard' (default) or 'flex'
// for lower cost but slower processing.
ServiceTier param.Opt[string] `json:"service_tier,omitzero"`
// A flag indicating whether the swarm should stream its output.
Stream param.Opt[bool] `json:"stream,omitzero"`
// The specific task or objective that the swarm is designed to accomplish.
Task param.Opt[string] `json:"task,omitzero"`
// A list of agents or specifications that define the agents participating in the
// swarm.
Agents []AgentSpecParam `json:"agents,omitzero"`
// A list of messages that the swarm should complete.
Messages SwarmSpecMessagesUnionParam `json:"messages,omitzero"`
// The classification of the swarm, indicating its operational style and
// methodology.
//
// Any of "AgentRearrange", "MixtureOfAgents", "SequentialWorkflow",
// "ConcurrentWorkflow", "GroupChat", "MultiAgentRouter", "AutoSwarmBuilder",
// "HiearchicalSwarm", "auto", "MajorityVoting", "MALT", "DeepResearchSwarm",
// "CouncilAsAJudge", "InteractiveGroupChat", "HeavySwarm".
SwarmType SwarmSpecSwarmType `json:"swarm_type,omitzero"`
// A list of tasks that the swarm should complete.
Tasks []string `json:"tasks,omitzero"`
// contains filtered or unexported fields
}
func (SwarmSpecParam) MarshalJSON ¶
func (r SwarmSpecParam) MarshalJSON() (data []byte, err error)
func (*SwarmSpecParam) UnmarshalJSON ¶
func (r *SwarmSpecParam) UnmarshalJSON(data []byte) error
type SwarmSpecSwarmType ¶
type SwarmSpecSwarmType string
The classification of the swarm, indicating its operational style and methodology.
const ( SwarmSpecSwarmTypeAgentRearrange SwarmSpecSwarmType = "AgentRearrange" SwarmSpecSwarmTypeMixtureOfAgents SwarmSpecSwarmType = "MixtureOfAgents" SwarmSpecSwarmTypeSequentialWorkflow SwarmSpecSwarmType = "SequentialWorkflow" SwarmSpecSwarmTypeConcurrentWorkflow SwarmSpecSwarmType = "ConcurrentWorkflow" SwarmSpecSwarmTypeGroupChat SwarmSpecSwarmType = "GroupChat" SwarmSpecSwarmTypeMultiAgentRouter SwarmSpecSwarmType = "MultiAgentRouter" SwarmSpecSwarmTypeAutoSwarmBuilder SwarmSpecSwarmType = "AutoSwarmBuilder" SwarmSpecSwarmTypeHiearchicalSwarm SwarmSpecSwarmType = "HiearchicalSwarm" SwarmSpecSwarmTypeAuto SwarmSpecSwarmType = "auto" SwarmSpecSwarmTypeMajorityVoting SwarmSpecSwarmType = "MajorityVoting" SwarmSpecSwarmTypeMalt SwarmSpecSwarmType = "MALT" SwarmSpecSwarmTypeDeepResearchSwarm SwarmSpecSwarmType = "DeepResearchSwarm" SwarmSpecSwarmTypeCouncilAsAJudge SwarmSpecSwarmType = "CouncilAsAJudge" SwarmSpecSwarmTypeInteractiveGroupChat SwarmSpecSwarmType = "InteractiveGroupChat" SwarmSpecSwarmTypeHeavySwarm SwarmSpecSwarmType = "HeavySwarm" )
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|