opencode

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 26 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package opencode manages Gimbal's shared OpenCode server and speaks the small legacy HTTP surface needed by the OpenCode harness.

Package opencode provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultStateDir

func DefaultStateDir() (string, error)

DefaultStateDir returns the shared OpenCode state directory. The GIMBAL_OPENCODE_DIR environment variable overrides ~/.gimbal/opencode.

func New

func New() gimbal.HarnessAdapter

New returns Gimbal's legacy OpenCode harness. The first session starts or discovers the shared OpenCode server; closing sessions never stops it.

func StopServer

func StopServer(ctx context.Context, stateDir string) (bool, error)

StopServer terminates the server owned by stateDir. It returns false when no owned server exists; it never starts one as part of cleanup.

Types

type APIError

type APIError struct {
	Data struct {
		IsRetryable     bool               `json:"isRetryable"`
		Message         string             `json:"message"`
		Metadata        *map[string]string `json:"metadata,omitempty"`
		ResponseBody    *string            `json:"responseBody,omitempty"`
		ResponseHeaders *map[string]string `json:"responseHeaders,omitempty"`
		StatusCode      *int               `json:"statusCode,omitempty"`
	} `json:"data"`
	Name APIErrorName `json:"name"`
}

APIError defines model for APIError.

type APIErrorName

type APIErrorName string

APIErrorName defines model for APIError.Name.

const (
	APIErrorNameAPIError APIErrorName = "APIError"
)

Defines values for APIErrorName.

func (APIErrorName) Valid

func (e APIErrorName) Valid() bool

Valid indicates whether the value is a known member of the APIErrorName enum.

type AgentPart

type AgentPart struct {
	Id        string `json:"id"`
	MessageID string `json:"messageID"`
	Name      string `json:"name"`
	SessionID string `json:"sessionID"`
	Source    *struct {
		End   int    `json:"end"`
		Start int    `json:"start"`
		Value string `json:"value"`
	} `json:"source,omitempty"`
	Type AgentPartType `json:"type"`
}

AgentPart defines model for AgentPart.

type AgentPartInput

type AgentPartInput struct {
	Id     *string `json:"id,omitempty"`
	Name   string  `json:"name"`
	Source *struct {
		End   int    `json:"end"`
		Start int    `json:"start"`
		Value string `json:"value"`
	} `json:"source,omitempty"`
	Type AgentPartInputType `json:"type"`
}

AgentPartInput defines model for AgentPartInput.

type AgentPartInputType

type AgentPartInputType string

AgentPartInputType defines model for AgentPartInput.Type.

const (
	AgentPartInputTypeAgent AgentPartInputType = "agent"
)

Defines values for AgentPartInputType.

func (AgentPartInputType) Valid

func (e AgentPartInputType) Valid() bool

Valid indicates whether the value is a known member of the AgentPartInputType enum.

type AgentPartType

type AgentPartType string

AgentPartType defines model for AgentPart.Type.

const (
	AgentPartTypeAgent AgentPartType = "agent"
)

Defines values for AgentPartType.

func (AgentPartType) Valid

func (e AgentPartType) Valid() bool

Valid indicates whether the value is a known member of the AgentPartType enum.

type AssistantMessage

type AssistantMessage struct {
	Agent    string                  `json:"agent"`
	Cost     float32                 `json:"cost"`
	Error    *AssistantMessage_Error `json:"error,omitempty"`
	Finish   *string                 `json:"finish,omitempty"`
	Id       string                  `json:"id"`
	Mode     string                  `json:"mode"`
	ModelID  string                  `json:"modelID"`
	ParentID string                  `json:"parentID"`
	Path     struct {
		Cwd  string `json:"cwd"`
		Root string `json:"root"`
	} `json:"path"`
	ProviderID string               `json:"providerID"`
	Role       AssistantMessageRole `json:"role"`
	SessionID  string               `json:"sessionID"`
	Structured interface{}          `json:"structured,omitempty"`
	Summary    *bool                `json:"summary,omitempty"`
	Time       struct {
		Completed *int `json:"completed,omitempty"`
		Created   int  `json:"created"`
	} `json:"time"`
	Tokens struct {
		Cache struct {
			Read  float32 `json:"read"`
			Write float32 `json:"write"`
		} `json:"cache"`
		Input     float32  `json:"input"`
		Output    float32  `json:"output"`
		Reasoning float32  `json:"reasoning"`
		Total     *float32 `json:"total,omitempty"`
	} `json:"tokens"`
	Variant *string `json:"variant,omitempty"`
}

AssistantMessage defines model for AssistantMessage.

type AssistantMessageRole

type AssistantMessageRole string

AssistantMessageRole defines model for AssistantMessage.Role.

const (
	Assistant AssistantMessageRole = "assistant"
)

Defines values for AssistantMessageRole.

func (AssistantMessageRole) Valid

func (e AssistantMessageRole) Valid() bool

Valid indicates whether the value is a known member of the AssistantMessageRole enum.

type AssistantMessage_Error

type AssistantMessage_Error struct {
	// contains filtered or unexported fields
}

AssistantMessage_Error defines model for AssistantMessage.Error.

func (AssistantMessage_Error) AsAPIError

func (t AssistantMessage_Error) AsAPIError() (APIError, error)

AsAPIError returns the union data inside the AssistantMessage_Error as a APIError

func (AssistantMessage_Error) AsContentFilterError

func (t AssistantMessage_Error) AsContentFilterError() (ContentFilterError, error)

AsContentFilterError returns the union data inside the AssistantMessage_Error as a ContentFilterError

func (AssistantMessage_Error) AsContextOverflowError

func (t AssistantMessage_Error) AsContextOverflowError() (ContextOverflowError, error)

AsContextOverflowError returns the union data inside the AssistantMessage_Error as a ContextOverflowError

func (AssistantMessage_Error) AsMessageAbortedError

func (t AssistantMessage_Error) AsMessageAbortedError() (MessageAbortedError, error)

AsMessageAbortedError returns the union data inside the AssistantMessage_Error as a MessageAbortedError

func (AssistantMessage_Error) AsMessageOutputLengthError

func (t AssistantMessage_Error) AsMessageOutputLengthError() (MessageOutputLengthError, error)

AsMessageOutputLengthError returns the union data inside the AssistantMessage_Error as a MessageOutputLengthError

func (AssistantMessage_Error) AsProviderAuthError

func (t AssistantMessage_Error) AsProviderAuthError() (ProviderAuthError, error)

AsProviderAuthError returns the union data inside the AssistantMessage_Error as a ProviderAuthError

func (AssistantMessage_Error) AsStructuredOutputError

func (t AssistantMessage_Error) AsStructuredOutputError() (StructuredOutputError, error)

AsStructuredOutputError returns the union data inside the AssistantMessage_Error as a StructuredOutputError

func (AssistantMessage_Error) AsUnknownError

func (t AssistantMessage_Error) AsUnknownError() (UnknownError, error)

AsUnknownError returns the union data inside the AssistantMessage_Error as a UnknownError

func (*AssistantMessage_Error) FromAPIError

func (t *AssistantMessage_Error) FromAPIError(v APIError) error

FromAPIError overwrites any union data inside the AssistantMessage_Error as the provided APIError

func (*AssistantMessage_Error) FromContentFilterError

func (t *AssistantMessage_Error) FromContentFilterError(v ContentFilterError) error

FromContentFilterError overwrites any union data inside the AssistantMessage_Error as the provided ContentFilterError

func (*AssistantMessage_Error) FromContextOverflowError

func (t *AssistantMessage_Error) FromContextOverflowError(v ContextOverflowError) error

FromContextOverflowError overwrites any union data inside the AssistantMessage_Error as the provided ContextOverflowError

func (*AssistantMessage_Error) FromMessageAbortedError

func (t *AssistantMessage_Error) FromMessageAbortedError(v MessageAbortedError) error

FromMessageAbortedError overwrites any union data inside the AssistantMessage_Error as the provided MessageAbortedError

func (*AssistantMessage_Error) FromMessageOutputLengthError

func (t *AssistantMessage_Error) FromMessageOutputLengthError(v MessageOutputLengthError) error

FromMessageOutputLengthError overwrites any union data inside the AssistantMessage_Error as the provided MessageOutputLengthError

func (*AssistantMessage_Error) FromProviderAuthError

func (t *AssistantMessage_Error) FromProviderAuthError(v ProviderAuthError) error

FromProviderAuthError overwrites any union data inside the AssistantMessage_Error as the provided ProviderAuthError

func (*AssistantMessage_Error) FromStructuredOutputError

func (t *AssistantMessage_Error) FromStructuredOutputError(v StructuredOutputError) error

FromStructuredOutputError overwrites any union data inside the AssistantMessage_Error as the provided StructuredOutputError

func (*AssistantMessage_Error) FromUnknownError

func (t *AssistantMessage_Error) FromUnknownError(v UnknownError) error

FromUnknownError overwrites any union data inside the AssistantMessage_Error as the provided UnknownError

func (AssistantMessage_Error) MarshalJSON

func (t AssistantMessage_Error) MarshalJSON() ([]byte, error)

func (*AssistantMessage_Error) MergeAPIError

func (t *AssistantMessage_Error) MergeAPIError(v APIError) error

MergeAPIError performs a merge with any union data inside the AssistantMessage_Error, using the provided APIError

func (*AssistantMessage_Error) MergeContentFilterError

func (t *AssistantMessage_Error) MergeContentFilterError(v ContentFilterError) error

MergeContentFilterError performs a merge with any union data inside the AssistantMessage_Error, using the provided ContentFilterError

func (*AssistantMessage_Error) MergeContextOverflowError

func (t *AssistantMessage_Error) MergeContextOverflowError(v ContextOverflowError) error

MergeContextOverflowError performs a merge with any union data inside the AssistantMessage_Error, using the provided ContextOverflowError

