Documentation
¶
Index ¶
- Constants
- func Bool(value bool) param.Field[bool]
- func DefaultClientOptions() []option.RequestOption
- func F[T any](value T) param.Field[T]
- func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]
- func Float(value float64) param.Field[float64]
- func Int(value int64) param.Field[int64]
- func Null[T any]() param.Field[T]
- func Raw[T any](value any) param.Field[T]
- func String(value string) param.Field[string]
- type App
- type AppPath
- type AppService
- type AppTime
- type AssistantMessage
- type AssistantMessageError
- type AssistantMessageErrorMessageOutputLengthError
- type AssistantMessageErrorMessageOutputLengthErrorName
- type AssistantMessageErrorName
- type AssistantMessageErrorUnion
- type AssistantMessagePart
- type AssistantMessagePartType
- type AssistantMessagePartUnion
- type AssistantMessagePath
- type AssistantMessageRole
- type AssistantMessageTime
- type AssistantMessageTokens
- type AssistantMessageTokensCache
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, ...) error
- func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- type Config
- type ConfigExperimental
- type ConfigExperimentalHook
- type ConfigExperimentalHookFileEdited
- type ConfigExperimentalHookSessionCompleted
- type ConfigMcp
- type ConfigMcpType
- type ConfigMcpUnion
- type ConfigProvider
- type ConfigProviderModel
- type ConfigProviderModelsCost
- type ConfigProviderModelsLimit
- type ConfigProvidersResponse
- type ConfigService
- type Error
- type EventListResponse
- type EventListResponseEventFileEdited
- type EventListResponseEventFileEditedProperties
- type EventListResponseEventFileEditedType
- type EventListResponseEventFileWatcherUpdated
- type EventListResponseEventFileWatcherUpdatedProperties
- type EventListResponseEventFileWatcherUpdatedPropertiesEvent
- type EventListResponseEventFileWatcherUpdatedType
- type EventListResponseEventInstallationUpdated
- type EventListResponseEventInstallationUpdatedProperties
- type EventListResponseEventInstallationUpdatedType
- type EventListResponseEventLspClientDiagnostics
- type EventListResponseEventLspClientDiagnosticsProperties
- type EventListResponseEventLspClientDiagnosticsType
- type EventListResponseEventMessagePartUpdated
- type EventListResponseEventMessagePartUpdatedProperties
- type EventListResponseEventMessagePartUpdatedType
- type EventListResponseEventMessageRemoved
- type EventListResponseEventMessageRemovedProperties
- type EventListResponseEventMessageRemovedType
- type EventListResponseEventMessageUpdated
- type EventListResponseEventMessageUpdatedProperties
- type EventListResponseEventMessageUpdatedType
- type EventListResponseEventPermissionUpdated
- type EventListResponseEventPermissionUpdatedProperties
- type EventListResponseEventPermissionUpdatedPropertiesTime
- type EventListResponseEventPermissionUpdatedType
- type EventListResponseEventSessionDeleted
- type EventListResponseEventSessionDeletedProperties
- type EventListResponseEventSessionDeletedType
- type EventListResponseEventSessionError
- type EventListResponseEventSessionErrorProperties
- type EventListResponseEventSessionErrorPropertiesError
- type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError
- type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName
- type EventListResponseEventSessionErrorPropertiesErrorName
- type EventListResponseEventSessionErrorPropertiesErrorUnion
- type EventListResponseEventSessionErrorType
- type EventListResponseEventSessionIdle
- type EventListResponseEventSessionIdleProperties
- type EventListResponseEventSessionIdleType
- type EventListResponseEventSessionUpdated
- type EventListResponseEventSessionUpdatedProperties
- type EventListResponseEventSessionUpdatedType
- type EventListResponseEventStorageWrite
- type EventListResponseEventStorageWriteProperties
- type EventListResponseEventStorageWriteType
- type EventListResponseType
- type EventListResponseUnion
- type EventService
- type FilePart
- type FilePartParam
- type FilePartType
- type FileReadParams
- type FileReadResponse
- type FileReadResponseType
- type FileService
- type FileStatusResponse
- type FileStatusResponseStatus
- type FindFilesParams
- type FindService
- func (r *FindService) Files(ctx context.Context, query FindFilesParams, opts ...option.RequestOption) (res *[]string, err error)
- func (r *FindService) Symbols(ctx context.Context, query FindSymbolsParams, opts ...option.RequestOption) (res *[]FindSymbolsResponse, err error)
- func (r *FindService) Text(ctx context.Context, query FindTextParams, opts ...option.RequestOption) (res *[]FindTextResponse, err error)
- type FindSymbolsParams
- type FindSymbolsResponse
- type FindTextParams
- type FindTextResponse
- type FindTextResponseLines
- type FindTextResponsePath
- type FindTextResponseSubmatch
- type FindTextResponseSubmatchesMatch
- type Keybinds
- type McpLocal
- type McpLocalType
- type McpRemote
- type McpRemoteType
- type Message
- type MessageRole
- type MessageUnion
- type MessageUserMessage
- type MessageUserMessageRole
- type MessageUserMessageTime
- type Model
- type ModelCost
- type ModelLimit
- type Provider
- type ProviderAuthError
- type ProviderAuthErrorData
- type ProviderAuthErrorName
- type Session
- type SessionChatParams
- type SessionInitParams
- type SessionRevert
- type SessionService
- func (r *SessionService) Abort(ctx context.Context, id string, opts ...option.RequestOption) (res *bool, err error)
- func (r *SessionService) Chat(ctx context.Context, id string, body SessionChatParams, ...) (res *AssistantMessage, err error)
- func (r *SessionService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *bool, err error)
- func (r *SessionService) Init(ctx context.Context, id string, body SessionInitParams, ...) (res *bool, err error)
- func (r *SessionService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Session, err error)
- func (r *SessionService) Messages(ctx context.Context, id string, opts ...option.RequestOption) (res *[]Message, err error)
- func (r *SessionService) New(ctx context.Context, opts ...option.RequestOption) (res *Session, err error)
- func (r *SessionService) Share(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
- func (r *SessionService) Summarize(ctx context.Context, id string, body SessionSummarizeParams, ...) (res *bool, err error)
- func (r *SessionService) Unshare(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
- type SessionShare
- type SessionSummarizeParams
- type SessionTime
- type StepStartPart
- type StepStartPartType
- type TextPart
- type TextPartParam
- type TextPartType
- type ToolPart
- type ToolPartState
- type ToolPartStateStatus
- type ToolPartStateUnion
- type ToolPartType
- type ToolStateCompleted
- type ToolStateCompletedStatus
- type ToolStateCompletedTime
- type ToolStateError
- type ToolStateErrorStatus
- type ToolStateErrorTime
- type ToolStatePending
- type ToolStatePendingStatus
- type ToolStateRunning
- type ToolStateRunningStatus
- type ToolStateRunningTime
- type UnknownError
- type UnknownErrorData
- type UnknownErrorName
- type UserMessagePart
- type UserMessagePartParam
- type UserMessagePartType
- type UserMessagePartUnion
- type UserMessagePartUnionParam
Constants ¶
const ProviderAuthErrorNameProviderAuthError = shared.ProviderAuthErrorNameProviderAuthError
This is an alias to an internal value.
const UnknownErrorNameUnknownError = shared.UnknownErrorNameUnknownError
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (OPENCODE_BASE_URL). This should be used to initialize new clients.
func F ¶
F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.
func Int ¶
Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.
func Raw ¶
Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).
Types ¶
type App ¶
type App struct { Git bool `json:"git,required"` Hostname string `json:"hostname,required"` Path AppPath `json:"path,required"` Time AppTime `json:"time,required"` User string `json:"user,required"` JSON appJSON `json:"-"` }
func (*App) UnmarshalJSON ¶
type AppPath ¶
type AppPath struct { Config string `json:"config,required"` Cwd string `json:"cwd,required"` Data string `json:"data,required"` Root string `json:"root,required"` State string `json:"state,required"` JSON appPathJSON `json:"-"` }
func (*AppPath) UnmarshalJSON ¶
type AppService ¶
type AppService struct {
Options []option.RequestOption
}
AppService contains methods and other services that help with interacting with the opencode 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 NewAppService method instead.
func NewAppService ¶
func NewAppService(opts ...option.RequestOption) (r *AppService)
NewAppService 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 (*AppService) Get ¶
func (r *AppService) Get(ctx context.Context, opts ...option.RequestOption) (res *App, err error)
Get app info
func (*AppService) Init ¶
func (r *AppService) Init(ctx context.Context, opts ...option.RequestOption) (res *bool, err error)
Initialize the app
type AppTime ¶
type AppTime struct { Initialized float64 `json:"initialized"` JSON appTimeJSON `json:"-"` }
func (*AppTime) UnmarshalJSON ¶
type AssistantMessage ¶
type AssistantMessage struct { ID string `json:"id,required"` Cost float64 `json:"cost,required"` ModelID string `json:"modelID,required"` Parts []AssistantMessagePart `json:"parts,required"` Path AssistantMessagePath `json:"path,required"` ProviderID string `json:"providerID,required"` Role AssistantMessageRole `json:"role,required"` SessionID string `json:"sessionID,required"` System []string `json:"system,required"` Time AssistantMessageTime `json:"time,required"` Tokens AssistantMessageTokens `json:"tokens,required"` Error AssistantMessageError `json:"error"` Summary bool `json:"summary"` JSON assistantMessageJSON `json:"-"` }
func (*AssistantMessage) UnmarshalJSON ¶
func (r *AssistantMessage) UnmarshalJSON(data []byte) (err error)
type AssistantMessageError ¶
type AssistantMessageError struct { // This field can have the runtime type of [shared.ProviderAuthErrorData], // [shared.UnknownErrorData], [interface{}]. Data interface{} `json:"data,required"` Name AssistantMessageErrorName `json:"name,required"` JSON assistantMessageErrorJSON `json:"-"` // contains filtered or unexported fields }
func (AssistantMessageError) AsUnion ¶
func (r AssistantMessageError) AsUnion() AssistantMessageErrorUnion
AsUnion returns a AssistantMessageErrorUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.ProviderAuthError, shared.UnknownError, AssistantMessageErrorMessageOutputLengthError.
func (*AssistantMessageError) UnmarshalJSON ¶
func (r *AssistantMessageError) UnmarshalJSON(data []byte) (err error)
type AssistantMessageErrorMessageOutputLengthError ¶
type AssistantMessageErrorMessageOutputLengthError struct { Data interface{} `json:"data,required"` Name AssistantMessageErrorMessageOutputLengthErrorName `json:"name,required"` JSON assistantMessageErrorMessageOutputLengthErrorJSON `json:"-"` }
func (AssistantMessageErrorMessageOutputLengthError) ImplementsAssistantMessageError ¶
func (r AssistantMessageErrorMessageOutputLengthError) ImplementsAssistantMessageError()
func (*AssistantMessageErrorMessageOutputLengthError) UnmarshalJSON ¶
func (r *AssistantMessageErrorMessageOutputLengthError) UnmarshalJSON(data []byte) (err error)
type AssistantMessageErrorMessageOutputLengthErrorName ¶
type AssistantMessageErrorMessageOutputLengthErrorName string
const (
AssistantMessageErrorMessageOutputLengthErrorNameMessageOutputLengthError AssistantMessageErrorMessageOutputLengthErrorName = "MessageOutputLengthError"
)
func (AssistantMessageErrorMessageOutputLengthErrorName) IsKnown ¶
func (r AssistantMessageErrorMessageOutputLengthErrorName) IsKnown() bool
type AssistantMessageErrorName ¶
type AssistantMessageErrorName string
const ( AssistantMessageErrorNameProviderAuthError AssistantMessageErrorName = "ProviderAuthError" AssistantMessageErrorNameUnknownError AssistantMessageErrorName = "UnknownError" AssistantMessageErrorNameMessageOutputLengthError AssistantMessageErrorName = "MessageOutputLengthError" )
func (AssistantMessageErrorName) IsKnown ¶
func (r AssistantMessageErrorName) IsKnown() bool
type AssistantMessageErrorUnion ¶
type AssistantMessageErrorUnion interface {
ImplementsAssistantMessageError()
}
Union satisfied by shared.ProviderAuthError, shared.UnknownError or AssistantMessageErrorMessageOutputLengthError.
type AssistantMessagePart ¶
type AssistantMessagePart struct { Type AssistantMessagePartType `json:"type,required"` ID string `json:"id"` // This field can have the runtime type of [ToolPartState]. State interface{} `json:"state"` Text string `json:"text"` Tool string `json:"tool"` JSON assistantMessagePartJSON `json:"-"` // contains filtered or unexported fields }
func (AssistantMessagePart) AsUnion ¶
func (r AssistantMessagePart) AsUnion() AssistantMessagePartUnion
AsUnion returns a AssistantMessagePartUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are TextPart, ToolPart, StepStartPart.
func (*AssistantMessagePart) UnmarshalJSON ¶
func (r *AssistantMessagePart) UnmarshalJSON(data []byte) (err error)
type AssistantMessagePartType ¶
type AssistantMessagePartType string
const ( AssistantMessagePartTypeText AssistantMessagePartType = "text" AssistantMessagePartTypeTool AssistantMessagePartType = "tool" AssistantMessagePartTypeStepStart AssistantMessagePartType = "step-start" )
func (AssistantMessagePartType) IsKnown ¶
func (r AssistantMessagePartType) IsKnown() bool
type AssistantMessagePartUnion ¶
type AssistantMessagePartUnion interface {
// contains filtered or unexported methods
}
Union satisfied by TextPart, ToolPart or StepStartPart.
type AssistantMessagePath ¶
type AssistantMessagePath struct { Cwd string `json:"cwd,required"` Root string `json:"root,required"` JSON assistantMessagePathJSON `json:"-"` }
func (*AssistantMessagePath) UnmarshalJSON ¶
func (r *AssistantMessagePath) UnmarshalJSON(data []byte) (err error)
type AssistantMessageRole ¶
type AssistantMessageRole string
const (
AssistantMessageRoleAssistant AssistantMessageRole = "assistant"
)
func (AssistantMessageRole) IsKnown ¶
func (r AssistantMessageRole) IsKnown() bool
type AssistantMessageTime ¶
type AssistantMessageTime struct { Created float64 `json:"created,required"` Completed float64 `json:"completed"` JSON assistantMessageTimeJSON `json:"-"` }
func (*AssistantMessageTime) UnmarshalJSON ¶
func (r *AssistantMessageTime) UnmarshalJSON(data []byte) (err error)
type AssistantMessageTokens ¶
type AssistantMessageTokens struct { Cache AssistantMessageTokensCache `json:"cache,required"` Input float64 `json:"input,required"` Output float64 `json:"output,required"` Reasoning float64 `json:"reasoning,required"` JSON assistantMessageTokensJSON `json:"-"` }
func (*AssistantMessageTokens) UnmarshalJSON ¶
func (r *AssistantMessageTokens) UnmarshalJSON(data []byte) (err error)
type AssistantMessageTokensCache ¶
type AssistantMessageTokensCache struct { Read float64 `json:"read,required"` Write float64 `json:"write,required"` JSON assistantMessageTokensCacheJSON `json:"-"` }
func (*AssistantMessageTokensCache) UnmarshalJSON ¶
func (r *AssistantMessageTokensCache) UnmarshalJSON(data []byte) (err error)
type Client ¶
type Client struct { Options []option.RequestOption Event *EventService App *AppService Find *FindService File *FileService Config *ConfigService Session *SessionService }
Client creates a struct with services and top level methods that help with interacting with the opencode 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 (OPENCODE_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 interface{}, res interface{}, 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 interface{}, res interface{}, 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 interface{}, res interface{}, 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) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, 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.
func (*Client) Post ¶
func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type Config ¶
type Config struct { // JSON schema reference for configuration validation Schema string `json:"$schema"` Autoshare bool `json:"autoshare"` // Automatically update to the latest version Autoupdate bool `json:"autoupdate"` // Disable providers that are loaded automatically DisabledProviders []string `json:"disabled_providers"` Experimental ConfigExperimental `json:"experimental"` // Additional instruction files or patterns to include Instructions []string `json:"instructions"` // Custom keybind configurations Keybinds Keybinds `json:"keybinds"` // MCP (Model Context Protocol) server configurations Mcp map[string]ConfigMcp `json:"mcp"` // Model to use in the format of provider/model, eg anthropic/claude-2 Model string `json:"model"` // Custom provider configurations and model overrides Provider map[string]ConfigProvider `json:"provider"` // Theme name to use for the interface Theme string `json:"theme"` JSON configJSON `json:"-"` }
func (*Config) UnmarshalJSON ¶
type ConfigExperimental ¶
type ConfigExperimental struct { Hook ConfigExperimentalHook `json:"hook"` JSON configExperimentalJSON `json:"-"` }
func (*ConfigExperimental) UnmarshalJSON ¶
func (r *ConfigExperimental) UnmarshalJSON(data []byte) (err error)
type ConfigExperimentalHook ¶
type ConfigExperimentalHook struct { FileEdited map[string][]ConfigExperimentalHookFileEdited `json:"file_edited"` SessionCompleted []ConfigExperimentalHookSessionCompleted `json:"session_completed"` JSON configExperimentalHookJSON `json:"-"` }
func (*ConfigExperimentalHook) UnmarshalJSON ¶
func (r *ConfigExperimentalHook) UnmarshalJSON(data []byte) (err error)
type ConfigExperimentalHookFileEdited ¶
type ConfigExperimentalHookFileEdited struct { Command []string `json:"command,required"` Environment map[string]string `json:"environment"` JSON configExperimentalHookFileEditedJSON `json:"-"` }
func (*ConfigExperimentalHookFileEdited) UnmarshalJSON ¶
func (r *ConfigExperimentalHookFileEdited) UnmarshalJSON(data []byte) (err error)
type ConfigExperimentalHookSessionCompleted ¶
type ConfigExperimentalHookSessionCompleted struct { Command []string `json:"command,required"` Environment map[string]string `json:"environment"` JSON configExperimentalHookSessionCompletedJSON `json:"-"` }
func (*ConfigExperimentalHookSessionCompleted) UnmarshalJSON ¶
func (r *ConfigExperimentalHookSessionCompleted) UnmarshalJSON(data []byte) (err error)
type ConfigMcp ¶
type ConfigMcp struct { // Type of MCP server connection Type ConfigMcpType `json:"type,required"` // This field can have the runtime type of [[]string]. Command interface{} `json:"command"` // Enable or disable the MCP server on startup Enabled bool `json:"enabled"` // This field can have the runtime type of [map[string]string]. Environment interface{} `json:"environment"` // URL of the remote MCP server URL string `json:"url"` JSON configMcpJSON `json:"-"` // contains filtered or unexported fields }
func (ConfigMcp) AsUnion ¶
func (r ConfigMcp) AsUnion() ConfigMcpUnion
AsUnion returns a ConfigMcpUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are McpLocal, McpRemote.
func (*ConfigMcp) UnmarshalJSON ¶
type ConfigMcpType ¶
type ConfigMcpType string
Type of MCP server connection
const ( ConfigMcpTypeLocal ConfigMcpType = "local" ConfigMcpTypeRemote ConfigMcpType = "remote" )
func (ConfigMcpType) IsKnown ¶
func (r ConfigMcpType) IsKnown() bool
type ConfigMcpUnion ¶
type ConfigMcpUnion interface {
// contains filtered or unexported methods
}
type ConfigProvider ¶
type ConfigProvider struct { Models map[string]ConfigProviderModel `json:"models,required"` ID string `json:"id"` API string `json:"api"` Env []string `json:"env"` Name string `json:"name"` Npm string `json:"npm"` Options map[string]interface{} `json:"options"` JSON configProviderJSON `json:"-"` }
func (*ConfigProvider) UnmarshalJSON ¶
func (r *ConfigProvider) UnmarshalJSON(data []byte) (err error)
type ConfigProviderModel ¶
type ConfigProviderModel struct { ID string `json:"id"` Attachment bool `json:"attachment"` Cost ConfigProviderModelsCost `json:"cost"` Limit ConfigProviderModelsLimit `json:"limit"` Name string `json:"name"` Options map[string]interface{} `json:"options"` Reasoning bool `json:"reasoning"` ReleaseDate string `json:"release_date"` Temperature bool `json:"temperature"` ToolCall bool `json:"tool_call"` JSON configProviderModelJSON `json:"-"` }
func (*ConfigProviderModel) UnmarshalJSON ¶
func (r *ConfigProviderModel) UnmarshalJSON(data []byte) (err error)
type ConfigProviderModelsCost ¶
type ConfigProviderModelsCost struct { Input float64 `json:"input,required"` Output float64 `json:"output,required"` CacheRead float64 `json:"cache_read"` CacheWrite float64 `json:"cache_write"` JSON configProviderModelsCostJSON `json:"-"` }
func (*ConfigProviderModelsCost) UnmarshalJSON ¶
func (r *ConfigProviderModelsCost) UnmarshalJSON(data []byte) (err error)
type ConfigProviderModelsLimit ¶
type ConfigProviderModelsLimit struct { Context float64 `json:"context,required"` Output float64 `json:"output,required"` JSON configProviderModelsLimitJSON `json:"-"` }
func (*ConfigProviderModelsLimit) UnmarshalJSON ¶
func (r *ConfigProviderModelsLimit) UnmarshalJSON(data []byte) (err error)
type ConfigProvidersResponse ¶
type ConfigProvidersResponse struct { Default map[string]string `json:"default,required"` Providers []Provider `json:"providers,required"` JSON configProvidersResponseJSON `json:"-"` }
func (*ConfigProvidersResponse) UnmarshalJSON ¶
func (r *ConfigProvidersResponse) UnmarshalJSON(data []byte) (err error)
type ConfigService ¶
type ConfigService struct {
Options []option.RequestOption
}
ConfigService contains methods and other services that help with interacting with the opencode 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 NewConfigService method instead.
func NewConfigService ¶
func NewConfigService(opts ...option.RequestOption) (r *ConfigService)
NewConfigService 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 (*ConfigService) Get ¶
func (r *ConfigService) Get(ctx context.Context, opts ...option.RequestOption) (res *Config, err error)
Get config info
func (*ConfigService) Providers ¶
func (r *ConfigService) Providers(ctx context.Context, opts ...option.RequestOption) (res *ConfigProvidersResponse, err error)
List all providers
type EventListResponse ¶
type EventListResponse struct { // This field can have the runtime type of // [EventListResponseEventLspClientDiagnosticsProperties], // [EventListResponseEventPermissionUpdatedProperties], // [EventListResponseEventFileEditedProperties], // [EventListResponseEventInstallationUpdatedProperties], // [EventListResponseEventStorageWriteProperties], // [EventListResponseEventMessageUpdatedProperties], // [EventListResponseEventMessageRemovedProperties], // [EventListResponseEventMessagePartUpdatedProperties], // [EventListResponseEventSessionUpdatedProperties], // [EventListResponseEventSessionDeletedProperties], // [EventListResponseEventSessionIdleProperties], // [EventListResponseEventSessionErrorProperties], // [EventListResponseEventFileWatcherUpdatedProperties]. Properties interface{} `json:"properties,required"` Type EventListResponseType `json:"type,required"` JSON eventListResponseJSON `json:"-"` // contains filtered or unexported fields }
func (EventListResponse) AsUnion ¶
func (r EventListResponse) AsUnion() EventListResponseUnion
AsUnion returns a EventListResponseUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are EventListResponseEventLspClientDiagnostics, EventListResponseEventPermissionUpdated, EventListResponseEventFileEdited, EventListResponseEventInstallationUpdated, EventListResponseEventStorageWrite, EventListResponseEventMessageUpdated, EventListResponseEventMessageRemoved, EventListResponseEventMessagePartUpdated, EventListResponseEventSessionUpdated, EventListResponseEventSessionDeleted, EventListResponseEventSessionIdle, EventListResponseEventSessionError, EventListResponseEventFileWatcherUpdated.
func (*EventListResponse) UnmarshalJSON ¶
func (r *EventListResponse) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileEdited ¶
type EventListResponseEventFileEdited struct { Properties EventListResponseEventFileEditedProperties `json:"properties,required"` Type EventListResponseEventFileEditedType `json:"type,required"` JSON eventListResponseEventFileEditedJSON `json:"-"` }
func (*EventListResponseEventFileEdited) UnmarshalJSON ¶
func (r *EventListResponseEventFileEdited) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileEditedProperties ¶
type EventListResponseEventFileEditedProperties struct { File string `json:"file,required"` JSON eventListResponseEventFileEditedPropertiesJSON `json:"-"` }
func (*EventListResponseEventFileEditedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventFileEditedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileEditedType ¶
type EventListResponseEventFileEditedType string
const (
EventListResponseEventFileEditedTypeFileEdited EventListResponseEventFileEditedType = "file.edited"
)
func (EventListResponseEventFileEditedType) IsKnown ¶
func (r EventListResponseEventFileEditedType) IsKnown() bool
type EventListResponseEventFileWatcherUpdated ¶
type EventListResponseEventFileWatcherUpdated struct { Properties EventListResponseEventFileWatcherUpdatedProperties `json:"properties,required"` Type EventListResponseEventFileWatcherUpdatedType `json:"type,required"` JSON eventListResponseEventFileWatcherUpdatedJSON `json:"-"` }
func (*EventListResponseEventFileWatcherUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventFileWatcherUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileWatcherUpdatedProperties ¶
type EventListResponseEventFileWatcherUpdatedProperties struct { Event EventListResponseEventFileWatcherUpdatedPropertiesEvent `json:"event,required"` File string `json:"file,required"` JSON eventListResponseEventFileWatcherUpdatedPropertiesJSON `json:"-"` }
func (*EventListResponseEventFileWatcherUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventFileWatcherUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventFileWatcherUpdatedPropertiesEvent ¶
type EventListResponseEventFileWatcherUpdatedPropertiesEvent string
const ( EventListResponseEventFileWatcherUpdatedPropertiesEventRename EventListResponseEventFileWatcherUpdatedPropertiesEvent = "rename" EventListResponseEventFileWatcherUpdatedPropertiesEventChange EventListResponseEventFileWatcherUpdatedPropertiesEvent = "change" )
func (EventListResponseEventFileWatcherUpdatedPropertiesEvent) IsKnown ¶
func (r EventListResponseEventFileWatcherUpdatedPropertiesEvent) IsKnown() bool
type EventListResponseEventFileWatcherUpdatedType ¶
type EventListResponseEventFileWatcherUpdatedType string
const (
EventListResponseEventFileWatcherUpdatedTypeFileWatcherUpdated EventListResponseEventFileWatcherUpdatedType = "file.watcher.updated"
)
func (EventListResponseEventFileWatcherUpdatedType) IsKnown ¶
func (r EventListResponseEventFileWatcherUpdatedType) IsKnown() bool
type EventListResponseEventInstallationUpdated ¶
type EventListResponseEventInstallationUpdated struct { Properties EventListResponseEventInstallationUpdatedProperties `json:"properties,required"` Type EventListResponseEventInstallationUpdatedType `json:"type,required"` JSON eventListResponseEventInstallationUpdatedJSON `json:"-"` }
func (*EventListResponseEventInstallationUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventInstallationUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventInstallationUpdatedProperties ¶
type EventListResponseEventInstallationUpdatedProperties struct { Version string `json:"version,required"` JSON eventListResponseEventInstallationUpdatedPropertiesJSON `json:"-"` }
func (*EventListResponseEventInstallationUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventInstallationUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventInstallationUpdatedType ¶
type EventListResponseEventInstallationUpdatedType string
const (
EventListResponseEventInstallationUpdatedTypeInstallationUpdated EventListResponseEventInstallationUpdatedType = "installation.updated"
)
func (EventListResponseEventInstallationUpdatedType) IsKnown ¶
func (r EventListResponseEventInstallationUpdatedType) IsKnown() bool
type EventListResponseEventLspClientDiagnostics ¶
type EventListResponseEventLspClientDiagnostics struct { Properties EventListResponseEventLspClientDiagnosticsProperties `json:"properties,required"` Type EventListResponseEventLspClientDiagnosticsType `json:"type,required"` JSON eventListResponseEventLspClientDiagnosticsJSON `json:"-"` }
func (*EventListResponseEventLspClientDiagnostics) UnmarshalJSON ¶
func (r *EventListResponseEventLspClientDiagnostics) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventLspClientDiagnosticsProperties ¶
type EventListResponseEventLspClientDiagnosticsProperties struct { Path string `json:"path,required"` ServerID string `json:"serverID,required"` JSON eventListResponseEventLspClientDiagnosticsPropertiesJSON `json:"-"` }
func (*EventListResponseEventLspClientDiagnosticsProperties) UnmarshalJSON ¶
func (r *EventListResponseEventLspClientDiagnosticsProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventLspClientDiagnosticsType ¶
type EventListResponseEventLspClientDiagnosticsType string
const (
EventListResponseEventLspClientDiagnosticsTypeLspClientDiagnostics EventListResponseEventLspClientDiagnosticsType = "lsp.client.diagnostics"
)
func (EventListResponseEventLspClientDiagnosticsType) IsKnown ¶
func (r EventListResponseEventLspClientDiagnosticsType) IsKnown() bool
type EventListResponseEventMessagePartUpdated ¶
type EventListResponseEventMessagePartUpdated struct { Properties EventListResponseEventMessagePartUpdatedProperties `json:"properties,required"` Type EventListResponseEventMessagePartUpdatedType `json:"type,required"` JSON eventListResponseEventMessagePartUpdatedJSON `json:"-"` }
func (*EventListResponseEventMessagePartUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventMessagePartUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessagePartUpdatedProperties ¶
type EventListResponseEventMessagePartUpdatedProperties struct { MessageID string `json:"messageID,required"` Part AssistantMessagePart `json:"part,required"` SessionID string `json:"sessionID,required"` JSON eventListResponseEventMessagePartUpdatedPropertiesJSON `json:"-"` }
func (*EventListResponseEventMessagePartUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventMessagePartUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessagePartUpdatedType ¶
type EventListResponseEventMessagePartUpdatedType string
const (
EventListResponseEventMessagePartUpdatedTypeMessagePartUpdated EventListResponseEventMessagePartUpdatedType = "message.part.updated"
)
func (EventListResponseEventMessagePartUpdatedType) IsKnown ¶
func (r EventListResponseEventMessagePartUpdatedType) IsKnown() bool
type EventListResponseEventMessageRemoved ¶
type EventListResponseEventMessageRemoved struct { Properties EventListResponseEventMessageRemovedProperties `json:"properties,required"` Type EventListResponseEventMessageRemovedType `json:"type,required"` JSON eventListResponseEventMessageRemovedJSON `json:"-"` }
func (*EventListResponseEventMessageRemoved) UnmarshalJSON ¶
func (r *EventListResponseEventMessageRemoved) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessageRemovedProperties ¶
type EventListResponseEventMessageRemovedProperties struct { MessageID string `json:"messageID,required"` SessionID string `json:"sessionID,required"` JSON eventListResponseEventMessageRemovedPropertiesJSON `json:"-"` }
func (*EventListResponseEventMessageRemovedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventMessageRemovedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessageRemovedType ¶
type EventListResponseEventMessageRemovedType string
const (
EventListResponseEventMessageRemovedTypeMessageRemoved EventListResponseEventMessageRemovedType = "message.removed"
)
func (EventListResponseEventMessageRemovedType) IsKnown ¶
func (r EventListResponseEventMessageRemovedType) IsKnown() bool
type EventListResponseEventMessageUpdated ¶
type EventListResponseEventMessageUpdated struct { Properties EventListResponseEventMessageUpdatedProperties `json:"properties,required"` Type EventListResponseEventMessageUpdatedType `json:"type,required"` JSON eventListResponseEventMessageUpdatedJSON `json:"-"` }
func (*EventListResponseEventMessageUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventMessageUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessageUpdatedProperties ¶
type EventListResponseEventMessageUpdatedProperties struct { Info Message `json:"info,required"` JSON eventListResponseEventMessageUpdatedPropertiesJSON `json:"-"` }
func (*EventListResponseEventMessageUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventMessageUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventMessageUpdatedType ¶
type EventListResponseEventMessageUpdatedType string
const (
EventListResponseEventMessageUpdatedTypeMessageUpdated EventListResponseEventMessageUpdatedType = "message.updated"
)
func (EventListResponseEventMessageUpdatedType) IsKnown ¶
func (r EventListResponseEventMessageUpdatedType) IsKnown() bool
type EventListResponseEventPermissionUpdated ¶
type EventListResponseEventPermissionUpdated struct { Properties EventListResponseEventPermissionUpdatedProperties `json:"properties,required"` Type EventListResponseEventPermissionUpdatedType `json:"type,required"` JSON eventListResponseEventPermissionUpdatedJSON `json:"-"` }
func (*EventListResponseEventPermissionUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventPermissionUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventPermissionUpdatedProperties ¶
type EventListResponseEventPermissionUpdatedProperties struct { ID string `json:"id,required"` Metadata map[string]interface{} `json:"metadata,required"` SessionID string `json:"sessionID,required"` Time EventListResponseEventPermissionUpdatedPropertiesTime `json:"time,required"` Title string `json:"title,required"` JSON eventListResponseEventPermissionUpdatedPropertiesJSON `json:"-"` }
func (*EventListResponseEventPermissionUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventPermissionUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventPermissionUpdatedPropertiesTime ¶
type EventListResponseEventPermissionUpdatedPropertiesTime struct { Created float64 `json:"created,required"` JSON eventListResponseEventPermissionUpdatedPropertiesTimeJSON `json:"-"` }
func (*EventListResponseEventPermissionUpdatedPropertiesTime) UnmarshalJSON ¶
func (r *EventListResponseEventPermissionUpdatedPropertiesTime) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventPermissionUpdatedType ¶
type EventListResponseEventPermissionUpdatedType string
const (
EventListResponseEventPermissionUpdatedTypePermissionUpdated EventListResponseEventPermissionUpdatedType = "permission.updated"
)
func (EventListResponseEventPermissionUpdatedType) IsKnown ¶
func (r EventListResponseEventPermissionUpdatedType) IsKnown() bool
type EventListResponseEventSessionDeleted ¶
type EventListResponseEventSessionDeleted struct { Properties EventListResponseEventSessionDeletedProperties `json:"properties,required"` Type EventListResponseEventSessionDeletedType `json:"type,required"` JSON eventListResponseEventSessionDeletedJSON `json:"-"` }
func (*EventListResponseEventSessionDeleted) UnmarshalJSON ¶
func (r *EventListResponseEventSessionDeleted) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionDeletedProperties ¶
type EventListResponseEventSessionDeletedProperties struct { Info Session `json:"info,required"` JSON eventListResponseEventSessionDeletedPropertiesJSON `json:"-"` }
func (*EventListResponseEventSessionDeletedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventSessionDeletedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionDeletedType ¶
type EventListResponseEventSessionDeletedType string
const (
EventListResponseEventSessionDeletedTypeSessionDeleted EventListResponseEventSessionDeletedType = "session.deleted"
)
func (EventListResponseEventSessionDeletedType) IsKnown ¶
func (r EventListResponseEventSessionDeletedType) IsKnown() bool
type EventListResponseEventSessionError ¶
type EventListResponseEventSessionError struct { Properties EventListResponseEventSessionErrorProperties `json:"properties,required"` Type EventListResponseEventSessionErrorType `json:"type,required"` JSON eventListResponseEventSessionErrorJSON `json:"-"` }
func (*EventListResponseEventSessionError) UnmarshalJSON ¶
func (r *EventListResponseEventSessionError) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionErrorProperties ¶
type EventListResponseEventSessionErrorProperties struct { Error EventListResponseEventSessionErrorPropertiesError `json:"error"` JSON eventListResponseEventSessionErrorPropertiesJSON `json:"-"` }
func (*EventListResponseEventSessionErrorProperties) UnmarshalJSON ¶
func (r *EventListResponseEventSessionErrorProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionErrorPropertiesError ¶
type EventListResponseEventSessionErrorPropertiesError struct { // This field can have the runtime type of [shared.ProviderAuthErrorData], // [shared.UnknownErrorData], [interface{}]. Data interface{} `json:"data,required"` Name EventListResponseEventSessionErrorPropertiesErrorName `json:"name,required"` JSON eventListResponseEventSessionErrorPropertiesErrorJSON `json:"-"` // contains filtered or unexported fields }
func (EventListResponseEventSessionErrorPropertiesError) AsUnion ¶
func (r EventListResponseEventSessionErrorPropertiesError) AsUnion() EventListResponseEventSessionErrorPropertiesErrorUnion
AsUnion returns a EventListResponseEventSessionErrorPropertiesErrorUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are shared.ProviderAuthError, shared.UnknownError, EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError.
func (*EventListResponseEventSessionErrorPropertiesError) UnmarshalJSON ¶
func (r *EventListResponseEventSessionErrorPropertiesError) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError ¶
type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError struct { Data interface{} `json:"data,required"` Name EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName `json:"name,required"` JSON eventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorJSON `json:"-"` }
func (EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) ImplementsEventListResponseEventSessionErrorPropertiesError ¶
func (r EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) ImplementsEventListResponseEventSessionErrorPropertiesError()
func (*EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) UnmarshalJSON ¶
func (r *EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName ¶
type EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName string
const (
EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorNameMessageOutputLengthError EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthErrorName = "MessageOutputLengthError"
)
type EventListResponseEventSessionErrorPropertiesErrorName ¶
type EventListResponseEventSessionErrorPropertiesErrorName string
const ( EventListResponseEventSessionErrorPropertiesErrorNameProviderAuthError EventListResponseEventSessionErrorPropertiesErrorName = "ProviderAuthError" EventListResponseEventSessionErrorPropertiesErrorNameUnknownError EventListResponseEventSessionErrorPropertiesErrorName = "UnknownError" EventListResponseEventSessionErrorPropertiesErrorNameMessageOutputLengthError EventListResponseEventSessionErrorPropertiesErrorName = "MessageOutputLengthError" )
func (EventListResponseEventSessionErrorPropertiesErrorName) IsKnown ¶
func (r EventListResponseEventSessionErrorPropertiesErrorName) IsKnown() bool
type EventListResponseEventSessionErrorPropertiesErrorUnion ¶
type EventListResponseEventSessionErrorPropertiesErrorUnion interface {
ImplementsEventListResponseEventSessionErrorPropertiesError()
}
Union satisfied by shared.ProviderAuthError, shared.UnknownError or EventListResponseEventSessionErrorPropertiesErrorMessageOutputLengthError.
type EventListResponseEventSessionErrorType ¶
type EventListResponseEventSessionErrorType string
const (
EventListResponseEventSessionErrorTypeSessionError EventListResponseEventSessionErrorType = "session.error"
)
func (EventListResponseEventSessionErrorType) IsKnown ¶
func (r EventListResponseEventSessionErrorType) IsKnown() bool
type EventListResponseEventSessionIdle ¶
type EventListResponseEventSessionIdle struct { Properties EventListResponseEventSessionIdleProperties `json:"properties,required"` Type EventListResponseEventSessionIdleType `json:"type,required"` JSON eventListResponseEventSessionIdleJSON `json:"-"` }
func (*EventListResponseEventSessionIdle) UnmarshalJSON ¶
func (r *EventListResponseEventSessionIdle) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionIdleProperties ¶
type EventListResponseEventSessionIdleProperties struct { SessionID string `json:"sessionID,required"` JSON eventListResponseEventSessionIdlePropertiesJSON `json:"-"` }
func (*EventListResponseEventSessionIdleProperties) UnmarshalJSON ¶
func (r *EventListResponseEventSessionIdleProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionIdleType ¶
type EventListResponseEventSessionIdleType string
const (
EventListResponseEventSessionIdleTypeSessionIdle EventListResponseEventSessionIdleType = "session.idle"
)
func (EventListResponseEventSessionIdleType) IsKnown ¶
func (r EventListResponseEventSessionIdleType) IsKnown() bool
type EventListResponseEventSessionUpdated ¶
type EventListResponseEventSessionUpdated struct { Properties EventListResponseEventSessionUpdatedProperties `json:"properties,required"` Type EventListResponseEventSessionUpdatedType `json:"type,required"` JSON eventListResponseEventSessionUpdatedJSON `json:"-"` }
func (*EventListResponseEventSessionUpdated) UnmarshalJSON ¶
func (r *EventListResponseEventSessionUpdated) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionUpdatedProperties ¶
type EventListResponseEventSessionUpdatedProperties struct { Info Session `json:"info,required"` JSON eventListResponseEventSessionUpdatedPropertiesJSON `json:"-"` }
func (*EventListResponseEventSessionUpdatedProperties) UnmarshalJSON ¶
func (r *EventListResponseEventSessionUpdatedProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventSessionUpdatedType ¶
type EventListResponseEventSessionUpdatedType string
const (
EventListResponseEventSessionUpdatedTypeSessionUpdated EventListResponseEventSessionUpdatedType = "session.updated"
)
func (EventListResponseEventSessionUpdatedType) IsKnown ¶
func (r EventListResponseEventSessionUpdatedType) IsKnown() bool
type EventListResponseEventStorageWrite ¶
type EventListResponseEventStorageWrite struct { Properties EventListResponseEventStorageWriteProperties `json:"properties,required"` Type EventListResponseEventStorageWriteType `json:"type,required"` JSON eventListResponseEventStorageWriteJSON `json:"-"` }
func (*EventListResponseEventStorageWrite) UnmarshalJSON ¶
func (r *EventListResponseEventStorageWrite) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventStorageWriteProperties ¶
type EventListResponseEventStorageWriteProperties struct { Key string `json:"key,required"` Content interface{} `json:"content"` JSON eventListResponseEventStorageWritePropertiesJSON `json:"-"` }
func (*EventListResponseEventStorageWriteProperties) UnmarshalJSON ¶
func (r *EventListResponseEventStorageWriteProperties) UnmarshalJSON(data []byte) (err error)
type EventListResponseEventStorageWriteType ¶
type EventListResponseEventStorageWriteType string
const (
EventListResponseEventStorageWriteTypeStorageWrite EventListResponseEventStorageWriteType = "storage.write"
)
func (EventListResponseEventStorageWriteType) IsKnown ¶
func (r EventListResponseEventStorageWriteType) IsKnown() bool
type EventListResponseType ¶
type EventListResponseType string
const ( EventListResponseTypeLspClientDiagnostics EventListResponseType = "lsp.client.diagnostics" EventListResponseTypePermissionUpdated EventListResponseType = "permission.updated" EventListResponseTypeFileEdited EventListResponseType = "file.edited" EventListResponseTypeInstallationUpdated EventListResponseType = "installation.updated" EventListResponseTypeStorageWrite EventListResponseType = "storage.write" EventListResponseTypeMessageUpdated EventListResponseType = "message.updated" EventListResponseTypeMessageRemoved EventListResponseType = "message.removed" EventListResponseTypeMessagePartUpdated EventListResponseType = "message.part.updated" EventListResponseTypeSessionUpdated EventListResponseType = "session.updated" EventListResponseTypeSessionDeleted EventListResponseType = "session.deleted" EventListResponseTypeSessionIdle EventListResponseType = "session.idle" EventListResponseTypeSessionError EventListResponseType = "session.error" EventListResponseTypeFileWatcherUpdated EventListResponseType = "file.watcher.updated" )
func (EventListResponseType) IsKnown ¶
func (r EventListResponseType) IsKnown() bool
type EventListResponseUnion ¶
type EventListResponseUnion interface {
// contains filtered or unexported methods
}
Union satisfied by EventListResponseEventLspClientDiagnostics, EventListResponseEventPermissionUpdated, EventListResponseEventFileEdited, EventListResponseEventInstallationUpdated, EventListResponseEventStorageWrite, EventListResponseEventMessageUpdated, EventListResponseEventMessageRemoved, EventListResponseEventMessagePartUpdated, EventListResponseEventSessionUpdated, EventListResponseEventSessionDeleted, EventListResponseEventSessionIdle, EventListResponseEventSessionError or EventListResponseEventFileWatcherUpdated.
type EventService ¶
type EventService struct {
Options []option.RequestOption
}
EventService contains methods and other services that help with interacting with the opencode 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 NewEventService method instead.
func NewEventService ¶
func NewEventService(opts ...option.RequestOption) (r *EventService)
NewEventService 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 (*EventService) ListStreaming ¶
func (r *EventService) ListStreaming(ctx context.Context, opts ...option.RequestOption) (stream *ssestream.Stream[EventListResponse])
Get events
type FilePart ¶
type FilePart struct { Mime string `json:"mime,required"` Type FilePartType `json:"type,required"` URL string `json:"url,required"` Filename string `json:"filename"` JSON filePartJSON `json:"-"` }
func (*FilePart) UnmarshalJSON ¶
type FilePartParam ¶
type FilePartParam struct { Mime param.Field[string] `json:"mime,required"` Type param.Field[FilePartType] `json:"type,required"` URL param.Field[string] `json:"url,required"` Filename param.Field[string] `json:"filename"` }
func (FilePartParam) MarshalJSON ¶
func (r FilePartParam) MarshalJSON() (data []byte, err error)
type FilePartType ¶
type FilePartType string
const (
FilePartTypeFile FilePartType = "file"
)
func (FilePartType) IsKnown ¶
func (r FilePartType) IsKnown() bool
type FileReadParams ¶
func (FileReadParams) URLQuery ¶
func (r FileReadParams) URLQuery() (v url.Values)
URLQuery serializes FileReadParams's query parameters as `url.Values`.
type FileReadResponse ¶
type FileReadResponse struct { Content string `json:"content,required"` Type FileReadResponseType `json:"type,required"` JSON fileReadResponseJSON `json:"-"` }
func (*FileReadResponse) UnmarshalJSON ¶
func (r *FileReadResponse) UnmarshalJSON(data []byte) (err error)
type FileReadResponseType ¶
type FileReadResponseType string
const ( FileReadResponseTypeRaw FileReadResponseType = "raw" FileReadResponseTypePatch FileReadResponseType = "patch" )
func (FileReadResponseType) IsKnown ¶
func (r FileReadResponseType) IsKnown() bool
type FileService ¶
type FileService struct {
Options []option.RequestOption
}
FileService contains methods and other services that help with interacting with the opencode 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 NewFileService method instead.
func NewFileService ¶
func NewFileService(opts ...option.RequestOption) (r *FileService)
NewFileService 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 (*FileService) Read ¶
func (r *FileService) Read(ctx context.Context, query FileReadParams, opts ...option.RequestOption) (res *FileReadResponse, err error)
Read a file
func (*FileService) Status ¶
func (r *FileService) Status(ctx context.Context, opts ...option.RequestOption) (res *[]FileStatusResponse, err error)
Get file status
type FileStatusResponse ¶
type FileStatusResponse struct { Added int64 `json:"added,required"` File string `json:"file,required"` Removed int64 `json:"removed,required"` Status FileStatusResponseStatus `json:"status,required"` JSON fileStatusResponseJSON `json:"-"` }
func (*FileStatusResponse) UnmarshalJSON ¶
func (r *FileStatusResponse) UnmarshalJSON(data []byte) (err error)
type FileStatusResponseStatus ¶
type FileStatusResponseStatus string
const ( FileStatusResponseStatusAdded FileStatusResponseStatus = "added" FileStatusResponseStatusDeleted FileStatusResponseStatus = "deleted" FileStatusResponseStatusModified FileStatusResponseStatus = "modified" )
func (FileStatusResponseStatus) IsKnown ¶
func (r FileStatusResponseStatus) IsKnown() bool
type FindFilesParams ¶
func (FindFilesParams) URLQuery ¶
func (r FindFilesParams) URLQuery() (v url.Values)
URLQuery serializes FindFilesParams's query parameters as `url.Values`.
type FindService ¶
type FindService struct {
Options []option.RequestOption
}
FindService contains methods and other services that help with interacting with the opencode 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 NewFindService method instead.
func NewFindService ¶
func NewFindService(opts ...option.RequestOption) (r *FindService)
NewFindService 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 (*FindService) Files ¶
func (r *FindService) Files(ctx context.Context, query FindFilesParams, opts ...option.RequestOption) (res *[]string, err error)
Find files
func (*FindService) Symbols ¶
func (r *FindService) Symbols(ctx context.Context, query FindSymbolsParams, opts ...option.RequestOption) (res *[]FindSymbolsResponse, err error)
Find workspace symbols
func (*FindService) Text ¶
func (r *FindService) Text(ctx context.Context, query FindTextParams, opts ...option.RequestOption) (res *[]FindTextResponse, err error)
Find text in files
type FindSymbolsParams ¶
func (FindSymbolsParams) URLQuery ¶
func (r FindSymbolsParams) URLQuery() (v url.Values)
URLQuery serializes FindSymbolsParams's query parameters as `url.Values`.
type FindSymbolsResponse ¶
type FindSymbolsResponse = interface{}
type FindTextParams ¶
func (FindTextParams) URLQuery ¶
func (r FindTextParams) URLQuery() (v url.Values)
URLQuery serializes FindTextParams's query parameters as `url.Values`.
type FindTextResponse ¶
type FindTextResponse struct { AbsoluteOffset float64 `json:"absolute_offset,required"` LineNumber float64 `json:"line_number,required"` Lines FindTextResponseLines `json:"lines,required"` Path FindTextResponsePath `json:"path,required"` Submatches []FindTextResponseSubmatch `json:"submatches,required"` JSON findTextResponseJSON `json:"-"` }
func (*FindTextResponse) UnmarshalJSON ¶
func (r *FindTextResponse) UnmarshalJSON(data []byte) (err error)
type FindTextResponseLines ¶
type FindTextResponseLines struct { Text string `json:"text,required"` JSON findTextResponseLinesJSON `json:"-"` }
func (*FindTextResponseLines) UnmarshalJSON ¶
func (r *FindTextResponseLines) UnmarshalJSON(data []byte) (err error)
type FindTextResponsePath ¶
type FindTextResponsePath struct { Text string `json:"text,required"` JSON findTextResponsePathJSON `json:"-"` }
func (*FindTextResponsePath) UnmarshalJSON ¶
func (r *FindTextResponsePath) UnmarshalJSON(data []byte) (err error)
type FindTextResponseSubmatch ¶
type FindTextResponseSubmatch struct { End float64 `json:"end,required"` Match FindTextResponseSubmatchesMatch `json:"match,required"` Start float64 `json:"start,required"` JSON findTextResponseSubmatchJSON `json:"-"` }
func (*FindTextResponseSubmatch) UnmarshalJSON ¶
func (r *FindTextResponseSubmatch) UnmarshalJSON(data []byte) (err error)
type FindTextResponseSubmatchesMatch ¶
type FindTextResponseSubmatchesMatch struct { Text string `json:"text,required"` JSON findTextResponseSubmatchesMatchJSON `json:"-"` }
func (*FindTextResponseSubmatchesMatch) UnmarshalJSON ¶
func (r *FindTextResponseSubmatchesMatch) UnmarshalJSON(data []byte) (err error)
type Keybinds ¶
type Keybinds struct { // Exit the application AppExit string `json:"app_exit"` // Open external editor EditorOpen string `json:"editor_open"` // Show help dialog Help string `json:"help"` // Navigate to next history item HistoryNext string `json:"history_next"` // Navigate to previous history item HistoryPrevious string `json:"history_previous"` // Clear input field InputClear string `json:"input_clear"` // Insert newline in input InputNewline string `json:"input_newline"` // Paste from clipboard InputPaste string `json:"input_paste"` // Submit input InputSubmit string `json:"input_submit"` // Leader key for keybind combinations Leader string `json:"leader"` // Navigate to first message MessagesFirst string `json:"messages_first"` // Scroll messages down by half page MessagesHalfPageDown string `json:"messages_half_page_down"` // Scroll messages up by half page MessagesHalfPageUp string `json:"messages_half_page_up"` // Navigate to last message MessagesLast string `json:"messages_last"` // Navigate to next message MessagesNext string `json:"messages_next"` // Scroll messages down by one page MessagesPageDown string `json:"messages_page_down"` // Scroll messages up by one page MessagesPageUp string `json:"messages_page_up"` // Navigate to previous message MessagesPrevious string `json:"messages_previous"` // List available models ModelList string `json:"model_list"` // Initialize project configuration ProjectInit string `json:"project_init"` // Toggle compact mode for session SessionCompact string `json:"session_compact"` // Interrupt current session SessionInterrupt string `json:"session_interrupt"` // List all sessions SessionList string `json:"session_list"` // Create a new session SessionNew string `json:"session_new"` SessionShare string `json:"session_share"` // List available themes ThemeList string `json:"theme_list"` // Show tool details ToolDetails string `json:"tool_details"` JSON keybindsJSON `json:"-"` }
func (*Keybinds) UnmarshalJSON ¶
type McpLocal ¶
type McpLocal struct { // Command and arguments to run the MCP server Command []string `json:"command,required"` // Type of MCP server connection Type McpLocalType `json:"type,required"` // Enable or disable the MCP server on startup Enabled bool `json:"enabled"` // Environment variables to set when running the MCP server Environment map[string]string `json:"environment"` JSON mcpLocalJSON `json:"-"` }
func (*McpLocal) UnmarshalJSON ¶
type McpLocalType ¶
type McpLocalType string
Type of MCP server connection
const (
McpLocalTypeLocal McpLocalType = "local"
)
func (McpLocalType) IsKnown ¶
func (r McpLocalType) IsKnown() bool
type McpRemote ¶
type McpRemote struct { // Type of MCP server connection Type McpRemoteType `json:"type,required"` // URL of the remote MCP server URL string `json:"url,required"` // Enable or disable the MCP server on startup Enabled bool `json:"enabled"` JSON mcpRemoteJSON `json:"-"` }
func (*McpRemote) UnmarshalJSON ¶
type McpRemoteType ¶
type McpRemoteType string
Type of MCP server connection
const (
McpRemoteTypeRemote McpRemoteType = "remote"
)
func (McpRemoteType) IsKnown ¶
func (r McpRemoteType) IsKnown() bool
type Message ¶
type Message struct { ID string `json:"id,required"` // This field can have the runtime type of [[]UserMessagePart], // [[]AssistantMessagePart]. Parts interface{} `json:"parts,required"` Role MessageRole `json:"role,required"` SessionID string `json:"sessionID,required"` // This field can have the runtime type of [MessageUserMessageTime], // [AssistantMessageTime]. Time interface{} `json:"time,required"` Cost float64 `json:"cost"` // This field can have the runtime type of [AssistantMessageError]. Error interface{} `json:"error"` ModelID string `json:"modelID"` // This field can have the runtime type of [AssistantMessagePath]. Path interface{} `json:"path"` ProviderID string `json:"providerID"` Summary bool `json:"summary"` // This field can have the runtime type of [[]string]. System interface{} `json:"system"` // This field can have the runtime type of [AssistantMessageTokens]. Tokens interface{} `json:"tokens"` JSON messageJSON `json:"-"` // contains filtered or unexported fields }
func (Message) AsUnion ¶
func (r Message) AsUnion() MessageUnion
AsUnion returns a MessageUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are MessageUserMessage, AssistantMessage.
func (*Message) UnmarshalJSON ¶
type MessageRole ¶
type MessageRole string
const ( MessageRoleUser MessageRole = "user" MessageRoleAssistant MessageRole = "assistant" )
func (MessageRole) IsKnown ¶
func (r MessageRole) IsKnown() bool
type MessageUnion ¶
type MessageUnion interface {
// contains filtered or unexported methods
}
Union satisfied by MessageUserMessage or AssistantMessage.
type MessageUserMessage ¶
type MessageUserMessage struct { ID string `json:"id,required"` Parts []UserMessagePart `json:"parts,required"` Role MessageUserMessageRole `json:"role,required"` SessionID string `json:"sessionID,required"` Time MessageUserMessageTime `json:"time,required"` JSON messageUserMessageJSON `json:"-"` }
func (*MessageUserMessage) UnmarshalJSON ¶
func (r *MessageUserMessage) UnmarshalJSON(data []byte) (err error)
type MessageUserMessageRole ¶
type MessageUserMessageRole string
const (
MessageUserMessageRoleUser MessageUserMessageRole = "user"
)
func (MessageUserMessageRole) IsKnown ¶
func (r MessageUserMessageRole) IsKnown() bool
type MessageUserMessageTime ¶
type MessageUserMessageTime struct { Created float64 `json:"created,required"` JSON messageUserMessageTimeJSON `json:"-"` }
func (*MessageUserMessageTime) UnmarshalJSON ¶
func (r *MessageUserMessageTime) UnmarshalJSON(data []byte) (err error)
type Model ¶
type Model struct { ID string `json:"id,required"` Attachment bool `json:"attachment,required"` Cost ModelCost `json:"cost,required"` Limit ModelLimit `json:"limit,required"` Name string `json:"name,required"` Options map[string]interface{} `json:"options,required"` Reasoning bool `json:"reasoning,required"` ReleaseDate string `json:"release_date,required"` Temperature bool `json:"temperature,required"` ToolCall bool `json:"tool_call,required"` JSON modelJSON `json:"-"` }
func (*Model) UnmarshalJSON ¶
type ModelCost ¶
type ModelCost struct { Input float64 `json:"input,required"` Output float64 `json:"output,required"` CacheRead float64 `json:"cache_read"` CacheWrite float64 `json:"cache_write"` JSON modelCostJSON `json:"-"` }
func (*ModelCost) UnmarshalJSON ¶
type ModelLimit ¶
type ModelLimit struct { Context float64 `json:"context,required"` Output float64 `json:"output,required"` JSON modelLimitJSON `json:"-"` }
func (*ModelLimit) UnmarshalJSON ¶
func (r *ModelLimit) UnmarshalJSON(data []byte) (err error)
type Provider ¶
type Provider struct { ID string `json:"id,required"` Env []string `json:"env,required"` Models map[string]Model `json:"models,required"` Name string `json:"name,required"` API string `json:"api"` Npm string `json:"npm"` JSON providerJSON `json:"-"` }
func (*Provider) UnmarshalJSON ¶
type ProviderAuthError ¶
type ProviderAuthError = shared.ProviderAuthError
This is an alias to an internal type.
type ProviderAuthErrorData ¶
type ProviderAuthErrorData = shared.ProviderAuthErrorData
This is an alias to an internal type.
type ProviderAuthErrorName ¶
type ProviderAuthErrorName = shared.ProviderAuthErrorName
This is an alias to an internal type.
type Session ¶
type Session struct { ID string `json:"id,required"` Time SessionTime `json:"time,required"` Title string `json:"title,required"` Version string `json:"version,required"` ParentID string `json:"parentID"` Revert SessionRevert `json:"revert"` JSON sessionJSON `json:"-"` }
func (*Session) UnmarshalJSON ¶
type SessionChatParams ¶
type SessionChatParams struct { ModelID param.Field[string] `json:"modelID,required"` Parts param.Field[[]UserMessagePartUnionParam] `json:"parts,required"` ProviderID param.Field[string] `json:"providerID,required"` }
func (SessionChatParams) MarshalJSON ¶
func (r SessionChatParams) MarshalJSON() (data []byte, err error)
type SessionInitParams ¶
type SessionInitParams struct { ModelID param.Field[string] `json:"modelID,required"` ProviderID param.Field[string] `json:"providerID,required"` }
func (SessionInitParams) MarshalJSON ¶
func (r SessionInitParams) MarshalJSON() (data []byte, err error)
type SessionRevert ¶
type SessionRevert struct { MessageID string `json:"messageID,required"` Part float64 `json:"part,required"` Snapshot string `json:"snapshot"` JSON sessionRevertJSON `json:"-"` }
func (*SessionRevert) UnmarshalJSON ¶
func (r *SessionRevert) UnmarshalJSON(data []byte) (err error)
type SessionService ¶
type SessionService struct {
Options []option.RequestOption
}
SessionService contains methods and other services that help with interacting with the opencode 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 NewSessionService method instead.
func NewSessionService ¶
func NewSessionService(opts ...option.RequestOption) (r *SessionService)
NewSessionService 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 (*SessionService) Abort ¶
func (r *SessionService) Abort(ctx context.Context, id string, opts ...option.RequestOption) (res *bool, err error)
Abort a session
func (*SessionService) Chat ¶
func (r *SessionService) Chat(ctx context.Context, id string, body SessionChatParams, opts ...option.RequestOption) (res *AssistantMessage, err error)
Create and send a new message to a session
func (*SessionService) Delete ¶
func (r *SessionService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (res *bool, err error)
Delete a session and all its data
func (*SessionService) Init ¶
func (r *SessionService) Init(ctx context.Context, id string, body SessionInitParams, opts ...option.RequestOption) (res *bool, err error)
Analyze the app and create an AGENTS.md file
func (*SessionService) List ¶
func (r *SessionService) List(ctx context.Context, opts ...option.RequestOption) (res *[]Session, err error)
List all sessions
func (*SessionService) Messages ¶
func (r *SessionService) Messages(ctx context.Context, id string, opts ...option.RequestOption) (res *[]Message, err error)
List messages for a session
func (*SessionService) New ¶
func (r *SessionService) New(ctx context.Context, opts ...option.RequestOption) (res *Session, err error)
Create a new session
func (*SessionService) Share ¶
func (r *SessionService) Share(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
Share a session
func (*SessionService) Summarize ¶
func (r *SessionService) Summarize(ctx context.Context, id string, body SessionSummarizeParams, opts ...option.RequestOption) (res *bool, err error)
Summarize the session
func (*SessionService) Unshare ¶
func (r *SessionService) Unshare(ctx context.Context, id string, opts ...option.RequestOption) (res *Session, err error)
Unshare the session
type SessionShare ¶
type SessionShare struct {}
func (*SessionShare) UnmarshalJSON ¶
func (r *SessionShare) UnmarshalJSON(data []byte) (err error)
type SessionSummarizeParams ¶
type SessionSummarizeParams struct { ModelID param.Field[string] `json:"modelID,required"` ProviderID param.Field[string] `json:"providerID,required"` }
func (SessionSummarizeParams) MarshalJSON ¶
func (r SessionSummarizeParams) MarshalJSON() (data []byte, err error)
type SessionTime ¶
type SessionTime struct { Created float64 `json:"created,required"` Updated float64 `json:"updated,required"` JSON sessionTimeJSON `json:"-"` }
func (*SessionTime) UnmarshalJSON ¶
func (r *SessionTime) UnmarshalJSON(data []byte) (err error)
type StepStartPart ¶
type StepStartPart struct { Type StepStartPartType `json:"type,required"` JSON stepStartPartJSON `json:"-"` }
func (*StepStartPart) UnmarshalJSON ¶
func (r *StepStartPart) UnmarshalJSON(data []byte) (err error)
type StepStartPartType ¶
type StepStartPartType string
const (
StepStartPartTypeStepStart StepStartPartType = "step-start"
)
func (StepStartPartType) IsKnown ¶
func (r StepStartPartType) IsKnown() bool
type TextPart ¶
type TextPart struct { Text string `json:"text,required"` Type TextPartType `json:"type,required"` JSON textPartJSON `json:"-"` }
func (*TextPart) UnmarshalJSON ¶
type TextPartParam ¶
type TextPartParam struct { Text param.Field[string] `json:"text,required"` Type param.Field[TextPartType] `json:"type,required"` }
func (TextPartParam) MarshalJSON ¶
func (r TextPartParam) MarshalJSON() (data []byte, err error)
type TextPartType ¶
type TextPartType string
const (
TextPartTypeText TextPartType = "text"
)
func (TextPartType) IsKnown ¶
func (r TextPartType) IsKnown() bool
type ToolPart ¶
type ToolPart struct { ID string `json:"id,required"` State ToolPartState `json:"state,required"` Tool string `json:"tool,required"` Type ToolPartType `json:"type,required"` JSON toolPartJSON `json:"-"` }
func (*ToolPart) UnmarshalJSON ¶
type ToolPartState ¶
type ToolPartState struct { Status ToolPartStateStatus `json:"status,required"` Error string `json:"error"` // This field can have the runtime type of [interface{}]. Input interface{} `json:"input"` // This field can have the runtime type of [map[string]interface{}]. Metadata interface{} `json:"metadata"` Output string `json:"output"` // This field can have the runtime type of [ToolStateRunningTime], // [ToolStateCompletedTime], [ToolStateErrorTime]. Time interface{} `json:"time"` Title string `json:"title"` JSON toolPartStateJSON `json:"-"` // contains filtered or unexported fields }
func (ToolPartState) AsUnion ¶
func (r ToolPartState) AsUnion() ToolPartStateUnion
AsUnion returns a ToolPartStateUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are ToolStatePending, ToolStateRunning, ToolStateCompleted, ToolStateError.
func (*ToolPartState) UnmarshalJSON ¶
func (r *ToolPartState) UnmarshalJSON(data []byte) (err error)
type ToolPartStateStatus ¶
type ToolPartStateStatus string
const ( ToolPartStateStatusPending ToolPartStateStatus = "pending" ToolPartStateStatusRunning ToolPartStateStatus = "running" ToolPartStateStatusCompleted ToolPartStateStatus = "completed" ToolPartStateStatusError ToolPartStateStatus = "error" )
func (ToolPartStateStatus) IsKnown ¶
func (r ToolPartStateStatus) IsKnown() bool
type ToolPartStateUnion ¶
type ToolPartStateUnion interface {
// contains filtered or unexported methods
}
Union satisfied by ToolStatePending, ToolStateRunning, ToolStateCompleted or ToolStateError.
type ToolPartType ¶
type ToolPartType string
const (
ToolPartTypeTool ToolPartType = "tool"
)
func (ToolPartType) IsKnown ¶
func (r ToolPartType) IsKnown() bool
type ToolStateCompleted ¶
type ToolStateCompleted struct { Metadata map[string]interface{} `json:"metadata,required"` Output string `json:"output,required"` Status ToolStateCompletedStatus `json:"status,required"` Time ToolStateCompletedTime `json:"time,required"` Title string `json:"title,required"` Input interface{} `json:"input"` JSON toolStateCompletedJSON `json:"-"` }
func (*ToolStateCompleted) UnmarshalJSON ¶
func (r *ToolStateCompleted) UnmarshalJSON(data []byte) (err error)
type ToolStateCompletedStatus ¶
type ToolStateCompletedStatus string
const (
ToolStateCompletedStatusCompleted ToolStateCompletedStatus = "completed"
)
func (ToolStateCompletedStatus) IsKnown ¶
func (r ToolStateCompletedStatus) IsKnown() bool
type ToolStateCompletedTime ¶
type ToolStateCompletedTime struct { End float64 `json:"end,required"` Start float64 `json:"start,required"` JSON toolStateCompletedTimeJSON `json:"-"` }
func (*ToolStateCompletedTime) UnmarshalJSON ¶
func (r *ToolStateCompletedTime) UnmarshalJSON(data []byte) (err error)
type ToolStateError ¶
type ToolStateError struct { Error string `json:"error,required"` Status ToolStateErrorStatus `json:"status,required"` Time ToolStateErrorTime `json:"time,required"` Input interface{} `json:"input"` JSON toolStateErrorJSON `json:"-"` }
func (*ToolStateError) UnmarshalJSON ¶
func (r *ToolStateError) UnmarshalJSON(data []byte) (err error)
type ToolStateErrorStatus ¶
type ToolStateErrorStatus string
const (
ToolStateErrorStatusError ToolStateErrorStatus = "error"
)
func (ToolStateErrorStatus) IsKnown ¶
func (r ToolStateErrorStatus) IsKnown() bool
type ToolStateErrorTime ¶
type ToolStateErrorTime struct { End float64 `json:"end,required"` Start float64 `json:"start,required"` JSON toolStateErrorTimeJSON `json:"-"` }
func (*ToolStateErrorTime) UnmarshalJSON ¶
func (r *ToolStateErrorTime) UnmarshalJSON(data []byte) (err error)
type ToolStatePending ¶
type ToolStatePending struct { Status ToolStatePendingStatus `json:"status,required"` JSON toolStatePendingJSON `json:"-"` }
func (*ToolStatePending) UnmarshalJSON ¶
func (r *ToolStatePending) UnmarshalJSON(data []byte) (err error)
type ToolStatePendingStatus ¶
type ToolStatePendingStatus string
const (
ToolStatePendingStatusPending ToolStatePendingStatus = "pending"
)
func (ToolStatePendingStatus) IsKnown ¶
func (r ToolStatePendingStatus) IsKnown() bool
type ToolStateRunning ¶
type ToolStateRunning struct { Status ToolStateRunningStatus `json:"status,required"` Time ToolStateRunningTime `json:"time,required"` Input interface{} `json:"input"` Metadata map[string]interface{} `json:"metadata"` Title string `json:"title"` JSON toolStateRunningJSON `json:"-"` }
func (*ToolStateRunning) UnmarshalJSON ¶
func (r *ToolStateRunning) UnmarshalJSON(data []byte) (err error)
type ToolStateRunningStatus ¶
type ToolStateRunningStatus string
const (
ToolStateRunningStatusRunning ToolStateRunningStatus = "running"
)
func (ToolStateRunningStatus) IsKnown ¶
func (r ToolStateRunningStatus) IsKnown() bool
type ToolStateRunningTime ¶
type ToolStateRunningTime struct { Start float64 `json:"start,required"` JSON toolStateRunningTimeJSON `json:"-"` }
func (*ToolStateRunningTime) UnmarshalJSON ¶
func (r *ToolStateRunningTime) UnmarshalJSON(data []byte) (err error)
type UnknownErrorData ¶
type UnknownErrorData = shared.UnknownErrorData
This is an alias to an internal type.
type UnknownErrorName ¶
type UnknownErrorName = shared.UnknownErrorName
This is an alias to an internal type.
type UserMessagePart ¶
type UserMessagePart struct { Type UserMessagePartType `json:"type,required"` Filename string `json:"filename"` Mime string `json:"mime"` Text string `json:"text"` URL string `json:"url"` JSON userMessagePartJSON `json:"-"` // contains filtered or unexported fields }
func (UserMessagePart) AsUnion ¶
func (r UserMessagePart) AsUnion() UserMessagePartUnion
AsUnion returns a UserMessagePartUnion interface which you can cast to the specific types for more type safety.
func (*UserMessagePart) UnmarshalJSON ¶
func (r *UserMessagePart) UnmarshalJSON(data []byte) (err error)
type UserMessagePartParam ¶
type UserMessagePartParam struct { Type param.Field[UserMessagePartType] `json:"type,required"` Filename param.Field[string] `json:"filename"` Mime param.Field[string] `json:"mime"` Text param.Field[string] `json:"text"` URL param.Field[string] `json:"url"` }
func (UserMessagePartParam) MarshalJSON ¶
func (r UserMessagePartParam) MarshalJSON() (data []byte, err error)
type UserMessagePartType ¶
type UserMessagePartType string
const ( UserMessagePartTypeText UserMessagePartType = "text" UserMessagePartTypeFile UserMessagePartType = "file" )
func (UserMessagePartType) IsKnown ¶
func (r UserMessagePartType) IsKnown() bool
type UserMessagePartUnion ¶
type UserMessagePartUnion interface {
// contains filtered or unexported methods
}
type UserMessagePartUnionParam ¶
type UserMessagePartUnionParam interface {
// contains filtered or unexported methods
}
Satisfied by TextPartParam, FilePartParam, UserMessagePartParam.