Documentation
¶
Index ¶
- func StringField(m map[string]any, keys ...string) string
- type AgentDetail
- type AgentSummary
- type ArtifactMetadata
- type ChatConfigResponse
- type ChatRequest
- type ChatUsage
- type Client
- func (c *Client) AuthValidate(ctx context.Context) (any, error)
- func (c *Client) AuthWhoAmI(ctx context.Context) (any, error)
- func (c *Client) CreateSkill(ctx context.Context, body []byte) (*SkillDetail, error)
- func (c *Client) CreateTaskRaw(ctx context.Context, body []byte) (*TaskDetail, error)
- func (c *Client) DeleteAgent(ctx context.Context, name string, opts GetOptions) error
- func (c *Client) DeleteResource(ctx context.Context, path string, query map[string]string) error
- func (c *Client) DeleteSkill(ctx context.Context, name string, opts GetOptions) error
- func (c *Client) DeleteTask(ctx context.Context, name string, opts GetOptions) error
- func (c *Client) DoJSON(ctx context.Context, method, path string, query map[string]string, body []byte) (any, error)
- func (c *Client) DownloadArtifact(ctx context.Context, taskName, filename string, opts GetOptions) ([]byte, string, error)
- func (c *Client) GetAgent(ctx context.Context, name string, opts GetOptions) (*AgentDetail, error)
- func (c *Client) GetChatConfig(ctx context.Context) (*ChatConfigResponse, error)
- func (c *Client) GetRaw(ctx context.Context, path string, query map[string]string) ([]byte, string, error)
- func (c *Client) GetSkill(ctx context.Context, name string, opts GetOptions) (*SkillDetail, error)
- func (c *Client) GetTask(ctx context.Context, name string, opts GetOptions) (*TaskDetail, error)
- func (c *Client) GetTaskChildren(ctx context.Context, name string, opts GetOptions) (any, error)
- func (c *Client) GetTaskLogs(ctx context.Context, name string, opts GetOptions) (*TaskLogsResponse, error)
- func (c *Client) GetTaskPlan(ctx context.Context, name string, opts GetOptions) (any, error)
- func (c *Client) GetTaskResult(ctx context.Context, name string, opts GetOptions) (*TaskResultResponse, error)
- func (c *Client) HealthCheck(ctx context.Context) (bool, error)
- func (c *Client) ListAgents(ctx context.Context, opts ListOptions) ([]AgentSummary, error)
- func (c *Client) ListArtifacts(ctx context.Context, taskName string, opts GetOptions) ([]ArtifactMetadata, error)
- func (c *Client) ListModels(ctx context.Context, compat string) (any, error)
- func (c *Client) ListSkills(ctx context.Context, opts ListOptions) ([]SkillSummary, error)
- func (c *Client) ListTasks(ctx context.Context, opts ListTasksOptions) ([]TaskSummary, error)
- func (c *Client) ListTasksPage(ctx context.Context, opts ListTasksOptions) (*ListTasksResult, error)
- func (c *Client) ReadyCheck(ctx context.Context) (bool, error)
- func (c *Client) Stream(ctx context.Context, path string, query map[string]string) (io.ReadCloser, error)
- func (c *Client) StreamChat(ctx context.Context, req ChatRequest) (*SSEReader, *http.Response, error)
- func (c *Client) StreamTaskLogs(ctx context.Context, name string, opts StreamLogsOptions) error
- type CreateTaskRequest
- type GetOptions
- type ListOptions
- type ListTasksOptions
- type ListTasksResult
- type SSEEvent
- type SSEEventData
- type SSEReader
- type SkillDetail
- type SkillSummary
- type StreamLogsOptions
- type TaskDetail
- type TaskLogsResponse
- type TaskResultResponse
- type TaskSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentDetail ¶
AgentDetail is the full agent object returned by the API.
type AgentSummary ¶
type AgentSummary struct {
Name string `json:"name"`
Model string `json:"model,omitempty"`
Runtime string `json:"runtime,omitempty"`
Active int `json:"activeTasks"`
}
AgentSummary is a lightweight representation of an agent for list display.
type ArtifactMetadata ¶
type ArtifactMetadata struct {
Filename string `json:"filename"`
ContentType string `json:"contentType"`
Size int64 `json:"size"`
CreatedAt string `json:"createdAt"`
}
ArtifactMetadata describes a stored artifact.
type ChatConfigResponse ¶
type ChatConfigResponse struct {
Enabled bool `json:"enabled"`
Provider string `json:"provider"`
Model string `json:"model"`
AvailableTools []string `json:"availableTools"`
}
ChatConfigResponse is the response from GET /api/v1/chat/config.
type ChatRequest ¶
type ChatRequest struct {
Message string `json:"message"`
SessionID string `json:"sessionId,omitempty"`
Namespace string `json:"namespace,omitempty"`
Agent string `json:"agentRef,omitempty"`
Model string `json:"model,omitempty"`
Provider string `json:"provider,omitempty"`
}
ChatRequest is the request body for POST /api/v1/chat.
type ChatUsage ¶
type ChatUsage struct {
InputTokens int `json:"inputTokens"`
OutputTokens int `json:"outputTokens"`
}
ChatUsage holds token usage statistics from a chat response.
type Client ¶
type Client struct {
BaseURL string
Token string
TxnToken string
Namespace string
HTTPClient *http.Client
}
Client is an HTTP client for the Orka API.
func NewWithNamespace ¶
NewWithNamespace creates a new Orka API client with a default namespace.
func (*Client) AuthValidate ¶
AuthValidate validates the current credentials.
func (*Client) AuthWhoAmI ¶
AuthWhoAmI returns the sanitized authenticated identity.
func (*Client) CreateSkill ¶
CreateSkill creates a new skill via the API.
func (*Client) CreateTaskRaw ¶
CreateTaskRaw creates a task from a JSON request body.
func (*Client) DeleteAgent ¶
DeleteAgent deletes an agent by name.
func (*Client) DeleteResource ¶
DeleteResource deletes a resource path.
func (*Client) DeleteSkill ¶
DeleteSkill deletes a skill by name.
func (*Client) DeleteTask ¶
DeleteTask deletes a task by name.
func (*Client) DoJSON ¶
func (c *Client) DoJSON(ctx context.Context, method, path string, query map[string]string, body []byte) (any, error)
DoJSON sends an HTTP request with an optional JSON body and decodes the JSON response into a generic value.
func (*Client) DownloadArtifact ¶
func (c *Client) DownloadArtifact( ctx context.Context, taskName, filename string, opts GetOptions, ) ([]byte, string, error)
DownloadArtifact downloads a specific artifact and returns the raw bytes and content type.
func (*Client) GetAgent ¶
func (c *Client) GetAgent(ctx context.Context, name string, opts GetOptions) (*AgentDetail, error)
GetAgent returns full details for a single agent.
func (*Client) GetChatConfig ¶
func (c *Client) GetChatConfig(ctx context.Context) (*ChatConfigResponse, error)
GetChatConfig fetches the chat configuration from the server.
func (*Client) GetRaw ¶
func (c *Client) GetRaw(ctx context.Context, path string, query map[string]string) ([]byte, string, error)
GetRaw gets a raw response body and content type.
func (*Client) GetSkill ¶
func (c *Client) GetSkill(ctx context.Context, name string, opts GetOptions) (*SkillDetail, error)
GetSkill returns full details for a single skill.
func (*Client) GetTask ¶
func (c *Client) GetTask(ctx context.Context, name string, opts GetOptions) (*TaskDetail, error)
GetTask returns full details for a single task.
func (*Client) GetTaskChildren ¶
GetTaskChildren gets child tasks for a task as a generic list response.
func (*Client) GetTaskLogs ¶
func (c *Client) GetTaskLogs(ctx context.Context, name string, opts GetOptions) (*TaskLogsResponse, error)
GetTaskLogs gets logs for a task.
func (*Client) GetTaskPlan ¶
GetTaskPlan gets the plan for a task as a generic JSON value.
func (*Client) GetTaskResult ¶
func (c *Client) GetTaskResult(ctx context.Context, name string, opts GetOptions) (*TaskResultResponse, error)
GetTaskResult gets the result of a task.
func (*Client) HealthCheck ¶
HealthCheck calls GET /healthz and returns true if healthy.
func (*Client) ListAgents ¶
func (c *Client) ListAgents(ctx context.Context, opts ListOptions) ([]AgentSummary, error)
ListAgents returns all agents from the API.
func (*Client) ListArtifacts ¶
func (c *Client) ListArtifacts(ctx context.Context, taskName string, opts GetOptions) ([]ArtifactMetadata, error)
ListArtifacts returns artifacts for a task.
func (*Client) ListModels ¶
ListModels lists compatibility models for the requested API compatibility surface.
func (*Client) ListSkills ¶
func (c *Client) ListSkills(ctx context.Context, opts ListOptions) ([]SkillSummary, error)
ListSkills returns all skills from the API.
func (*Client) ListTasks ¶
func (c *Client) ListTasks(ctx context.Context, opts ListTasksOptions) ([]TaskSummary, error)
ListTasks returns tasks from the API.
func (*Client) ListTasksPage ¶
func (c *Client) ListTasksPage(ctx context.Context, opts ListTasksOptions) (*ListTasksResult, error)
ListTasksPage returns one task page from the API, including pagination metadata.
func (*Client) ReadyCheck ¶
ReadyCheck calls GET /readyz and returns true if ready.
func (*Client) Stream ¶
func (c *Client) Stream(ctx context.Context, path string, query map[string]string) (io.ReadCloser, error)
Stream opens a streaming GET request for Server-Sent Events. The caller must close the returned body.
func (*Client) StreamChat ¶
func (c *Client) StreamChat(ctx context.Context, req ChatRequest) (*SSEReader, *http.Response, error)
StreamChat sends a chat message and returns an SSE reader for streaming the response.
func (*Client) StreamTaskLogs ¶
StreamTaskLogs streams live logs for a running task via SSE.
type CreateTaskRequest ¶
type CreateTaskRequest struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
Type string `json:"type"`
Image string `json:"image,omitempty"`
Command []string `json:"command,omitempty"`
Args []string `json:"args,omitempty"`
Env []struct {
Name string `json:"name"`
Value string `json:"value,omitempty"`
} `json:"env,omitempty"`
Priority *int32 `json:"priority,omitempty"`
Prompt string `json:"prompt,omitempty"`
Timeout string `json:"timeout,omitempty"`
Schedule string `json:"schedule,omitempty"`
TimeZone *string `json:"timeZone,omitempty"`
Suspend *bool `json:"suspend,omitempty"`
AgentRef *struct {
Name string `json:"name"`
} `json:"agentRef,omitempty"`
AgentRuntime *corev1alpha1.AgentRuntimeSpec `json:"agentRuntime,omitempty"`
AI *struct {
ProviderRef *struct {
Name string `json:"name"`
} `json:"providerRef,omitempty"`
Model string `json:"model,omitempty"`
Prompt string `json:"prompt,omitempty"`
} `json:"ai,omitempty"`
}
CreateTaskRequest is the request body for creating a task.
type GetOptions ¶
type GetOptions struct {
Namespace string
}
GetOptions contains options for get operations.
type ListOptions ¶
type ListOptions struct {
Namespace string
}
ListOptions contains options for list operations.
type ListTasksOptions ¶
ListTasksOptions contains options for listing tasks.
type ListTasksResult ¶
type ListTasksResult struct {
Items []TaskSummary
Continue string
RemainingItemCount *int64
}
ListTasksResult contains a page of task summaries and pagination metadata.
type SSEEventData ¶
type SSEEventData struct {
// status event
SessionID string `json:"sessionId,omitempty"`
// message event
Content string `json:"content,omitempty"`
// tool_call / tool_result event
Name string `json:"name,omitempty"`
Args json.RawMessage `json:"args,omitempty"`
// tool_result event — raw JSON (may be object or string)
Result json.RawMessage `json:"result,omitempty"`
// error event
Error string `json:"error,omitempty"`
// done event
Usage *ChatUsage `json:"usage,omitempty"`
}
SSEEventData holds the parsed data payload from an SSE event.
type SSEReader ¶
type SSEReader struct {
// contains filtered or unexported fields
}
SSEReader reads Server-Sent Events from a stream.
func NewSSEReader ¶
NewSSEReader creates a new SSE reader from an io.Reader.
type SkillDetail ¶
SkillDetail is the full skill object returned by the API.
type SkillSummary ¶
type SkillSummary struct {
Name string `json:"name"`
DisplayName string `json:"displayName,omitempty"`
Description string `json:"description"`
Version string `json:"version,omitempty"`
Author string `json:"author,omitempty"`
Tags []string `json:"tags,omitempty"`
Phase string `json:"phase,omitempty"`
}
SkillSummary is a lightweight representation of a skill for list display.
type StreamLogsOptions ¶
StreamLogsOptions contains options for streaming task logs.
type TaskDetail ¶
TaskDetail is the full task object returned by the API.
type TaskLogsResponse ¶
type TaskLogsResponse struct {
Logs string `json:"logs,omitempty"`
Message string `json:"message,omitempty"`
JobName string `json:"jobName,omitempty"`
}
TaskLogsResponse is the response for getting task logs.
type TaskResultResponse ¶
type TaskResultResponse struct {
Result string `json:"result"`
}
TaskResultResponse is the response for getting task results.
type TaskSummary ¶
type TaskSummary struct {
Name string `json:"name" yaml:"name"`
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Phase string `json:"phase,omitempty" yaml:"phase,omitempty"`
Age string `json:"age,omitempty" yaml:"age,omitempty"`
Iteration int `json:"iteration,omitempty" yaml:"iteration,omitempty"`
TransactionID string `json:"transactionId,omitempty" yaml:"transactionId,omitempty"`
ParentTask string `json:"parentTask,omitempty" yaml:"parentTask,omitempty"`
}
TaskSummary is a lightweight representation of a task for list display.