func (*AssistantMessage_Error) MergeMessageAbortedError

func (t *AssistantMessage_Error) MergeMessageAbortedError(v MessageAbortedError) error

MergeMessageAbortedError performs a merge with any union data inside the AssistantMessage_Error, using the provided MessageAbortedError

func (*AssistantMessage_Error) MergeMessageOutputLengthError

func (t *AssistantMessage_Error) MergeMessageOutputLengthError(v MessageOutputLengthError) error

MergeMessageOutputLengthError performs a merge with any union data inside the AssistantMessage_Error, using the provided MessageOutputLengthError

func (*AssistantMessage_Error) MergeProviderAuthError

func (t *AssistantMessage_Error) MergeProviderAuthError(v ProviderAuthError) error

MergeProviderAuthError performs a merge with any union data inside the AssistantMessage_Error, using the provided ProviderAuthError

func (*AssistantMessage_Error) MergeStructuredOutputError

func (t *AssistantMessage_Error) MergeStructuredOutputError(v StructuredOutputError) error

MergeStructuredOutputError performs a merge with any union data inside the AssistantMessage_Error, using the provided StructuredOutputError

func (*AssistantMessage_Error) MergeUnknownError

func (t *AssistantMessage_Error) MergeUnknownError(v UnknownError) error

MergeUnknownError performs a merge with any union data inside the AssistantMessage_Error, using the provided UnknownError

func (*AssistantMessage_Error) UnmarshalJSON

func (t *AssistantMessage_Error) UnmarshalJSON(b []byte) error

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a project-scoped client for the shared OpenCode server.

func Connect

func Connect(ctx context.Context, workdir, stateDir string) (*Client, error)

Connect starts or discovers the shared server and returns a client bound to workdir. An empty stateDir uses DefaultStateDir.

func (*Client) Abort

func (c *Client) Abort(ctx context.Context, sessionID string) (bool, error)

Abort interrupts the active work in a legacy session.

func (*Client) CreateSession

func (c *Client) CreateSession(ctx context.Context, input SessionCreateInput) (Session, error)

CreateSession creates a legacy OpenCode session in the client's project.

func (*Client) Events

func (c *Client) Events(ctx context.Context, onEvent func(RawEvent) error) error

Events reads the shared process-wide SSE stream until ctx is cancelled, the callback fails, or the server connection ends. The callback receives every data value, including event types it does not recognize.

func (*Client) Fork

func (c *Client) Fork(ctx context.Context, sessionID string, input ForkInput) (Session, error)

Fork copies a legacy conversation, optionally at a particular message.

func (*Client) Messages

func (c *Client) Messages(ctx context.Context, sessionID string) ([]MessageRecord, error)

Messages returns the persisted messages and parts in a legacy session.

func (*Client) Prompt

func (c *Client) Prompt(ctx context.Context, sessionID string, input PromptInput) (PromptResponse, error)

Prompt posts one legacy prompt and waits for OpenCode's authoritative final response. Live events are observed independently through Events.

type CompactionPart

type CompactionPart struct {
	Auto        bool               `json:"auto"`
	Id          string             `json:"id"`
	MessageID   string             `json:"messageID"`
	Overflow    *bool              `json:"overflow,omitempty"`
	SessionID   string             `json:"sessionID"`
	TailStartId *string            `json:"tail_start_id,omitempty"`
	Type        CompactionPartType `json:"type"`
}

CompactionPart defines model for CompactionPart.

type CompactionPartType

type CompactionPartType string

CompactionPartType defines model for CompactionPart.Type.

const (
	Compaction CompactionPartType = "compaction"
)

Defines values for CompactionPartType.

func (CompactionPartType) Valid

func (e CompactionPartType) Valid() bool

Valid indicates whether the value is a known member of the CompactionPartType enum.

type ContentFilterError

type ContentFilterError struct {
	Data struct {
		Message string `json:"message"`
	} `json:"data"`
	Name ContentFilterErrorName `json:"name"`
}

ContentFilterError defines model for ContentFilterError.

type ContentFilterErrorName

type ContentFilterErrorName string

ContentFilterErrorName defines model for ContentFilterError.Name.

const (
	ContentFilterErrorNameContentFilterError ContentFilterErrorName = "ContentFilterError"
)

Defines values for ContentFilterErrorName.

func (ContentFilterErrorName) Valid

func (e ContentFilterErrorName) Valid() bool

Valid indicates whether the value is a known member of the ContentFilterErrorName enum.

type ContextOverflowError

type ContextOverflowError struct {
	Data struct {
		Message      string  `json:"message"`
		ResponseBody *string `json:"responseBody,omitempty"`
	} `json:"data"`
	Name ContextOverflowErrorName `json:"name"`
}

ContextOverflowError defines model for ContextOverflowError.

type ContextOverflowErrorName

type ContextOverflowErrorName string

ContextOverflowErrorName defines model for ContextOverflowError.Name.

const (
	ContextOverflowErrorNameContextOverflowError ContextOverflowErrorName = "ContextOverflowError"
)

Defines values for ContextOverflowErrorName.

func (ContextOverflowErrorName) Valid

func (e ContextOverflowErrorName) Valid() bool

Valid indicates whether the value is a known member of the ContextOverflowErrorName enum.

type EffectHttpApiErrorBadRequest

type EffectHttpApiErrorBadRequest struct {
	UnderscoreTag EffectHttpApiErrorBadRequestTag `json:"_tag"`
}

EffectHttpApiErrorBadRequest defines model for effect_HttpApiError_BadRequest.

type EffectHttpApiErrorBadRequestTag

type EffectHttpApiErrorBadRequestTag string

EffectHttpApiErrorBadRequestTag defines model for EffectHttpApiErrorBadRequest.Tag.

const (
	BadRequest EffectHttpApiErrorBadRequestTag = "BadRequest"
)

Defines values for EffectHttpApiErrorBadRequestTag.

func (EffectHttpApiErrorBadRequestTag) Valid

Valid indicates whether the value is a known member of the EffectHttpApiErrorBadRequestTag enum.

type EventMessagePartDelta

type EventMessagePartDelta struct {
	Id         string `json:"id"`
	Properties struct {
		Delta     string `json:"delta"`
		Field     string `json:"field"`
		MessageID string `json:"messageID"`
		PartID    string `json:"partID"`
		SessionID string `json:"sessionID"`
	} `json:"properties"`
	Type EventMessagePartDeltaType `json:"type"`
}

EventMessagePartDelta defines model for EventMessagePartDelta.

type EventMessagePartDeltaType

type EventMessagePartDeltaType string

EventMessagePartDeltaType defines model for EventMessagePartDelta.Type.

const (
	MessagePartDelta EventMessagePartDeltaType = "message.part.delta"
)

Defines values for EventMessagePartDeltaType.

func (EventMessagePartDeltaType) Valid

func (e EventMessagePartDeltaType) Valid() bool

Valid indicates whether the value is a known member of the EventMessagePartDeltaType enum.

type EventMessagePartRemoved

type EventMessagePartRemoved struct {
	Id         string `json:"id"`
	Properties struct {
		MessageID string `json:"messageID"`
		PartID    string `json:"partID"`
		SessionID string `json:"sessionID"`
	} `json:"properties"`
	Type EventMessagePartRemovedType `json:"type"`
}

EventMessagePartRemoved defines model for EventMessagePartRemoved.

type EventMessagePartRemovedType

type EventMessagePartRemovedType string

EventMessagePartRemovedType defines model for EventMessagePartRemoved.Type.

const (
	MessagePartRemoved EventMessagePartRemovedType = "message.part.removed"
)

Defines values for EventMessagePartRemovedType.

func (EventMessagePartRemovedType) Valid

Valid indicates whether the value is a known member of the EventMessagePartRemovedType enum.

type EventMessagePartUpdated

type EventMessagePartUpdated struct {
	Id         string `json:"id"`
	Properties struct {
		Part      Part    `json:"part"`
		SessionID string  `json:"sessionID"`
		Time      float32 `json:"time"`
	} `json:"properties"`
	Type EventMessagePartUpdatedType `json:"type"`
}

EventMessagePartUpdated defines model for EventMessagePartUpdated.

type EventMessagePartUpdatedType

type EventMessagePartUpdatedType string

EventMessagePartUpdatedType defines model for EventMessagePartUpdated.Type.

const (
	MessagePartUpdated EventMessagePartUpdatedType = "message.part.updated"
)

Defines values for EventMessagePartUpdatedType.

func (EventMessagePartUpdatedType) Valid

Valid indicates whether the value is a known member of the EventMessagePartUpdatedType enum.

type EventMessageRemoved

type EventMessageRemoved struct {
	Id         string `json:"id"`
	Properties struct {
		MessageID string `json:"messageID"`
		SessionID string `json:"sessionID"`
	} `json:"properties"`
	Type EventMessageRemovedType `json:"type"`
}

EventMessageRemoved defines model for EventMessageRemoved.

type EventMessageRemovedType

type EventMessageRemovedType string

EventMessageRemovedType defines model for EventMessageRemoved.Type.

const (
	MessageRemoved EventMessageRemovedType = "message.removed"
)

Defines values for EventMessageRemovedType.

func (EventMessageRemovedType) Valid

func (e EventMessageRemovedType) Valid() bool

Valid indicates whether the value is a known member of the EventMessageRemovedType enum.

type EventMessageUpdated

type EventMessageUpdated struct {
	Id         string `json:"id"`
	Properties struct {
		Info      Message `json:"info"`
		SessionID string  `json:"sessionID"`
	} `json:"properties"`
	Type EventMessageUpdatedType `json:"type"`
}

EventMessageUpdated defines model for EventMessageUpdated.

type EventMessageUpdatedType

type EventMessageUpdatedType string

EventMessageUpdatedType defines model for EventMessageUpdated.Type.

const (
	MessageUpdated EventMessageUpdatedType = "message.updated"
)

Defines values for EventMessageUpdatedType.

func (EventMessageUpdatedType) Valid

func (e EventMessageUpdatedType) Valid() bool

Valid indicates whether the value is a known member of the EventMessageUpdatedType enum.

type EventSessionError

type EventSessionError struct {
	Id         string `json:"id"`
	Properties struct {
		Error     *EventSessionError_Properties_Error `json:"error,omitempty"`
		SessionID *string                             `json:"sessionID,omitempty"`
	} `json:"properties"`
	Type EventSessionErrorType `json:"type"`
}

EventSessionError defines model for EventSessionError.

type EventSessionErrorType

type EventSessionErrorType string

EventSessionErrorType defines model for EventSessionError.Type.

const (
	SessionError EventSessionErrorType = "session.error"
)

Defines values for EventSessionErrorType.

func (EventSessionErrorType) Valid

func (e EventSessionErrorType) Valid() bool

Valid indicates whether the value is a known member of the EventSessionErrorType enum.

type EventSessionError_Properties_Error

type EventSessionError_Properties_Error struct {
	// contains filtered or unexported fields
}

EventSessionError_Properties_Error defines model for EventSessionError.Properties.Error.

func (EventSessionError_Properties_Error) AsAPIError

AsAPIError returns the union data inside the EventSessionError_Properties_Error as a APIError

func (EventSessionError_Properties_Error) AsContentFilterError

func (t EventSessionError_Properties_Error) AsContentFilterError() (ContentFilterError, error)

AsContentFilterError returns the union data inside the EventSessionError_Properties_Error as a ContentFilterError

func (EventSessionError_Properties_Error) AsContextOverflowError

func (t EventSessionError_Properties_Error) AsContextOverflowError() (ContextOverflowError, error)

AsContextOverflowError returns the union data inside the EventSessionError_Properties_Error as a ContextOverflowError

func (EventSessionError_Properties_Error) AsMessageAbortedError

func (t EventSessionError_Properties_Error) AsMessageAbortedError() (MessageAbortedError, error)

AsMessageAbortedError returns the union data inside the EventSessionError_Properties_Error as a MessageAbortedError

func (EventSessionError_Properties_Error) AsMessageOutputLengthError

func (t EventSessionError_Properties_Error) AsMessageOutputLengthError() (MessageOutputLengthError, error)

AsMessageOutputLengthError returns the union data inside the EventSessionError_Properties_Error as a MessageOutputLengthError

func (EventSessionError_Properties_Error) AsProviderAuthError

func (t EventSessionError_Properties_Error) AsProviderAuthError() (ProviderAuthError, error)

AsProviderAuthError returns the union data inside the EventSessionError_Properties_Error as a ProviderAuthError

func (EventSessionError_Properties_Error) AsStructuredOutputError

func (t EventSessionError_Properties_Error) AsStructuredOutputError() (StructuredOutputError, error)

AsStructuredOutputError returns the union data inside the EventSessionError_Properties_Error as a StructuredOutputError

func (EventSessionError_Properties_Error) AsUnknownError

AsUnknownError returns the union data inside the EventSessionError_Properties_Error as a UnknownError

func (*EventSessionError_Properties_Error) FromAPIError

FromAPIError overwrites any union data inside the EventSessionError_Properties_Error as the provided APIError

func (*EventSessionError_Properties_Error) FromContentFilterError

func (t *EventSessionError_Properties_Error) FromContentFilterError(v ContentFilterError) error

FromContentFilterError overwrites any union data inside the EventSessionError_Properties_Error as the provided ContentFilterError

func (*EventSessionError_Properties_Error) FromContextOverflowError

func (t *EventSessionError_Properties_Error) FromContextOverflowError(v ContextOverflowError) error

FromContextOverflowError overwrites any union data inside the EventSessionError_Properties_Error as the provided ContextOverflowError

func (*EventSessionError_Properties_Error) FromMessageAbortedError

func (t *EventSessionError_Properties_Error) FromMessageAbortedError(v MessageAbortedError) error

FromMessageAbortedError overwrites any union data inside the EventSessionError_Properties_Error as the provided MessageAbortedError

func (*EventSessionError_Properties_Error) FromMessageOutputLengthError

func (t *EventSessionError_Properties_Error) FromMessageOutputLengthError(v MessageOutputLengthError) error

FromMessageOutputLengthError overwrites any union data inside the EventSessionError_Properties_Error as the provided MessageOutputLengthError

func (*EventSessionError_Properties_Error) FromProviderAuthError

func (t *EventSessionError_Properties_Error) FromProviderAuthError(v ProviderAuthError) error

FromProviderAuthError overwrites any union data inside the EventSessionError_Properties_Error as the provided ProviderAuthError

func (*EventSessionError_Properties_Error) FromStructuredOutputError

func (t *EventSessionError_Properties_Error) FromStructuredOutputError(v StructuredOutputError) error

FromStructuredOutputError overwrites any union data inside the EventSessionError_Properties_Error as the provided StructuredOutputError

func (*EventSessionError_Properties_Error) FromUnknownError

func (t *EventSessionError_Properties_Error) FromUnknownError(v UnknownError) error

FromUnknownError overwrites any union data inside the EventSessionError_Properties_Error as the provided UnknownError

func (EventSessionError_Properties_Error) MarshalJSON

func (t EventSessionError_Properties_Error) MarshalJSON() ([]byte, error)

func (*EventSessionError_Properties_Error) MergeAPIError

MergeAPIError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided APIError

func (*EventSessionError_Properties_Error) MergeContentFilterError

func (t *EventSessionError_Properties_Error) MergeContentFilterError(v ContentFilterError) error

MergeContentFilterError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided ContentFilterError

func (*EventSessionError_Properties_Error) MergeContextOverflowError

func (t *EventSessionError_Properties_Error) MergeContextOverflowError(v ContextOverflowError) error

MergeContextOverflowError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided ContextOverflowError

func (*EventSessionError_Properties_Error) MergeMessageAbortedError

func (t *EventSessionError_Properties_Error) MergeMessageAbortedError(v MessageAbortedError) error

MergeMessageAbortedError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided MessageAbortedError

func (*EventSessionError_Properties_Error) MergeMessageOutputLengthError

func (t *EventSessionError_Properties_Error) MergeMessageOutputLengthError(v MessageOutputLengthError) error

MergeMessageOutputLengthError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided MessageOutputLengthError

func (*EventSessionError_Properties_Error) MergeProviderAuthError

func (t *EventSessionError_Properties_Error) MergeProviderAuthError(v ProviderAuthError) error

MergeProviderAuthError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided ProviderAuthError

func (*EventSessionError_Properties_Error) MergeStructuredOutputError

func (t *EventSessionError_Properties_Error) MergeStructuredOutputError(v StructuredOutputError) error

MergeStructuredOutputError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided StructuredOutputError

func (*EventSessionError_Properties_Error) MergeUnknownError

func (t *EventSessionError_Properties_Error) MergeUnknownError(v UnknownError) error

MergeUnknownError performs a merge with any union data inside the EventSessionError_Properties_Error, using the provided UnknownError

func (*EventSessionError_Properties_Error) UnmarshalJSON

func (t *EventSessionError_Properties_Error) UnmarshalJSON(b []byte) error

type EventSessionIdle

type EventSessionIdle struct {
	Id         string `json:"id"`
	Properties struct {
		SessionID string `json:"sessionID"`
	} `json:"properties"`
	Type EventSessionIdleType `json:"type"`
}

EventSessionIdle defines model for EventSessionIdle.

type EventSessionIdleType

type EventSessionIdleType string

EventSessionIdleType defines model for EventSessionIdle.Type.

const (
	SessionIdle EventSessionIdleType = "session.idle"
)

Defines values for EventSessionIdleType.

func (EventSessionIdleType) Valid

func (e EventSessionIdleType) Valid() bool

Valid indicates whether the value is a known member of the EventSessionIdleType enum.

type EventSessionStatus

type EventSessionStatus struct {
	Id         string `json:"id"`
	Properties struct {
		SessionID string        `json:"sessionID"`
		Status    SessionStatus `json:"status"`
	} `json:"properties"`
	Type EventSessionStatusType `json:"type"`
}

EventSessionStatus defines model for EventSessionStatus.

type EventSessionStatusType

type EventSessionStatusType string

EventSessionStatusType defines model for EventSessionStatus.Type.

const (
	EventSessionStatusTypeSessionStatus EventSessionStatusType = "session.status"
)

Defines values for EventSessionStatusType.

func (EventSessionStatusType) Valid

func (e EventSessionStatusType) Valid() bool

Valid indicates whether the value is a known member of the EventSessionStatusType enum.

type FilePart

type FilePart struct {
	Filename  *string         `json:"filename,omitempty"`
	Id        string          `json:"id"`
	MessageID string          `json:"messageID"`
	Mime      string          `json:"mime"`
	SessionID string          `json:"sessionID"`
	Source    *FilePartSource `json:"source,omitempty"`
	Type      FilePartType    `json:"type"`
	Url       string          `json:"url"`
}

FilePart defines model for FilePart.

type FilePartInput

type FilePartInput struct {
	Filename *string           `json:"filename,omitempty"`
	Id       *string           `json:"id,omitempty"`
	Mime     string            `json:"mime"`
	Source   *FilePartSource   `json:"source,omitempty"`
	Type     FilePartInputType `json:"type"`
	Url      string            `json:"url"`
}

FilePartInput defines model for FilePartInput.

type FilePartInputType

type FilePartInputType string

FilePartInputType defines model for FilePartInput.Type.

const (
	FilePartInputTypeFile FilePartInputType = "file"
)

Defines values for FilePartInputType.

func (FilePartInputType) Valid

func (e FilePartInputType) Valid() bool

Valid indicates whether the value is a known member of the FilePartInputType enum.

type FilePartSource

type FilePartSource struct {
	// contains filtered or unexported fields
}

FilePartSource defines model for FilePartSource.

func (FilePartSource) AsFileSource

func (t FilePartSource) AsFileSource() (FileSource, error)

AsFileSource returns the union data inside the FilePartSource as a FileSource

func (FilePartSource) AsResourceSource

func (t FilePartSource) AsResourceSource() (ResourceSource, error)

AsResourceSource returns the union data inside the FilePartSource as a ResourceSource

func (FilePartSource) AsSymbolSource

func (t FilePartSource) AsSymbolSource() (SymbolSource, error)

AsSymbolSource returns the union data inside the FilePartSource as a SymbolSource

func (*FilePartSource) FromFileSource

func (t *FilePartSource) FromFileSource(v FileSource) error

FromFileSource overwrites any union data inside the FilePartSource as the provided FileSource

func (*FilePartSource) FromResourceSource

func (t *FilePartSource) FromResourceSource(v ResourceSource) error

FromResourceSource overwrites any union data inside the FilePartSource as the provided ResourceSource

func (*FilePartSource) FromSymbolSource

func (t *FilePartSource) FromSymbolSource(v SymbolSource) error

FromSymbolSource overwrites any union data inside the FilePartSource as the provided SymbolSource

func (FilePartSource) MarshalJSON

func (t FilePartSource) MarshalJSON() ([]byte, error)

func (*FilePartSource) MergeFileSource

func (t *FilePartSource) MergeFileSource(v FileSource) error

MergeFileSource performs a merge with any union data inside the FilePartSource, using the provided FileSource

func (*FilePartSource) MergeResourceSource

func (t *FilePartSource) MergeResourceSource(v ResourceSource) error

MergeResourceSource performs a merge with any union data inside the FilePartSource, using the provided ResourceSource

func (*FilePartSource) MergeSymbolSource

func (t *FilePartSource) MergeSymbolSource(v SymbolSource) error

MergeSymbolSource performs a merge with any union data inside the FilePartSource, using the provided SymbolSource

func (*FilePartSource) UnmarshalJSON

func (t *FilePartSource) UnmarshalJSON(b []byte) error

type FilePartSourceText

type FilePartSourceText struct {
	End   float32 `json:"end"`
	Start float32 `json:"start"`
	Value string  `json:"value"`
}

FilePartSourceText defines model for FilePartSourceText.

type FilePartType

type FilePartType string

FilePartType defines model for FilePart.Type.

const (
	FilePartTypeFile FilePartType = "file"
)

Defines values for FilePartType.

func (FilePartType) Valid

func (e FilePartType) Valid() bool

Valid indicates whether the value is a known member of the FilePartType enum.

type FileSource

type FileSource struct {
	Path string             `json:"path"`
	Text FilePartSourceText `json:"text"`
	Type FileSourceType     `json:"type"`
}

FileSource defines model for FileSource.

type FileSourceType

type FileSourceType string

FileSourceType defines model for FileSource.Type.

const (
	FileSourceTypeFile FileSourceType = "file"
)

Defines values for FileSourceType.

func (FileSourceType) Valid

func (e FileSourceType) Valid() bool

Valid indicates whether the value is a known member of the FileSourceType enum.

type ForkInput

type ForkInput struct {
	MessageID *string `json:"messageID,omitempty"`
}

ForkInput is the optional inline request body of POST /session/{id}/fork.

type InvalidRequestError

type InvalidRequestError struct {
	UnderscoreTag InvalidRequestErrorTag `json:"_tag"`
	Field         *string                `json:"field,omitempty"`
	Kind          *string                `json:"kind,omitempty"`
	Message       string                 `json:"message"`
}

InvalidRequestError defines model for InvalidRequestError.

type InvalidRequestErrorTag

type InvalidRequestErrorTag string

InvalidRequestErrorTag defines model for InvalidRequestError.Tag.

const (
	InvalidRequestErrorTagInvalidRequestError InvalidRequestErrorTag = "InvalidRequestError"
)

Defines values for InvalidRequestErrorTag.

func (InvalidRequestErrorTag) Valid

func (e InvalidRequestErrorTag) Valid() bool

Valid indicates whether the value is a known member of the InvalidRequestErrorTag enum.

type JSONSchema

type JSONSchema = map[string]interface{}

JSONSchema defines model for JSONSchema.

type Message

type Message struct {
	// contains filtered or unexported fields
}

Message defines model for Message.

func (Message) AsAssistantMessage

func (t Message) AsAssistantMessage() (AssistantMessage, error)

AsAssistantMessage returns the union data inside the Message as a AssistantMessage

func (Message) AsUserMessage

func (t Message) AsUserMessage() (UserMessage, error)

AsUserMessage returns the union data inside the Message as a UserMessage

func (*Message) FromAssistantMessage

func (t *Message) FromAssistantMessage(v AssistantMessage) error

FromAssistantMessage overwrites any union data inside the Message as the provided AssistantMessage

func (*Message) FromUserMessage

func (t *Message) FromUserMessage(v UserMessage) error

FromUserMessage overwrites any union data inside the Message as the provided UserMessage

func (Message) MarshalJSON

func (t Message) MarshalJSON() ([]byte, error)

func (*Message) MergeAssistantMessage

func (t *Message) MergeAssistantMessage(v AssistantMessage) error

MergeAssistantMessage performs a merge with any union data inside the Message, using the provided AssistantMessage

func (*Message) MergeUserMessage

func (t *Message) MergeUserMessage(v UserMessage) error

MergeUserMessage performs a merge with any union data inside the Message, using the provided UserMessage

func (*Message) UnmarshalJSON

func (t *Message) UnmarshalJSON(b []byte) error

type MessageAbortedError

type MessageAbortedError struct {
	Data struct {
		Message string `json:"message"`
	} `json:"data"`
	Name MessageAbortedErrorName `json:"name"`
}

MessageAbortedError defines model for MessageAbortedError.

type MessageAbortedErrorName

type MessageAbortedErrorName string

MessageAbortedErrorName defines model for MessageAbortedError.Name.

const (
	MessageAbortedErrorNameMessageAbortedError MessageAbortedErrorName = "MessageAbortedError"
)

Defines values for MessageAbortedErrorName.

func (MessageAbortedErrorName) Valid

func (e MessageAbortedErrorName) Valid() bool

Valid indicates whether the value is a known member of the MessageAbortedErrorName enum.

type MessageOutputLengthError

type MessageOutputLengthError struct {
	Data map[string]interface{}       `json:"data"`
	Name MessageOutputLengthErrorName `json:"name"`
}

MessageOutputLengthError defines model for MessageOutputLengthError.

type MessageOutputLengthErrorName

type MessageOutputLengthErrorName string

MessageOutputLengthErrorName defines model for MessageOutputLengthError.Name.

const (
	MessageOutputLengthErrorNameMessageOutputLengthError MessageOutputLengthErrorName = "MessageOutputLengthError"
)

Defines values for MessageOutputLengthErrorName.

func (MessageOutputLengthErrorName) Valid

Valid indicates whether the value is a known member of the MessageOutputLengthErrorName enum.

type MessageRecord

type MessageRecord struct {
	Info  Message `json:"info"`
	Parts []Part  `json:"parts"`
}

MessageRecord is one inline list envelope from GET /session/{id}/message.

type NotFoundError

type NotFoundError struct {
	Data struct {
		Message string `json:"message"`
	} `json:"data"`
	Name NotFoundErrorName `json:"name"`
}

NotFoundError defines model for NotFoundError.

type NotFoundErrorName

type NotFoundErrorName string

NotFoundErrorName defines model for NotFoundError.Name.

const (
	NotFoundErrorNameNotFoundError NotFoundErrorName = "NotFoundError"
)

Defines values for NotFoundErrorName.

func (NotFoundErrorName) Valid

func (e NotFoundErrorName) Valid() bool

Valid indicates whether the value is a known member of the NotFoundErrorName enum.

type OutputFormat

type OutputFormat struct {
	// contains filtered or unexported fields
}

OutputFormat defines model for OutputFormat.

func (OutputFormat) AsOutputFormatJsonSchema

func (t OutputFormat) AsOutputFormatJsonSchema() (OutputFormatJsonSchema, error)

AsOutputFormatJsonSchema returns the union data inside the OutputFormat as a OutputFormatJsonSchema

func (OutputFormat) AsOutputFormatText

func (t OutputFormat) AsOutputFormatText() (OutputFormatText, error)

AsOutputFormatText returns the union data inside the OutputFormat as a OutputFormatText

func (*OutputFormat) FromOutputFormatJsonSchema

func (t *OutputFormat) FromOutputFormatJsonSchema(v OutputFormatJsonSchema) error

FromOutputFormatJsonSchema overwrites any union data inside the OutputFormat as the provided OutputFormatJsonSchema

func (*OutputFormat) FromOutputFormatText

func (t *OutputFormat) FromOutputFormatText(v OutputFormatText) error

FromOutputFormatText overwrites any union data inside the OutputFormat as the provided OutputFormatText

func (OutputFormat) MarshalJSON

func (t OutputFormat) MarshalJSON() ([]byte, error)

func (*OutputFormat) MergeOutputFormatJsonSchema

func (t *OutputFormat) MergeOutputFormatJsonSchema(v OutputFormatJsonSchema) error

MergeOutputFormatJsonSchema performs a merge with any union data inside the OutputFormat, using the provided OutputFormatJsonSchema

func (*OutputFormat) MergeOutputFormatText

func (t *OutputFormat) MergeOutputFormatText(v OutputFormatText) error

MergeOutputFormatText performs a merge with any union data inside the OutputFormat, using the provided OutputFormatText

func (*OutputFormat) UnmarshalJSON

func (t *OutputFormat) UnmarshalJSON(b []byte) error

type OutputFormatJsonSchema

type OutputFormatJsonSchema struct {
	RetryCount *int                       `json:"retryCount,omitempty"`
	Schema     JSONSchema                 `json:"schema"`
	Type       OutputFormatJsonSchemaType `json:"type"`
}

OutputFormatJsonSchema defines model for OutputFormatJsonSchema.

type OutputFormatJsonSchemaType

type OutputFormatJsonSchemaType string

OutputFormatJsonSchemaType defines model for OutputFormatJsonSchema.Type.

const (
	JsonSchema OutputFormatJsonSchemaType = "json_schema"
)

Defines values for OutputFormatJsonSchemaType.

func (OutputFormatJsonSchemaType) Valid

func (e OutputFormatJsonSchemaType) Valid() bool

Valid indicates whether the value is a known member of the OutputFormatJsonSchemaType enum.

type OutputFormatText

type OutputFormatText struct {
	Type OutputFormatTextType `json:"type"`
}

OutputFormatText defines model for OutputFormatText.

type OutputFormatTextType

type OutputFormatTextType string

OutputFormatTextType defines model for OutputFormatText.Type.

const (
	OutputFormatTextTypeText OutputFormatTextType = "text"
)

Defines values for OutputFormatTextType.

func (OutputFormatTextType) Valid

func (e OutputFormatTextType) Valid() bool

Valid indicates whether the value is a known member of the OutputFormatTextType enum.

type Part

type Part struct {
	// contains filtered or unexported fields
}

Part defines model for Part.

func (Part) AsAgentPart

func (t Part) AsAgentPart() (AgentPart, error)

AsAgentPart returns the union data inside the Part as a AgentPart

func (Part) AsCompactionPart

func (t Part) AsCompactionPart() (CompactionPart, error)

AsCompactionPart returns the union data inside the Part as a CompactionPart

func (Part) AsFilePart

func (t Part) AsFilePart() (FilePart, error)

AsFilePart returns the union data inside the Part as a FilePart

func (Part) AsPatchPart

func (t Part) AsPatchPart() (PatchPart, error)

AsPatchPart returns the union data inside the Part as a PatchPart

func (Part) AsReasoningPart

func (t Part) AsReasoningPart() (ReasoningPart, error)

AsReasoningPart returns the union data inside the Part as a ReasoningPart

func (Part) AsRetryPart

func (t Part) AsRetryPart() (RetryPart, error)

AsRetryPart returns the union data inside the Part as a RetryPart

func (Part) AsSnapshotPart

func (t Part) AsSnapshotPart() (SnapshotPart, error)

AsSnapshotPart returns the union data inside the Part as a SnapshotPart

func (Part) AsStepFinishPart

func (t Part) AsStepFinishPart() (StepFinishPart, error)

AsStepFinishPart returns the union data inside the Part as a StepFinishPart

func (Part) AsStepStartPart

func (t Part) AsStepStartPart() (StepStartPart, error)

AsStepStartPart returns the union data inside the Part as a StepStartPart

func (Part) AsSubtaskPart

func (t Part) AsSubtaskPart() (SubtaskPart, error)

AsSubtaskPart returns the union data inside the Part as a SubtaskPart

func (Part) AsTextPart

func (t Part) AsTextPart() (TextPart, error)

AsTextPart returns the union data inside the Part as a TextPart

func (Part) AsToolPart

func (t Part) AsToolPart() (ToolPart, error)

AsToolPart returns the union data inside the Part as a ToolPart

func (*Part) FromAgentPart

func (t *Part) FromAgentPart(v AgentPart) error

FromAgentPart overwrites any union data inside the Part as the provided AgentPart

func (*Part) FromCompactionPart

func (t *Part) FromCompactionPart(v CompactionPart) error

FromCompactionPart overwrites any union data inside the Part as the provided CompactionPart

func (*Part) FromFilePart

func (t *Part) FromFilePart(v FilePart) error

FromFilePart overwrites any union data inside the Part as the provided FilePart

func (*Part) FromPatchPart

func (t *Part) FromPatchPart(v PatchPart) error

FromPatchPart overwrites any union data inside the Part as the provided PatchPart

func (*Part) FromReasoningPart

func (t *Part) FromReasoningPart(v ReasoningPart) error

FromReasoningPart overwrites any union data inside the Part as the provided ReasoningPart

func (*Part) FromRetryPart

func (t *Part) FromRetryPart(v RetryPart) error

FromRetryPart overwrites any union data inside the Part as the provided RetryPart

func (*Part) FromSnapshotPart

func (t *Part) FromSnapshotPart(v SnapshotPart) error

FromSnapshotPart overwrites any union data inside the Part as the provided SnapshotPart

func (*Part) FromStepFinishPart

func (t *Part) FromStepFinishPart(v StepFinishPart) error

FromStepFinishPart overwrites any union data inside the Part as the provided StepFinishPart

func (*Part) FromStepStartPart

func (t *Part) FromStepStartPart(v StepStartPart) error

FromStepStartPart overwrites any union data inside the Part as the provided StepStartPart

func (*Part) FromSubtaskPart

func (t *Part) FromSubtaskPart(v SubtaskPart) error

FromSubtaskPart overwrites any union data inside the Part as the provided SubtaskPart

func (*Part) FromTextPart

func (t *Part) FromTextPart(v TextPart) error

FromTextPart overwrites any union data inside the Part as the provided TextPart

func (*Part) FromToolPart

func (t *Part) FromToolPart(v ToolPart) error

FromToolPart overwrites any union data inside the Part as the provided ToolPart

func (Part) MarshalJSON

func (t Part) MarshalJSON() ([]byte, error)

func (*Part) MergeAgentPart

func (t *Part) MergeAgentPart(v AgentPart) error

MergeAgentPart performs a merge with any union data inside the Part, using the provided AgentPart

func (*Part) MergeCompactionPart

func (t *Part) MergeCompactionPart(v CompactionPart) error

MergeCompactionPart performs a merge with any union data inside the Part, using the provided CompactionPart

func (*Part) MergeFilePart

func (t *Part) MergeFilePart(v FilePart) error

MergeFilePart performs a merge with any union data inside the Part, using the provided FilePart

func (*Part) MergePatchPart

func (t *Part) MergePatchPart(v PatchPart) error

MergePatchPart performs a merge with any union data inside the Part, using the provided PatchPart

func (*Part) MergeReasoningPart

func (t *Part) MergeReasoningPart(v ReasoningPart) error

MergeReasoningPart performs a merge with any union data inside the Part, using the provided ReasoningPart

func (*Part) MergeRetryPart

func (t *Part) MergeRetryPart(v RetryPart) error

MergeRetryPart performs a merge with any union data inside the Part, using the provided RetryPart

func (*Part) MergeSnapshotPart

func (t *Part) MergeSnapshotPart(v SnapshotPart) error

MergeSnapshotPart performs a merge with any union data inside the Part, using the provided SnapshotPart

func (*Part) MergeStepFinishPart

func (t *Part) MergeStepFinishPart(v StepFinishPart) error

MergeStepFinishPart performs a merge with any union data inside the Part, using the provided StepFinishPart

func (*Part) MergeStepStartPart

func (t *Part) MergeStepStartPart(v StepStartPart) error

MergeStepStartPart performs a merge with any union data inside the Part, using the provided StepStartPart

func (*Part) MergeSubtaskPart

func (t *Part) MergeSubtaskPart(v SubtaskPart) error

MergeSubtaskPart performs a merge with any union data inside the Part, using the provided SubtaskPart

func (*Part) MergeTextPart

func (t *Part) MergeTextPart(v TextPart) error

MergeTextPart performs a merge with any union data inside the Part, using the provided TextPart

func (*Part) MergeToolPart

func (t *Part) MergeToolPart(v ToolPart) error

MergeToolPart performs a merge with any union data inside the Part, using the provided ToolPart

func (*Part) UnmarshalJSON

func (t *Part) UnmarshalJSON(b []byte) error

type PatchPart

type PatchPart struct {
	Files     []string      `json:"files"`
	Hash      string        `json:"hash"`
	Id        string        `json:"id"`
	MessageID string        `json:"messageID"`
	SessionID string        `json:"sessionID"`
	Type      PatchPartType `json:"type"`
}

PatchPart defines model for PatchPart.

type PatchPartType

type PatchPartType string

PatchPartType defines model for PatchPart.Type.

const (
	Patch PatchPartType = "patch"
)

Defines values for PatchPartType.

func (PatchPartType) Valid

func (e PatchPartType) Valid() bool

Valid indicates whether the value is a known member of the PatchPartType enum.

type PermissionAction

type PermissionAction string

PermissionAction defines model for PermissionAction.

const (
	Allow PermissionAction = "allow"
	Ask   PermissionAction = "ask"
	Deny  PermissionAction = "deny"
)

Defines values for PermissionAction.

func (PermissionAction) Valid

func (e PermissionAction) Valid() bool

Valid indicates whether the value is a known member of the PermissionAction enum.

type PermissionRule

type PermissionRule struct {
	Action     PermissionAction `json:"action"`
	Pattern    string           `json:"pattern"`
	Permission string           `json:"permission"`
}

PermissionRule defines model for PermissionRule.

type PermissionRuleset

type PermissionRuleset = []PermissionRule

PermissionRuleset defines model for PermissionRuleset.

type PromptInput

type PromptInput struct {
	MessageID *string          `json:"messageID,omitempty"`
	Model     *PromptModel     `json:"model,omitempty"`
	Agent     *string          `json:"agent,omitempty"`
	NoReply   *bool            `json:"noReply,omitempty"`
	Tools     *map[string]bool `json:"tools,omitempty"`
	Format    *OutputFormat    `json:"format,omitempty"`
	System    *string          `json:"system,omitempty"`
	Variant   *string          `json:"variant,omitempty"`
	Parts     []TextPartInput  `json:"parts"`
}

PromptInput is the text-only inline request body used by the Gimbal adapter. OutputFormat and TextPartInput are generated from their upstream components.

type PromptModel

type PromptModel struct {
	ProviderID string `json:"providerID"`
	ModelID    string `json:"modelID"`
}

PromptModel selects the provider and model for one prompt.

type PromptResponse

type PromptResponse struct {
	Info  AssistantMessage `json:"info"`
	Parts []Part           `json:"parts"`
}

PromptResponse is the small inline response envelope of the synchronous prompt endpoint. Its message and part unions are generated upstream types.

type ProviderAuthError

type ProviderAuthError struct {
	Data struct {
		Message    string `json:"message"`
		ProviderID string `json:"providerID"`
	} `json:"data"`
	Name ProviderAuthErrorName `json:"name"`
}

ProviderAuthError defines model for ProviderAuthError.

type ProviderAuthErrorName

type ProviderAuthErrorName string

ProviderAuthErrorName defines model for ProviderAuthError.Name.

const (
	ProviderAuthErrorNameProviderAuthError ProviderAuthErrorName = "ProviderAuthError"
)

Defines values for ProviderAuthErrorName.

func (ProviderAuthErrorName) Valid

func (e ProviderAuthErrorName) Valid() bool

Valid indicates whether the value is a known member of the ProviderAuthErrorName enum.

type Range

type Range struct {
	End struct {
		Character int `json:"character"`
		Line      int `json:"line"`
	} `json:"end"`
	Start struct {
		Character int `json:"character"`
		Line      int `json:"line"`
	} `json:"start"`
}

Range defines model for Range.

type RawEvent

type RawEvent struct {
	Directory string          `json:"directory,omitempty"`
	Project   string          `json:"project,omitempty"`
	Workspace string          `json:"workspace,omitempty"`
	Payload   json.RawMessage `json:"payload"`
	Raw       json.RawMessage `json:"-"`
	Malformed string          `json:"-"`
}

RawEvent is one JSON value received from OpenCode's process-wide SSE stream. Raw is retained verbatim so later normalization cannot discard an event or a field that OpenCode sent.

type ReasoningPart

type ReasoningPart struct {
	Id        string                  `json:"id"`
	MessageID string                  `json:"messageID"`
	Metadata  *map[string]interface{} `json:"metadata,omitempty"`
	SessionID string                  `json:"sessionID"`
	Text      string                  `json:"text"`
	Time      struct {
		End   *int `json:"end,omitempty"`
		Start int  `json:"start"`
	} `json:"time"`
	Type ReasoningPartType `json:"type"`
}

ReasoningPart defines model for ReasoningPart.

type ReasoningPartType

type ReasoningPartType string

ReasoningPartType defines model for ReasoningPart.Type.

const (
	Reasoning ReasoningPartType = "reasoning"
)

Defines values for ReasoningPartType.

func (ReasoningPartType) Valid

func (e ReasoningPartType) Valid() bool

Valid indicates whether the value is a known member of the ReasoningPartType enum.

type ResourceSource

type ResourceSource struct {
	ClientName string             `json:"clientName"`
	Text       FilePartSourceText `json:"text"`
	Type       ResourceSourceType `json:"type"`
	Uri        string             `json:"uri"`
}

ResourceSource defines model for ResourceSource.

type ResourceSourceType

type ResourceSourceType string

ResourceSourceType defines model for ResourceSource.Type.

const (
	Resource ResourceSourceType = "resource"
)

Defines values for ResourceSourceType.

func (ResourceSourceType) Valid

func (e ResourceSourceType) Valid() bool

Valid indicates whether the value is a known member of the ResourceSourceType enum.

type RetryPart

type RetryPart struct {
	Attempt   int      `json:"attempt"`
	Error     APIError `json:"error"`
	Id        string   `json:"id"`
	MessageID string   `json:"messageID"`
	SessionID string   `json:"sessionID"`
	Time      struct {
		Created int `json:"created"`
	} `json:"time"`
	Type RetryPartType `json:"type"`
}

RetryPart defines model for RetryPart.

type RetryPartType

type RetryPartType string

RetryPartType defines model for RetryPart.Type.

const (
	RetryPartTypeRetry RetryPartType = "retry"
)

Defines values for RetryPartType.

func (RetryPartType) Valid

func (e RetryPartType) Valid() bool

Valid indicates whether the value is a known member of the RetryPartType enum.

type ServerInfo

type ServerInfo struct {
	URL     string
	PID     int
	Started bool
}

ServerInfo is the non-secret discovery information reported by lifecycle commands. Started is false when an existing healthy server was reused.

func StartServer

func StartServer(ctx context.Context, stateDir string) (ServerInfo, error)

StartServer starts the shared server or returns the healthy server already recorded in stateDir. An empty stateDir uses DefaultStateDir.

type Session

type Session struct {
	Agent     *string                 `json:"agent,omitempty"`
	Cost      *float32                `json:"cost,omitempty"`
	Directory string                  `json:"directory"`
	Id        string                  `json:"id"`
	Metadata  *map[string]interface{} `json:"metadata,omitempty"`
	Model     *struct {
		Id         string  `json:"id"`
		ProviderID string  `json:"providerID"`
		Variant    *string `json:"variant,omitempty"`
	} `json:"model,omitempty"`
	ParentID   *string            `json:"parentID,omitempty"`
	Path       *string            `json:"path,omitempty"`
	Permission *PermissionRuleset `json:"permission,omitempty"`
	ProjectID  string             `json:"projectID"`
	Revert     *struct {
		Diff      *string `json:"diff,omitempty"`
		MessageID string  `json:"messageID"`
		PartID    *string `json:"partID,omitempty"`
		Snapshot  *string `json:"snapshot,omitempty"`
	} `json:"revert,omitempty"`
	Share *struct {
		Url string `json:"url"`
	} `json:"share,omitempty"`
	Slug    string `json:"slug"`
	Summary *struct {
		Additions float32             `json:"additions"`
		Deletions float32             `json:"deletions"`
		Diffs     *[]SnapshotFileDiff `json:"diffs,omitempty"`
		Files     float32             `json:"files"`
	} `json:"summary,omitempty"`
	Time struct {
		Archived   *float32 `json:"archived,omitempty"`
		Compacting *int     `json:"compacting,omitempty"`
		Created    int      `json:"created"`
		Updated    int      `json:"updated"`
	} `json:"time"`
	Title  string `json:"title"`
	Tokens *struct {
		Cache struct {
			Read  float32 `json:"read"`
			Write float32 `json:"write"`
		} `json:"cache"`
		Input     float32 `json:"input"`
		Output    float32 `json:"output"`
		Reasoning float32 `json:"reasoning"`
	} `json:"tokens,omitempty"`
	Version     string  `json:"version"`
	WorkspaceID *string `json:"workspaceID,omitempty"`
}

Session defines model for Session.

type SessionCreateInput

type SessionCreateInput struct {
	Title *string       `json:"title,omitempty"`
	Agent *string       `json:"agent,omitempty"`
	Model *SessionModel `json:"model,omitempty"`
}

SessionCreateInput is the small inline request body of POST /session. The response itself uses the generated upstream Session component.

type SessionModel

type SessionModel struct {
	ID         string  `json:"id"`
	ProviderID string  `json:"providerID"`
	Variant    *string `json:"variant,omitempty"`
}

SessionModel selects the initial model on a newly created session.

type SessionStatus

type SessionStatus struct {
	// contains filtered or unexported fields
}

SessionStatus defines model for SessionStatus.

func (SessionStatus) AsSessionStatus0

func (t SessionStatus) AsSessionStatus0() (SessionStatus0, error)

AsSessionStatus0 returns the union data inside the SessionStatus as a SessionStatus0

func (SessionStatus) AsSessionStatus1

func (t SessionStatus) AsSessionStatus1() (SessionStatus1, error)

AsSessionStatus1 returns the union data inside the SessionStatus as a SessionStatus1

func (SessionStatus) AsSessionStatus2

func (t SessionStatus) AsSessionStatus2() (SessionStatus2, error)

AsSessionStatus2 returns the union data inside the SessionStatus as a SessionStatus2

func (*SessionStatus) FromSessionStatus0

func (t *SessionStatus) FromSessionStatus0(v SessionStatus0) error

FromSessionStatus0 overwrites any union data inside the SessionStatus as the provided SessionStatus0

func (*SessionStatus) FromSessionStatus1

func (t *SessionStatus) FromSessionStatus1(v SessionStatus1) error

FromSessionStatus1 overwrites any union data inside the SessionStatus as the provided SessionStatus1

func (*SessionStatus) FromSessionStatus2

func (t *SessionStatus) FromSessionStatus2(v SessionStatus2) error

FromSessionStatus2 overwrites any union data inside the SessionStatus as the provided SessionStatus2

func (SessionStatus) MarshalJSON

func (t SessionStatus) MarshalJSON() ([]byte, error)

func (*SessionStatus) MergeSessionStatus0

func (t *SessionStatus) MergeSessionStatus0(v SessionStatus0) error

MergeSessionStatus0 performs a merge with any union data inside the SessionStatus, using the provided SessionStatus0

func (*SessionStatus) MergeSessionStatus1

func (t *SessionStatus) MergeSessionStatus1(v SessionStatus1) error

MergeSessionStatus1 performs a merge with any union data inside the SessionStatus, using the provided SessionStatus1

func (*SessionStatus) MergeSessionStatus2

func (t *SessionStatus) MergeSessionStatus2(v SessionStatus2) error

MergeSessionStatus2 performs a merge with any union data inside the SessionStatus, using the provided SessionStatus2

func (*SessionStatus) UnmarshalJSON

func (t *SessionStatus) UnmarshalJSON(b []byte) error

type SessionStatus0

type SessionStatus0 struct {
	Type SessionStatus0Type `json:"type"`
}

SessionStatus0 defines model for SessionStatus.0.

type SessionStatus0Type

type SessionStatus0Type string

SessionStatus0Type defines model for SessionStatus.0.Type.

const (
	Idle SessionStatus0Type = "idle"
)

Defines values for SessionStatus0Type.

func (SessionStatus0Type) Valid

func (e SessionStatus0Type) Valid() bool

Valid indicates whether the value is a known member of the SessionStatus0Type enum.

type SessionStatus1

type SessionStatus1 struct {
	Action *struct {
		Label    string  `json:"label"`
		Link     *string `json:"link,omitempty"`
		Message  string  `json:"message"`
		Provider string  `json:"provider"`
		Reason   string  `json:"reason"`
		Title    string  `json:"title"`
	} `json:"action,omitempty"`
	Attempt int                `json:"attempt"`
	Message string             `json:"message"`
	Next    int                `json:"next"`
	Type    SessionStatus1Type `json:"type"`
}

SessionStatus1 defines model for SessionStatus.1.

type SessionStatus1Type

type SessionStatus1Type string

SessionStatus1Type defines model for SessionStatus.1.Type.

const (
	SessionStatus1TypeRetry SessionStatus1Type = "retry"
)

Defines values for SessionStatus1Type.

func (SessionStatus1Type) Valid

func (e SessionStatus1Type) Valid() bool

Valid indicates whether the value is a known member of the SessionStatus1Type enum.

type SessionStatus2

type SessionStatus2 struct {
	Type SessionStatus2Type `json:"type"`
}

SessionStatus2 defines model for SessionStatus.2.

type SessionStatus2Type

type SessionStatus2Type string

SessionStatus2Type defines model for SessionStatus.2.Type.

const (
	Busy SessionStatus2Type = "busy"
)

Defines values for SessionStatus2Type.

func (SessionStatus2Type) Valid

func (e SessionStatus2Type) Valid() bool

Valid indicates whether the value is a known member of the SessionStatus2Type enum.

type SnapshotFileDiff

type SnapshotFileDiff struct {
	Additions float32                 `json:"additions"`
	Deletions float32                 `json:"deletions"`
	File      *string                 `json:"file,omitempty"`
	Patch     *string                 `json:"patch,omitempty"`
	Status    *SnapshotFileDiffStatus `json:"status,omitempty"`
}

SnapshotFileDiff defines model for SnapshotFileDiff.

type SnapshotFileDiffStatus

type SnapshotFileDiffStatus string

SnapshotFileDiffStatus defines model for SnapshotFileDiff.Status.

const (
	Added    SnapshotFileDiffStatus = "added"
	Deleted  SnapshotFileDiffStatus = "deleted"
	Modified SnapshotFileDiffStatus = "modified"
)

Defines values for SnapshotFileDiffStatus.

func (SnapshotFileDiffStatus) Valid

func (e SnapshotFileDiffStatus) Valid() bool

Valid indicates whether the value is a known member of the SnapshotFileDiffStatus enum.

type SnapshotPart

type SnapshotPart struct {
	Id        string           `json:"id"`
	MessageID string           `json:"messageID"`
	SessionID string           `json:"sessionID"`
	Snapshot  string           `json:"snapshot"`
	Type      SnapshotPartType `json:"type"`
}

SnapshotPart defines model for SnapshotPart.

type SnapshotPartType

type SnapshotPartType string

SnapshotPartType defines model for SnapshotPart.Type.

const (
	Snapshot SnapshotPartType = "snapshot"
)

Defines values for SnapshotPartType.

func (SnapshotPartType) Valid

func (e SnapshotPartType) Valid() bool

Valid indicates whether the value is a known member of the SnapshotPartType enum.

type StepFinishPart

type StepFinishPart struct {
	Cost      float32 `json:"cost"`
	Id        string  `json:"id"`
	MessageID string  `json:"messageID"`
	Reason    string  `json:"reason"`
	SessionID string  `json:"sessionID"`
	Snapshot  *string `json:"snapshot,omitempty"`
	Tokens    struct {
		Cache struct {
			Read  float32 `json:"read"`
			Write float32 `json:"write"`
		} `json:"cache"`
		Input     float32  `json:"input"`
		Output    float32  `json:"output"`
		Reasoning float32  `json:"reasoning"`
		Total     *float32 `json:"total,omitempty"`
	} `json:"tokens"`
	Type StepFinishPartType `json:"type"`
}

StepFinishPart defines model for StepFinishPart.

type StepFinishPartType

type StepFinishPartType string

StepFinishPartType defines model for StepFinishPart.Type.

const (
	StepFinish StepFinishPartType = "step-finish"
)

Defines values for StepFinishPartType.

func (StepFinishPartType) Valid

func (e StepFinishPartType) Valid() bool

Valid indicates whether the value is a known member of the StepFinishPartType enum.

type StepStartPart

type StepStartPart struct {
	Id        string            `json:"id"`
	MessageID string            `json:"messageID"`
	SessionID string            `json:"sessionID"`
	Snapshot  *string           `json:"snapshot,omitempty"`
	Type      StepStartPartType `json:"type"`
}

StepStartPart defines model for StepStartPart.

type StepStartPartType

type StepStartPartType string

StepStartPartType defines model for StepStartPart.Type.

const (
	StepStart StepStartPartType = "step-start"
)

Defines values for StepStartPartType.

func (StepStartPartType) Valid

func (e StepStartPartType) Valid() bool

Valid indicates whether the value is a known member of the StepStartPartType enum.

type StructuredOutputError

type StructuredOutputError struct {
	Data struct {
		Message string `json:"message"`
		Retries int    `json:"retries"`
	} `json:"data"`
	Name StructuredOutputErrorName `json:"name"`
}

StructuredOutputError defines model for StructuredOutputError.

type StructuredOutputErrorName

type StructuredOutputErrorName string

StructuredOutputErrorName defines model for StructuredOutputError.Name.

const (
	StructuredOutputErrorNameStructuredOutputError StructuredOutputErrorName = "StructuredOutputError"
)

Defines values for StructuredOutputErrorName.

func (StructuredOutputErrorName) Valid

func (e StructuredOutputErrorName) Valid() bool

Valid indicates whether the value is a known member of the StructuredOutputErrorName enum.

type SubtaskPart

type SubtaskPart struct {
	Agent       string  `json:"agent"`
	Command     *string `json:"command,omitempty"`
	Description string  `json:"description"`
	Id          string  `json:"id"`
	MessageID   string  `json:"messageID"`
	Model       *struct {
		ModelID    string `json:"modelID"`
		ProviderID string `json:"providerID"`
	} `json:"model,omitempty"`
	Prompt    string          `json:"prompt"`
	SessionID string          `json:"sessionID"`
	Type      SubtaskPartType `json:"type"`
}

SubtaskPart defines model for SubtaskPart.

type SubtaskPartInput

type SubtaskPartInput struct {
	Agent       string  `json:"agent"`
	Command     *string `json:"command,omitempty"`
	Description string  `json:"description"`
	Id          *string `json:"id,omitempty"`
	Model       *struct {
		ModelID    string `json:"modelID"`
		ProviderID string `json:"providerID"`
	} `json:"model,omitempty"`
	Prompt string               `json:"prompt"`
	Type   SubtaskPartInputType `json:"type"`
}

SubtaskPartInput defines model for SubtaskPartInput.

type SubtaskPartInputType

type SubtaskPartInputType string

SubtaskPartInputType defines model for SubtaskPartInput.Type.

const (
	SubtaskPartInputTypeSubtask SubtaskPartInputType = "subtask"
)

Defines values for SubtaskPartInputType.

func (SubtaskPartInputType) Valid

func (e SubtaskPartInputType) Valid() bool

Valid indicates whether the value is a known member of the SubtaskPartInputType enum.

type SubtaskPartType

type SubtaskPartType string

SubtaskPartType defines model for SubtaskPart.Type.

const (
	SubtaskPartTypeSubtask SubtaskPartType = "subtask"
)

Defines values for SubtaskPartType.

func (SubtaskPartType) Valid

func (e SubtaskPartType) Valid() bool

Valid indicates whether the value is a known member of the SubtaskPartType enum.

type SymbolSource

type SymbolSource struct {
	Kind  int                `json:"kind"`
	Name  string             `json:"name"`
	Path  string             `json:"path"`
	Range Range              `json:"range"`
	Text  FilePartSourceText `json:"text"`
	Type  SymbolSourceType   `json:"type"`
}

SymbolSource defines model for SymbolSource.

type SymbolSourceType

type SymbolSourceType string

SymbolSourceType defines model for SymbolSource.Type.

const (
	Symbol SymbolSourceType = "symbol"
)

Defines values for SymbolSourceType.

func (SymbolSourceType) Valid

func (e SymbolSourceType) Valid() bool

Valid indicates whether the value is a known member of the SymbolSourceType enum.

type TextPart

type TextPart struct {
	Id        string                  `json:"id"`
	Ignored   *bool                   `json:"ignored,omitempty"`
	MessageID string                  `json:"messageID"`
	Metadata  *map[string]interface{} `json:"metadata,omitempty"`
	SessionID string                  `json:"sessionID"`
	Synthetic *bool                   `json:"synthetic,omitempty"`
	Text      string                  `json:"text"`
	Time      *struct {
		End   *int `json:"end,omitempty"`
		Start int  `json:"start"`
	} `json:"time,omitempty"`
	Type TextPartType `json:"type"`
}

TextPart defines model for TextPart.

type TextPartInput

type TextPartInput struct {
	Id        *string                 `json:"id,omitempty"`
	Ignored   *bool                   `json:"ignored,omitempty"`
	Metadata  *map[string]interface{} `json:"metadata,omitempty"`
	Synthetic *bool                   `json:"synthetic,omitempty"`
	Text      string                  `json:"text"`
	Time      *struct {
		End   *int `json:"end,omitempty"`
		Start int  `json:"start"`
	} `json:"time,omitempty"`
	Type TextPartInputType `json:"type"`
}

TextPartInput defines model for TextPartInput.

type TextPartInputType

type TextPartInputType string

TextPartInputType defines model for TextPartInput.Type.

const (
	TextPartInputTypeText TextPartInputType = "text"
)

Defines values for TextPartInputType.

func (TextPartInputType) Valid

func (e TextPartInputType) Valid() bool

Valid indicates whether the value is a known member of the TextPartInputType enum.

type TextPartType

type TextPartType string

TextPartType defines model for TextPart.Type.

const (
	TextPartTypeText TextPartType = "text"
)

Defines values for TextPartType.

func (TextPartType) Valid

func (e TextPartType) Valid() bool

Valid indicates whether the value is a known member of the TextPartType enum.

type ToolPart

type ToolPart struct {
	CallID    string                  `json:"callID"`
	Id        string                  `json:"id"`
	MessageID string                  `json:"messageID"`
	Metadata  *map[string]interface{} `json:"metadata,omitempty"`
	SessionID string                  `json:"sessionID"`
	State     ToolState               `json:"state"`
	Tool      string                  `json:"tool"`
	Type      ToolPartType            `json:"type"`
}

ToolPart defines model for ToolPart.

type ToolPartType

type ToolPartType string

ToolPartType defines model for ToolPart.Type.

const (
	Tool ToolPartType = "tool"
)

Defines values for ToolPartType.

func (ToolPartType) Valid

func (e ToolPartType) Valid() bool

Valid indicates whether the value is a known member of the ToolPartType enum.

type ToolState

type ToolState struct {
	// contains filtered or unexported fields
}

ToolState defines model for ToolState.

func (ToolState) AsToolStateCompleted

func (t ToolState) AsToolStateCompleted() (ToolStateCompleted, error)

AsToolStateCompleted returns the union data inside the ToolState as a ToolStateCompleted

func (ToolState) AsToolStateError

func (t ToolState) AsToolStateError() (ToolStateError, error)

AsToolStateError returns the union data inside the ToolState as a ToolStateError

func (ToolState) AsToolStatePending

func (t ToolState) AsToolStatePending() (ToolStatePending, error)

AsToolStatePending returns the union data inside the ToolState as a ToolStatePending

func (ToolState) AsToolStateRunning

func (t ToolState) AsToolStateRunning() (ToolStateRunning, error)

AsToolStateRunning returns the union data inside the ToolState as a ToolStateRunning

func (*ToolState) FromToolStateCompleted

func (t *ToolState) FromToolStateCompleted(v ToolStateCompleted) error

FromToolStateCompleted overwrites any union data inside the ToolState as the provided ToolStateCompleted

func (*ToolState) FromToolStateError

func (t *ToolState) FromToolStateError(v ToolStateError) error

FromToolStateError overwrites any union data inside the ToolState as the provided ToolStateError

func (*ToolState) FromToolStatePending

func (t *ToolState) FromToolStatePending(v ToolStatePending) error

FromToolStatePending overwrites any union data inside the ToolState as the provided ToolStatePending

func (*ToolState) FromToolStateRunning

func (t *ToolState) FromToolStateRunning(v ToolStateRunning) error

FromToolStateRunning overwrites any union data inside the ToolState as the provided ToolStateRunning

func (ToolState) MarshalJSON

func (t ToolState) MarshalJSON() ([]byte, error)

func (*ToolState) MergeToolStateCompleted

func (t *ToolState) MergeToolStateCompleted(v ToolStateCompleted) error

MergeToolStateCompleted performs a merge with any union data inside the ToolState, using the provided ToolStateCompleted

func (*ToolState) MergeToolStateError

func (t *ToolState) MergeToolStateError(v ToolStateError) error

MergeToolStateError performs a merge with any union data inside the ToolState, using the provided ToolStateError

func (*ToolState) MergeToolStatePending

func (t *ToolState) MergeToolStatePending(v ToolStatePending) error

MergeToolStatePending performs a merge with any union data inside the ToolState, using the provided ToolStatePending

func (*ToolState) MergeToolStateRunning

func (t *ToolState) MergeToolStateRunning(v ToolStateRunning) error

MergeToolStateRunning performs a merge with any union data inside the ToolState, using the provided ToolStateRunning

func (*ToolState) UnmarshalJSON

func (t *ToolState) UnmarshalJSON(b []byte) error

type ToolStateCompleted

type ToolStateCompleted struct {
	Attachments *[]FilePart              `json:"attachments,omitempty"`
	Input       map[string]interface{}   `json:"input"`
	Metadata    map[string]interface{}   `json:"metadata"`
	Output      string                   `json:"output"`
	Status      ToolStateCompletedStatus `json:"status"`
	Time        struct {
		Compacted *int `json:"compacted,omitempty"`
		End       int  `json:"end"`
		Start     int  `json:"start"`
	} `json:"time"`
	Title string `json:"title"`
}

ToolStateCompleted defines model for ToolStateCompleted.

type ToolStateCompletedStatus

type ToolStateCompletedStatus string

ToolStateCompletedStatus defines model for ToolStateCompleted.Status.

const (
	Completed ToolStateCompletedStatus = "completed"
)

Defines values for ToolStateCompletedStatus.

func (ToolStateCompletedStatus) Valid

func (e ToolStateCompletedStatus) Valid() bool

Valid indicates whether the value is a known member of the ToolStateCompletedStatus enum.

type ToolStateError

type ToolStateError struct {
	Error    string                  `json:"error"`
	Input    map[string]interface{}  `json:"input"`
	Metadata *map[string]interface{} `json:"metadata,omitempty"`
	Status   ToolStateErrorStatus    `json:"status"`
	Time     struct {
		End   int `json:"end"`
		Start int `json:"start"`
	} `json:"time"`
}

ToolStateError defines model for ToolStateError.

type ToolStateErrorStatus

type ToolStateErrorStatus string

ToolStateErrorStatus defines model for ToolStateError.Status.

const (
	Error ToolStateErrorStatus = "error"
)

Defines values for ToolStateErrorStatus.

func (ToolStateErrorStatus) Valid

func (e ToolStateErrorStatus) Valid() bool

Valid indicates whether the value is a known member of the ToolStateErrorStatus enum.

type ToolStatePending

type ToolStatePending struct {
	Input  map[string]interface{} `json:"input"`
	Raw    string                 `json:"raw"`
	Status ToolStatePendingStatus `json:"status"`
}

ToolStatePending defines model for ToolStatePending.

type ToolStatePendingStatus

type ToolStatePendingStatus string

ToolStatePendingStatus defines model for ToolStatePending.Status.

const (
	Pending ToolStatePendingStatus = "pending"
)

Defines values for ToolStatePendingStatus.

func (ToolStatePendingStatus) Valid

func (e ToolStatePendingStatus) Valid() bool

Valid indicates whether the value is a known member of the ToolStatePendingStatus enum.

type ToolStateRunning

type ToolStateRunning struct {
	Input    map[string]interface{}  `json:"input"`
	Metadata *map[string]interface{} `json:"metadata,omitempty"`
	Status   ToolStateRunningStatus  `json:"status"`
	Time     struct {
		Start int `json:"start"`
	} `json:"time"`
	Title *string `json:"title,omitempty"`
}

ToolStateRunning defines model for ToolStateRunning.

type ToolStateRunningStatus

type ToolStateRunningStatus string

ToolStateRunningStatus defines model for ToolStateRunning.Status.

const (
	Running ToolStateRunningStatus = "running"
)

Defines values for ToolStateRunningStatus.

func (ToolStateRunningStatus) Valid

func (e ToolStateRunningStatus) Valid() bool

Valid indicates whether the value is a known member of the ToolStateRunningStatus enum.

type UnknownError

type UnknownError struct {
	Data struct {
		Message string  `json:"message"`
		Ref     *string `json:"ref,omitempty"`
	} `json:"data"`
	Name UnknownErrorName `json:"name"`
}

UnknownError defines model for UnknownError.

type UnknownErrorName

type UnknownErrorName string

UnknownErrorName defines model for UnknownError.Name.

const (
	UnknownErrorNameUnknownError UnknownErrorName = "UnknownError"
)

Defines values for UnknownErrorName.

func (UnknownErrorName) Valid

func (e UnknownErrorName) Valid() bool

Valid indicates whether the value is a known member of the UnknownErrorName enum.

type UserMessage

type UserMessage struct {
	Agent  string        `json:"agent"`
	Format *OutputFormat `json:"format,omitempty"`
	Id     string        `json:"id"`
	Model  struct {
		ModelID    string  `json:"modelID"`
		ProviderID string  `json:"providerID"`
		Variant    *string `json:"variant,omitempty"`
	} `json:"model"`
	Role      UserMessageRole `json:"role"`
	SessionID string          `json:"sessionID"`
	Summary   *struct {
		Body  *string            `json:"body,omitempty"`
		Diffs []SnapshotFileDiff `json:"diffs"`
		Title *string            `json:"title,omitempty"`
	} `json:"summary,omitempty"`
	System *string `json:"system,omitempty"`
	Time   struct {
		Created float32 `json:"created"`
	} `json:"time"`
	Tools *map[string]bool `json:"tools,omitempty"`
}

UserMessage defines model for UserMessage.

type UserMessageRole

type UserMessageRole string

UserMessageRole defines model for UserMessage.Role.

const (
	User UserMessageRole = "user"
)

Defines values for UserMessageRole.

func (UserMessageRole) Valid

func (e UserMessageRole) Valid() bool

Valid indicates whether the value is a known member of the UserMessageRole enum.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL