Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type Action
- type ActionParam
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type Error
- type ModelConfigModelConfigObjectParam
- type ModelConfigUnionParam
- type SessionActParams
- type SessionActParamsInputUnion
- type SessionActParamsOptions
- type SessionActParamsXLanguage
- type SessionActParamsXStreamResponse
- type SessionActResponse
- type SessionActResponseData
- type SessionActResponseDataResult
- type SessionEndParams
- type SessionEndParamsXLanguage
- type SessionEndParamsXStreamResponse
- type SessionEndResponse
- type SessionExecuteParams
- type SessionExecuteParamsAgentConfig
- type SessionExecuteParamsExecuteOptions
- type SessionExecuteParamsXLanguage
- type SessionExecuteParamsXStreamResponse
- type SessionExecuteResponse
- type SessionExecuteResponseData
- type SessionExecuteResponseDataResult
- type SessionExecuteResponseDataResultAction
- type SessionExecuteResponseDataResultUsage
- type SessionExtractParams
- type SessionExtractParamsOptions
- type SessionExtractParamsXLanguage
- type SessionExtractParamsXStreamResponse
- type SessionExtractResponse
- type SessionExtractResponseData
- type SessionNavigateParams
- type SessionNavigateParamsOptions
- type SessionNavigateParamsXLanguage
- type SessionNavigateParamsXStreamResponse
- type SessionNavigateResponse
- type SessionNavigateResponseData
- type SessionObserveParams
- type SessionObserveParamsOptions
- type SessionObserveParamsXLanguage
- type SessionObserveParamsXStreamResponse
- type SessionObserveResponse
- type SessionObserveResponseData
- type SessionService
- func (r *SessionService) Act(ctx context.Context, id string, params SessionActParams, ...) (res *SessionActResponse, err error)
- func (r *SessionService) ActStreaming(ctx context.Context, id string, params SessionActParams, ...) (stream *ssestream.Stream[StreamEvent])
- func (r *SessionService) End(ctx context.Context, id string, body SessionEndParams, ...) (res *SessionEndResponse, err error)
- func (r *SessionService) Execute(ctx context.Context, id string, params SessionExecuteParams, ...) (res *SessionExecuteResponse, err error)
- func (r *SessionService) ExecuteStreaming(ctx context.Context, id string, params SessionExecuteParams, ...) (stream *ssestream.Stream[StreamEvent])
- func (r *SessionService) Extract(ctx context.Context, id string, params SessionExtractParams, ...) (res *SessionExtractResponse, err error)
- func (r *SessionService) ExtractStreaming(ctx context.Context, id string, params SessionExtractParams, ...) (stream *ssestream.Stream[StreamEvent])
- func (r *SessionService) Navigate(ctx context.Context, id string, params SessionNavigateParams, ...) (res *SessionNavigateResponse, err error)
- func (r *SessionService) Observe(ctx context.Context, id string, params SessionObserveParams, ...) (res *SessionObserveResponse, err error)
- func (r *SessionService) ObserveStreaming(ctx context.Context, id string, params SessionObserveParams, ...) (stream *ssestream.Stream[StreamEvent])
- func (r *SessionService) Start(ctx context.Context, params SessionStartParams, opts ...option.RequestOption) (res *SessionStartResponse, err error)
- type SessionStartParams
- type SessionStartParamsBrowser
- type SessionStartParamsBrowserLaunchOptions
- type SessionStartParamsBrowserLaunchOptionsIgnoreDefaultArgsUnion
- type SessionStartParamsBrowserLaunchOptionsProxy
- type SessionStartParamsBrowserLaunchOptionsViewport
- type SessionStartParamsBrowserbaseSessionCreateParams
- type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettings
- type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsContext
- type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprint
- type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprintScreen
- type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsViewport
- type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbase
- type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbaseGeolocation
- type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemExternal
- type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion
- func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetDomainPattern() *string
- func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetGeolocation() ...
- func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetPassword() *string
- func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetServer() *string
- func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetType() *string
- func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetUsername() *string
- func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) MarshalJSON() ([]byte, error)
- func (u *SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) UnmarshalJSON(data []byte) error
- type SessionStartParamsBrowserbaseSessionCreateParamsProxiesUnion
- type SessionStartParamsXLanguage
- type SessionStartParamsXStreamResponse
- type SessionStartResponse
- type SessionStartResponseData
- type StreamEvent
- type StreamEventDataStreamEventLogDataOutput
- type StreamEventDataStreamEventSystemDataOutput
- type StreamEventDataUnion
- func (u StreamEventDataUnion) AsStreamEventDataStreamEventLogDataOutput() (v StreamEventDataStreamEventLogDataOutput)
- func (u StreamEventDataUnion) AsStreamEventDataStreamEventSystemDataOutput() (v StreamEventDataStreamEventSystemDataOutput)
- func (u StreamEventDataUnion) RawJSON() string
- func (r *StreamEventDataUnion) UnmarshalJSON(data []byte) error
- type StreamEventType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (BROWSERBASE_API_KEY, MODEL_API_KEY, BROWSERBASE_PROJECT_ID, STAGEHAND_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Action ¶
type Action struct {
// Human-readable description of the action
Description string `json:"description,required"`
// CSS selector or XPath for the element
Selector string `json:"selector,required"`
// Arguments to pass to the method
Arguments []string `json:"arguments"`
// The method to execute (click, fill, etc.)
Method string `json:"method"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Description respjson.Field
Selector respjson.Field
Arguments respjson.Field
Method respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Action object returned by observe and used by act
func (Action) ToParam ¶
func (r Action) ToParam() ActionParam
ToParam converts this Action to a ActionParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ActionParam.Overrides()
func (*Action) UnmarshalJSON ¶
type ActionParam ¶
type ActionParam struct {
// Human-readable description of the action
Description string `json:"description,required"`
// CSS selector or XPath for the element
Selector string `json:"selector,required"`
// The method to execute (click, fill, etc.)
Method param.Opt[string] `json:"method,omitzero"`
// Arguments to pass to the method
Arguments []string `json:"arguments,omitzero"`
// contains filtered or unexported fields
}
Action object returned by observe and used by act
The properties Description, Selector are required.
func (ActionParam) MarshalJSON ¶
func (r ActionParam) MarshalJSON() (data []byte, err error)
func (*ActionParam) UnmarshalJSON ¶
func (r *ActionParam) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct {
Options []option.RequestOption
Sessions SessionService
}
Client creates a struct with services and top level methods that help with interacting with the stagehand 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 (BROWSERBASE_API_KEY, MODEL_API_KEY, BROWSERBASE_PROJECT_ID, STAGEHAND_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned [url.Values] will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ModelConfigModelConfigObjectParam ¶ added in v0.11.0
type ModelConfigModelConfigObjectParam struct {
// Model name string without prefix (e.g., 'gpt-5-nano', 'claude-4.5-opus')
ModelName string `json:"modelName,required"`
// API key for the model provider
APIKey param.Opt[string] `json:"apiKey,omitzero"`
// Base URL for the model provider
BaseURL param.Opt[string] `json:"baseURL,omitzero" format:"uri"`
// contains filtered or unexported fields
}
The property ModelName is required.
func (ModelConfigModelConfigObjectParam) MarshalJSON ¶ added in v0.11.0
func (r ModelConfigModelConfigObjectParam) MarshalJSON() (data []byte, err error)
func (*ModelConfigModelConfigObjectParam) UnmarshalJSON ¶ added in v0.11.0
func (r *ModelConfigModelConfigObjectParam) UnmarshalJSON(data []byte) error
type ModelConfigUnionParam ¶ added in v0.9.0
type ModelConfigUnionParam struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfModelConfigModelConfigObject *ModelConfigModelConfigObjectParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func ModelConfigParamOfModelConfigModelConfigObject ¶ added in v0.11.0
func ModelConfigParamOfModelConfigModelConfigObject(modelName string) ModelConfigUnionParam
func (ModelConfigUnionParam) MarshalJSON ¶ added in v0.9.0
func (u ModelConfigUnionParam) MarshalJSON() ([]byte, error)
func (*ModelConfigUnionParam) UnmarshalJSON ¶ added in v0.9.0
func (u *ModelConfigUnionParam) UnmarshalJSON(data []byte) error
type SessionActParams ¶
type SessionActParams struct {
// Natural language instruction or Action object
Input SessionActParamsInputUnion `json:"input,omitzero,required"`
// Target frame ID for the action
FrameID param.Opt[string] `json:"frameId,omitzero"`
// Version of the Stagehand SDK
XSDKVersion param.Opt[string] `header:"x-sdk-version,omitzero" json:"-"`
// ISO timestamp when request was sent
XSentAt param.Opt[time.Time] `header:"x-sent-at,omitzero" format:"date-time" json:"-"`
Options SessionActParamsOptions `json:"options,omitzero"`
// Client SDK language
//
// Any of "typescript", "python", "playground".
XLanguage SessionActParamsXLanguage `header:"x-language,omitzero" json:"-"`
// Whether to stream the response via SSE
//
// Any of "true", "false".
XStreamResponse SessionActParamsXStreamResponse `header:"x-stream-response,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SessionActParams) MarshalJSON ¶
func (r SessionActParams) MarshalJSON() (data []byte, err error)
func (*SessionActParams) UnmarshalJSON ¶
func (r *SessionActParams) UnmarshalJSON(data []byte) error
type SessionActParamsInputUnion ¶
type SessionActParamsInputUnion struct {
OfString param.Opt[string] `json:",omitzero,inline"`
OfAction *ActionParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (SessionActParamsInputUnion) MarshalJSON ¶
func (u SessionActParamsInputUnion) MarshalJSON() ([]byte, error)
func (*SessionActParamsInputUnion) UnmarshalJSON ¶
func (u *SessionActParamsInputUnion) UnmarshalJSON(data []byte) error
type SessionActParamsOptions ¶
type SessionActParamsOptions struct {
// Timeout in ms for the action
Timeout param.Opt[float64] `json:"timeout,omitzero"`
// Model name string with provider prefix (e.g., 'openai/gpt-5-nano',
// 'anthropic/claude-4.5-opus')
Model ModelConfigUnionParam `json:"model,omitzero"`
// Variables to substitute in the action instruction
Variables map[string]string `json:"variables,omitzero"`
// contains filtered or unexported fields
}
func (SessionActParamsOptions) MarshalJSON ¶
func (r SessionActParamsOptions) MarshalJSON() (data []byte, err error)
func (*SessionActParamsOptions) UnmarshalJSON ¶
func (r *SessionActParamsOptions) UnmarshalJSON(data []byte) error
type SessionActParamsXLanguage ¶ added in v0.9.0
type SessionActParamsXLanguage string
Client SDK language
const ( SessionActParamsXLanguageTypescript SessionActParamsXLanguage = "typescript" SessionActParamsXLanguagePython SessionActParamsXLanguage = "python" SessionActParamsXLanguagePlayground SessionActParamsXLanguage = "playground" )
type SessionActParamsXStreamResponse ¶
type SessionActParamsXStreamResponse string
Whether to stream the response via SSE
const ( SessionActParamsXStreamResponseTrue SessionActParamsXStreamResponse = "true" SessionActParamsXStreamResponseFalse SessionActParamsXStreamResponse = "false" )
type SessionActResponse ¶
type SessionActResponse struct {
Data SessionActResponseData `json:"data,required"`
// Indicates whether the request was successful
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionActResponse) RawJSON ¶
func (r SessionActResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionActResponse) UnmarshalJSON ¶
func (r *SessionActResponse) UnmarshalJSON(data []byte) error
type SessionActResponseData ¶ added in v0.9.0
type SessionActResponseData struct {
Result SessionActResponseDataResult `json:"result,required"`
// Action ID for tracking
ActionID string `json:"actionId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Result respjson.Field
ActionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionActResponseData) RawJSON ¶ added in v0.9.0
func (r SessionActResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionActResponseData) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionActResponseData) UnmarshalJSON(data []byte) error
type SessionActResponseDataResult ¶ added in v0.9.0
type SessionActResponseDataResult struct {
// Description of the action that was performed
ActionDescription string `json:"actionDescription,required"`
// List of actions that were executed
Actions []Action `json:"actions,required"`
// Human-readable result message
Message string `json:"message,required"`
// Whether the action completed successfully
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ActionDescription respjson.Field
Actions respjson.Field
Message respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionActResponseDataResult) RawJSON ¶ added in v0.9.0
func (r SessionActResponseDataResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionActResponseDataResult) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionActResponseDataResult) UnmarshalJSON(data []byte) error
type SessionEndParams ¶ added in v0.5.0
type SessionEndParams struct {
// Version of the Stagehand SDK
XSDKVersion param.Opt[string] `header:"x-sdk-version,omitzero" json:"-"`
// ISO timestamp when request was sent
XSentAt param.Opt[time.Time] `header:"x-sent-at,omitzero" format:"date-time" json:"-"`
// Client SDK language
//
// Any of "typescript", "python", "playground".
XLanguage SessionEndParamsXLanguage `header:"x-language,omitzero" json:"-"`
// Whether to stream the response via SSE
//
// Any of "true", "false".
XStreamResponse SessionEndParamsXStreamResponse `header:"x-stream-response,omitzero" json:"-"`
// contains filtered or unexported fields
}
type SessionEndParamsXLanguage ¶ added in v0.9.0
type SessionEndParamsXLanguage string
Client SDK language
const ( SessionEndParamsXLanguageTypescript SessionEndParamsXLanguage = "typescript" SessionEndParamsXLanguagePython SessionEndParamsXLanguage = "python" SessionEndParamsXLanguagePlayground SessionEndParamsXLanguage = "playground" )
type SessionEndParamsXStreamResponse ¶ added in v0.9.0
type SessionEndParamsXStreamResponse string
Whether to stream the response via SSE
const ( SessionEndParamsXStreamResponseTrue SessionEndParamsXStreamResponse = "true" SessionEndParamsXStreamResponseFalse SessionEndParamsXStreamResponse = "false" )
type SessionEndResponse ¶
type SessionEndResponse struct {
// Indicates whether the request was successful
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionEndResponse) RawJSON ¶
func (r SessionEndResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionEndResponse) UnmarshalJSON ¶
func (r *SessionEndResponse) UnmarshalJSON(data []byte) error
type SessionExecuteParams ¶ added in v0.9.0
type SessionExecuteParams struct {
AgentConfig SessionExecuteParamsAgentConfig `json:"agentConfig,omitzero,required"`
ExecuteOptions SessionExecuteParamsExecuteOptions `json:"executeOptions,omitzero,required"`
// Target frame ID for the agent
FrameID param.Opt[string] `json:"frameId,omitzero"`
// Version of the Stagehand SDK
XSDKVersion param.Opt[string] `header:"x-sdk-version,omitzero" json:"-"`
// ISO timestamp when request was sent
XSentAt param.Opt[time.Time] `header:"x-sent-at,omitzero" format:"date-time" json:"-"`
// Client SDK language
//
// Any of "typescript", "python", "playground".
XLanguage SessionExecuteParamsXLanguage `header:"x-language,omitzero" json:"-"`
// Whether to stream the response via SSE
//
// Any of "true", "false".
XStreamResponse SessionExecuteParamsXStreamResponse `header:"x-stream-response,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SessionExecuteParams) MarshalJSON ¶ added in v0.9.0
func (r SessionExecuteParams) MarshalJSON() (data []byte, err error)
func (*SessionExecuteParams) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExecuteParams) UnmarshalJSON(data []byte) error
type SessionExecuteParamsAgentConfig ¶ added in v0.9.0
type SessionExecuteParamsAgentConfig struct {
// Enable Computer Use Agent mode
Cua param.Opt[bool] `json:"cua,omitzero"`
// Custom system prompt for the agent
SystemPrompt param.Opt[string] `json:"systemPrompt,omitzero"`
// Model name string with provider prefix (e.g., 'openai/gpt-5-nano',
// 'anthropic/claude-4.5-opus')
Model ModelConfigUnionParam `json:"model,omitzero"`
// contains filtered or unexported fields
}
func (SessionExecuteParamsAgentConfig) MarshalJSON ¶ added in v0.9.0
func (r SessionExecuteParamsAgentConfig) MarshalJSON() (data []byte, err error)
func (*SessionExecuteParamsAgentConfig) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExecuteParamsAgentConfig) UnmarshalJSON(data []byte) error
type SessionExecuteParamsExecuteOptions ¶ added in v0.9.0
type SessionExecuteParamsExecuteOptions struct {
// Natural language instruction for the agent
Instruction string `json:"instruction,required"`
// Whether to visually highlight the cursor during execution
HighlightCursor param.Opt[bool] `json:"highlightCursor,omitzero"`
// Maximum number of steps the agent can take
MaxSteps param.Opt[float64] `json:"maxSteps,omitzero"`
// contains filtered or unexported fields
}
The property Instruction is required.
func (SessionExecuteParamsExecuteOptions) MarshalJSON ¶ added in v0.9.0
func (r SessionExecuteParamsExecuteOptions) MarshalJSON() (data []byte, err error)
func (*SessionExecuteParamsExecuteOptions) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExecuteParamsExecuteOptions) UnmarshalJSON(data []byte) error
type SessionExecuteParamsXLanguage ¶ added in v0.9.0
type SessionExecuteParamsXLanguage string
Client SDK language
const ( SessionExecuteParamsXLanguageTypescript SessionExecuteParamsXLanguage = "typescript" SessionExecuteParamsXLanguagePython SessionExecuteParamsXLanguage = "python" SessionExecuteParamsXLanguagePlayground SessionExecuteParamsXLanguage = "playground" )
type SessionExecuteParamsXStreamResponse ¶ added in v0.9.0
type SessionExecuteParamsXStreamResponse string
Whether to stream the response via SSE
const ( SessionExecuteParamsXStreamResponseTrue SessionExecuteParamsXStreamResponse = "true" SessionExecuteParamsXStreamResponseFalse SessionExecuteParamsXStreamResponse = "false" )
type SessionExecuteResponse ¶ added in v0.9.0
type SessionExecuteResponse struct {
Data SessionExecuteResponseData `json:"data,required"`
// Indicates whether the request was successful
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionExecuteResponse) RawJSON ¶ added in v0.9.0
func (r SessionExecuteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionExecuteResponse) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExecuteResponse) UnmarshalJSON(data []byte) error
type SessionExecuteResponseData ¶ added in v0.9.0
type SessionExecuteResponseData struct {
Result SessionExecuteResponseDataResult `json:"result,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Result respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionExecuteResponseData) RawJSON ¶ added in v0.9.0
func (r SessionExecuteResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionExecuteResponseData) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExecuteResponseData) UnmarshalJSON(data []byte) error
type SessionExecuteResponseDataResult ¶ added in v0.9.0
type SessionExecuteResponseDataResult struct {
Actions []SessionExecuteResponseDataResultAction `json:"actions,required"`
// Whether the agent finished its task
Completed bool `json:"completed,required"`
// Summary of what the agent accomplished
Message string `json:"message,required"`
// Whether the agent completed successfully
Success bool `json:"success,required"`
Metadata map[string]any `json:"metadata"`
Usage SessionExecuteResponseDataResultUsage `json:"usage"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Actions respjson.Field
Completed respjson.Field
Message respjson.Field
Success respjson.Field
Metadata respjson.Field
Usage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionExecuteResponseDataResult) RawJSON ¶ added in v0.9.0
func (r SessionExecuteResponseDataResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionExecuteResponseDataResult) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExecuteResponseDataResult) UnmarshalJSON(data []byte) error
type SessionExecuteResponseDataResultAction ¶ added in v0.9.0
type SessionExecuteResponseDataResultAction struct {
// Type of action taken
Type string `json:"type,required"`
Action string `json:"action"`
Instruction string `json:"instruction"`
PageText string `json:"pageText"`
PageURL string `json:"pageUrl"`
// Agent's reasoning for taking this action
Reasoning string `json:"reasoning"`
TaskCompleted bool `json:"taskCompleted"`
// Time taken for this action in ms
TimeMs float64 `json:"timeMs"`
ExtraFields map[string]any `json:",extras"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Action respjson.Field
Instruction respjson.Field
PageText respjson.Field
PageURL respjson.Field
Reasoning respjson.Field
TaskCompleted respjson.Field
TimeMs respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionExecuteResponseDataResultAction) RawJSON ¶ added in v0.9.0
func (r SessionExecuteResponseDataResultAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionExecuteResponseDataResultAction) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExecuteResponseDataResultAction) UnmarshalJSON(data []byte) error
type SessionExecuteResponseDataResultUsage ¶ added in v0.9.0
type SessionExecuteResponseDataResultUsage struct {
InferenceTimeMs float64 `json:"inference_time_ms,required"`
InputTokens float64 `json:"input_tokens,required"`
OutputTokens float64 `json:"output_tokens,required"`
CachedInputTokens float64 `json:"cached_input_tokens"`
ReasoningTokens float64 `json:"reasoning_tokens"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
InferenceTimeMs respjson.Field
InputTokens respjson.Field
OutputTokens respjson.Field
CachedInputTokens respjson.Field
ReasoningTokens respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionExecuteResponseDataResultUsage) RawJSON ¶ added in v0.9.0
func (r SessionExecuteResponseDataResultUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionExecuteResponseDataResultUsage) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExecuteResponseDataResultUsage) UnmarshalJSON(data []byte) error
type SessionExtractParams ¶
type SessionExtractParams struct {
// Target frame ID for the extraction
FrameID param.Opt[string] `json:"frameId,omitzero"`
// Natural language instruction for what to extract
Instruction param.Opt[string] `json:"instruction,omitzero"`
// Version of the Stagehand SDK
XSDKVersion param.Opt[string] `header:"x-sdk-version,omitzero" json:"-"`
// ISO timestamp when request was sent
XSentAt param.Opt[time.Time] `header:"x-sent-at,omitzero" format:"date-time" json:"-"`
Options SessionExtractParamsOptions `json:"options,omitzero"`
// JSON Schema defining the structure of data to extract
Schema map[string]any `json:"schema,omitzero"`
// Client SDK language
//
// Any of "typescript", "python", "playground".
XLanguage SessionExtractParamsXLanguage `header:"x-language,omitzero" json:"-"`
// Whether to stream the response via SSE
//
// Any of "true", "false".
XStreamResponse SessionExtractParamsXStreamResponse `header:"x-stream-response,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SessionExtractParams) MarshalJSON ¶
func (r SessionExtractParams) MarshalJSON() (data []byte, err error)
func (*SessionExtractParams) UnmarshalJSON ¶
func (r *SessionExtractParams) UnmarshalJSON(data []byte) error
type SessionExtractParamsOptions ¶
type SessionExtractParamsOptions struct {
// CSS selector to scope extraction to a specific element
Selector param.Opt[string] `json:"selector,omitzero"`
// Timeout in ms for the extraction
Timeout param.Opt[float64] `json:"timeout,omitzero"`
// Model name string with provider prefix (e.g., 'openai/gpt-5-nano',
// 'anthropic/claude-4.5-opus')
Model ModelConfigUnionParam `json:"model,omitzero"`
// contains filtered or unexported fields
}
func (SessionExtractParamsOptions) MarshalJSON ¶
func (r SessionExtractParamsOptions) MarshalJSON() (data []byte, err error)
func (*SessionExtractParamsOptions) UnmarshalJSON ¶
func (r *SessionExtractParamsOptions) UnmarshalJSON(data []byte) error
type SessionExtractParamsXLanguage ¶ added in v0.9.0
type SessionExtractParamsXLanguage string
Client SDK language
const ( SessionExtractParamsXLanguageTypescript SessionExtractParamsXLanguage = "typescript" SessionExtractParamsXLanguagePython SessionExtractParamsXLanguage = "python" SessionExtractParamsXLanguagePlayground SessionExtractParamsXLanguage = "playground" )
type SessionExtractParamsXStreamResponse ¶
type SessionExtractParamsXStreamResponse string
Whether to stream the response via SSE
const ( SessionExtractParamsXStreamResponseTrue SessionExtractParamsXStreamResponse = "true" SessionExtractParamsXStreamResponseFalse SessionExtractParamsXStreamResponse = "false" )
type SessionExtractResponse ¶ added in v0.5.0
type SessionExtractResponse struct {
Data SessionExtractResponseData `json:"data,required"`
// Indicates whether the request was successful
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionExtractResponse) RawJSON ¶ added in v0.9.0
func (r SessionExtractResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionExtractResponse) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExtractResponse) UnmarshalJSON(data []byte) error
type SessionExtractResponseData ¶ added in v0.9.0
type SessionExtractResponseData struct {
// Extracted data matching the requested schema
Result any `json:"result,required"`
// Action ID for tracking
ActionID string `json:"actionId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Result respjson.Field
ActionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionExtractResponseData) RawJSON ¶ added in v0.9.0
func (r SessionExtractResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionExtractResponseData) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionExtractResponseData) UnmarshalJSON(data []byte) error
type SessionNavigateParams ¶
type SessionNavigateParams struct {
URL string `json:"url,required"`
FrameID param.Opt[string] `json:"frameId,omitzero"`
StreamResponse param.Opt[bool] `json:"streamResponse,omitzero"`
XSDKVersion param.Opt[string] `header:"x-sdk-version,omitzero" json:"-"`
// ISO timestamp when request was sent
//
// Any of "typescript", "python", "playground".
XLanguage SessionNavigateParamsXLanguage `header:"x-language,omitzero" json:"-"`
//
// Any of "true", "false".
XStreamResponse SessionNavigateParamsXStreamResponse `header:"x-stream-response,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SessionNavigateParams) MarshalJSON ¶
func (r SessionNavigateParams) MarshalJSON() (data []byte, err error)
func (*SessionNavigateParams) UnmarshalJSON ¶
func (r *SessionNavigateParams) UnmarshalJSON(data []byte) error
type SessionNavigateParamsOptions ¶
type SessionNavigateParamsOptions struct {
Referer param.Opt[string] `json:"referer,omitzero"`
Timeout param.Opt[float64] `json:"timeout,omitzero"`
//
// Any of "load", "domcontentloaded", "networkidle".
WaitUntil string `json:"waitUntil,omitzero"`
// contains filtered or unexported fields
}
func (SessionNavigateParamsOptions) MarshalJSON ¶
func (r SessionNavigateParamsOptions) MarshalJSON() (data []byte, err error)
func (*SessionNavigateParamsOptions) UnmarshalJSON ¶
func (r *SessionNavigateParamsOptions) UnmarshalJSON(data []byte) error
type SessionNavigateParamsXLanguage ¶ added in v0.9.0
type SessionNavigateParamsXLanguage string
Client SDK language
const ( )
type SessionNavigateParamsXStreamResponse ¶
type SessionNavigateParamsXStreamResponse string
Whether to stream the response via SSE
const ( )
type SessionNavigateResponse ¶
type SessionNavigateResponse struct {
Success bool `json:"success,required"`
JSON struct {
Data respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionNavigateResponse) RawJSON ¶
func (r SessionNavigateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionNavigateResponse) UnmarshalJSON ¶
func (r *SessionNavigateResponse) UnmarshalJSON(data []byte) error
type SessionNavigateResponseData ¶ added in v0.9.0
type SessionNavigateResponseData struct {
Result any `json:"result,required"`
ActionID string `json:"actionId"`
JSON struct {
Result respjson.Field
ActionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionNavigateResponseData) RawJSON ¶ added in v0.9.0
func (r SessionNavigateResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionNavigateResponseData) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionNavigateResponseData) UnmarshalJSON(data []byte) error
type SessionObserveParams ¶
type SessionObserveParams struct {
// Target frame ID for the observation
FrameID param.Opt[string] `json:"frameId,omitzero"`
// Natural language instruction for what actions to find
Instruction param.Opt[string] `json:"instruction,omitzero"`
// Version of the Stagehand SDK
XSDKVersion param.Opt[string] `header:"x-sdk-version,omitzero" json:"-"`
// ISO timestamp when request was sent
XSentAt param.Opt[time.Time] `header:"x-sent-at,omitzero" format:"date-time" json:"-"`
Options SessionObserveParamsOptions `json:"options,omitzero"`
// Client SDK language
//
// Any of "typescript", "python", "playground".
XLanguage SessionObserveParamsXLanguage `header:"x-language,omitzero" json:"-"`
// Whether to stream the response via SSE
//
// Any of "true", "false".
XStreamResponse SessionObserveParamsXStreamResponse `header:"x-stream-response,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SessionObserveParams) MarshalJSON ¶
func (r SessionObserveParams) MarshalJSON() (data []byte, err error)
func (*SessionObserveParams) UnmarshalJSON ¶
func (r *SessionObserveParams) UnmarshalJSON(data []byte) error
type SessionObserveParamsOptions ¶
type SessionObserveParamsOptions struct {
// CSS selector to scope observation to a specific element
Selector param.Opt[string] `json:"selector,omitzero"`
// Timeout in ms for the observation
Timeout param.Opt[float64] `json:"timeout,omitzero"`
// Model name string with provider prefix (e.g., 'openai/gpt-5-nano',
// 'anthropic/claude-4.5-opus')
Model ModelConfigUnionParam `json:"model,omitzero"`
// contains filtered or unexported fields
}
func (SessionObserveParamsOptions) MarshalJSON ¶
func (r SessionObserveParamsOptions) MarshalJSON() (data []byte, err error)
func (*SessionObserveParamsOptions) UnmarshalJSON ¶
func (r *SessionObserveParamsOptions) UnmarshalJSON(data []byte) error
type SessionObserveParamsXLanguage ¶ added in v0.9.0
type SessionObserveParamsXLanguage string
Client SDK language
const ( SessionObserveParamsXLanguageTypescript SessionObserveParamsXLanguage = "typescript" SessionObserveParamsXLanguagePython SessionObserveParamsXLanguage = "python" SessionObserveParamsXLanguagePlayground SessionObserveParamsXLanguage = "playground" )
type SessionObserveParamsXStreamResponse ¶
type SessionObserveParamsXStreamResponse string
Whether to stream the response via SSE
const ( SessionObserveParamsXStreamResponseTrue SessionObserveParamsXStreamResponse = "true" SessionObserveParamsXStreamResponseFalse SessionObserveParamsXStreamResponse = "false" )
type SessionObserveResponse ¶ added in v0.5.0
type SessionObserveResponse struct {
Data SessionObserveResponseData `json:"data,required"`
// Indicates whether the request was successful
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionObserveResponse) RawJSON ¶ added in v0.9.0
func (r SessionObserveResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionObserveResponse) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionObserveResponse) UnmarshalJSON(data []byte) error
type SessionObserveResponseData ¶ added in v0.9.0
type SessionObserveResponseData struct {
Result []Action `json:"result,required"`
// Action ID for tracking
ActionID string `json:"actionId"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Result respjson.Field
ActionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionObserveResponseData) RawJSON ¶ added in v0.9.0
func (r SessionObserveResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionObserveResponseData) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionObserveResponseData) UnmarshalJSON(data []byte) error
type SessionService ¶
type SessionService struct {
Options []option.RequestOption
}
SessionService contains methods and other services that help with interacting with the stagehand 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) Act ¶
func (r *SessionService) Act(ctx context.Context, id string, params SessionActParams, opts ...option.RequestOption) (res *SessionActResponse, err error)
Executes a browser action using natural language instructions or a predefined Action object.
func (*SessionService) ActStreaming ¶ added in v0.13.0
func (r *SessionService) ActStreaming(ctx context.Context, id string, params SessionActParams, opts ...option.RequestOption) (stream *ssestream.Stream[StreamEvent])
Executes a browser action using natural language instructions or a predefined Action object.
func (*SessionService) End ¶
func (r *SessionService) End(ctx context.Context, id string, body SessionEndParams, opts ...option.RequestOption) (res *SessionEndResponse, err error)
Terminates the browser session and releases all associated resources.
func (*SessionService) Execute ¶ added in v0.9.0
func (r *SessionService) Execute(ctx context.Context, id string, params SessionExecuteParams, opts ...option.RequestOption) (res *SessionExecuteResponse, err error)
Runs an autonomous AI agent that can perform complex multi-step browser tasks.
func (*SessionService) ExecuteStreaming ¶ added in v0.13.0
func (r *SessionService) ExecuteStreaming(ctx context.Context, id string, params SessionExecuteParams, opts ...option.RequestOption) (stream *ssestream.Stream[StreamEvent])
Runs an autonomous AI agent that can perform complex multi-step browser tasks.
func (*SessionService) Extract ¶
func (r *SessionService) Extract(ctx context.Context, id string, params SessionExtractParams, opts ...option.RequestOption) (res *SessionExtractResponse, err error)
Extracts structured data from the current page using AI-powered analysis.
func (*SessionService) ExtractStreaming ¶ added in v0.13.0
func (r *SessionService) ExtractStreaming(ctx context.Context, id string, params SessionExtractParams, opts ...option.RequestOption) (stream *ssestream.Stream[StreamEvent])
Extracts structured data from the current page using AI-powered analysis.
func (*SessionService) Navigate ¶
func (r *SessionService) Navigate(ctx context.Context, id string, params SessionNavigateParams, opts ...option.RequestOption) (res *SessionNavigateResponse, err error)
Navigates the browser to the specified URL.
func (*SessionService) Observe ¶
func (r *SessionService) Observe(ctx context.Context, id string, params SessionObserveParams, opts ...option.RequestOption) (res *SessionObserveResponse, err error)
Identifies and returns available actions on the current page that match the given instruction.
func (*SessionService) ObserveStreaming ¶ added in v0.13.0
func (r *SessionService) ObserveStreaming(ctx context.Context, id string, params SessionObserveParams, opts ...option.RequestOption) (stream *ssestream.Stream[StreamEvent])
Identifies and returns available actions on the current page that match the given instruction.
func (*SessionService) Start ¶
func (r *SessionService) Start(ctx context.Context, params SessionStartParams, opts ...option.RequestOption) (res *SessionStartResponse, err error)
Creates a new browser session with the specified configuration. Returns a session ID used for all subsequent operations.
type SessionStartParams ¶
type SessionStartParams struct {
// Model name to use for AI operations
ModelName string `json:"modelName,required"`
// Timeout in ms for act operations
ActTimeoutMs param.Opt[float64] `json:"actTimeoutMs,omitzero"`
// Existing Browserbase session ID to resume
BrowserbaseSessionID param.Opt[string] `json:"browserbaseSessionID,omitzero"`
DebugDom param.Opt[bool] `json:"debugDom,omitzero"`
// Timeout in ms to wait for DOM to settle
DomSettleTimeoutMs param.Opt[float64] `json:"domSettleTimeoutMs,omitzero"`
Experimental param.Opt[bool] `json:"experimental,omitzero"`
// Enable self-healing for failed actions
SelfHeal param.Opt[bool] `json:"selfHeal,omitzero"`
// Custom system prompt for AI operations
SystemPrompt param.Opt[string] `json:"systemPrompt,omitzero"`
// Logging verbosity level (0=quiet, 1=normal, 2=debug)
Verbose param.Opt[int64] `json:"verbose,omitzero"`
WaitForCaptchaSolves param.Opt[bool] `json:"waitForCaptchaSolves,omitzero"`
// Version of the Stagehand SDK
XSDKVersion param.Opt[string] `header:"x-sdk-version,omitzero" json:"-"`
// ISO timestamp when request was sent
XSentAt param.Opt[time.Time] `header:"x-sent-at,omitzero" format:"date-time" json:"-"`
Browser SessionStartParamsBrowser `json:"browser,omitzero"`
BrowserbaseSessionCreateParams SessionStartParamsBrowserbaseSessionCreateParams `json:"browserbaseSessionCreateParams,omitzero"`
// Client SDK language
//
// Any of "typescript", "python", "playground".
XLanguage SessionStartParamsXLanguage `header:"x-language,omitzero" json:"-"`
// Whether to stream the response via SSE
//
// Any of "true", "false".
XStreamResponse SessionStartParamsXStreamResponse `header:"x-stream-response,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SessionStartParams) MarshalJSON ¶
func (r SessionStartParams) MarshalJSON() (data []byte, err error)
func (*SessionStartParams) UnmarshalJSON ¶
func (r *SessionStartParams) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowser ¶ added in v0.9.0
type SessionStartParamsBrowser struct {
// Chrome DevTools Protocol URL for connecting to existing browser
CdpURL param.Opt[string] `json:"cdpUrl,omitzero"`
LaunchOptions SessionStartParamsBrowserLaunchOptions `json:"launchOptions,omitzero"`
// Browser type to use
//
// Any of "local", "browserbase".
Type string `json:"type,omitzero"`
// contains filtered or unexported fields
}
func (SessionStartParamsBrowser) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowser) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowser) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowser) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserLaunchOptions ¶ added in v0.9.0
type SessionStartParamsBrowserLaunchOptions struct {
AcceptDownloads param.Opt[bool] `json:"acceptDownloads,omitzero"`
CdpURL param.Opt[string] `json:"cdpUrl,omitzero"`
ChromiumSandbox param.Opt[bool] `json:"chromiumSandbox,omitzero"`
ConnectTimeoutMs param.Opt[float64] `json:"connectTimeoutMs,omitzero"`
DeviceScaleFactor param.Opt[float64] `json:"deviceScaleFactor,omitzero"`
Devtools param.Opt[bool] `json:"devtools,omitzero"`
DownloadsPath param.Opt[string] `json:"downloadsPath,omitzero"`
ExecutablePath param.Opt[string] `json:"executablePath,omitzero"`
HasTouch param.Opt[bool] `json:"hasTouch,omitzero"`
Headless param.Opt[bool] `json:"headless,omitzero"`
IgnoreHTTPSErrors param.Opt[bool] `json:"ignoreHTTPSErrors,omitzero"`
Locale param.Opt[string] `json:"locale,omitzero"`
PreserveUserDataDir param.Opt[bool] `json:"preserveUserDataDir,omitzero"`
UserDataDir param.Opt[string] `json:"userDataDir,omitzero"`
Args []string `json:"args,omitzero"`
IgnoreDefaultArgs SessionStartParamsBrowserLaunchOptionsIgnoreDefaultArgsUnion `json:"ignoreDefaultArgs,omitzero"`
Proxy SessionStartParamsBrowserLaunchOptionsProxy `json:"proxy,omitzero"`
Viewport SessionStartParamsBrowserLaunchOptionsViewport `json:"viewport,omitzero"`
// contains filtered or unexported fields
}
func (SessionStartParamsBrowserLaunchOptions) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowserLaunchOptions) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserLaunchOptions) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowserLaunchOptions) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserLaunchOptionsIgnoreDefaultArgsUnion ¶ added in v0.9.0
type SessionStartParamsBrowserLaunchOptionsIgnoreDefaultArgsUnion struct {
OfBool param.Opt[bool] `json:",omitzero,inline"`
OfStringArray []string `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (SessionStartParamsBrowserLaunchOptionsIgnoreDefaultArgsUnion) MarshalJSON ¶ added in v0.9.0
func (u SessionStartParamsBrowserLaunchOptionsIgnoreDefaultArgsUnion) MarshalJSON() ([]byte, error)
func (*SessionStartParamsBrowserLaunchOptionsIgnoreDefaultArgsUnion) UnmarshalJSON ¶ added in v0.9.0
func (u *SessionStartParamsBrowserLaunchOptionsIgnoreDefaultArgsUnion) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserLaunchOptionsProxy ¶ added in v0.9.0
type SessionStartParamsBrowserLaunchOptionsProxy struct {
Server string `json:"server,required"`
Bypass param.Opt[string] `json:"bypass,omitzero"`
Password param.Opt[string] `json:"password,omitzero"`
Username param.Opt[string] `json:"username,omitzero"`
// contains filtered or unexported fields
}
The property Server is required.
func (SessionStartParamsBrowserLaunchOptionsProxy) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowserLaunchOptionsProxy) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserLaunchOptionsProxy) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowserLaunchOptionsProxy) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserLaunchOptionsViewport ¶ added in v0.9.0
type SessionStartParamsBrowserLaunchOptionsViewport struct {
Height float64 `json:"height,required"`
Width float64 `json:"width,required"`
// contains filtered or unexported fields
}
The properties Height, Width are required.
func (SessionStartParamsBrowserLaunchOptionsViewport) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowserLaunchOptionsViewport) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserLaunchOptionsViewport) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowserLaunchOptionsViewport) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParams ¶ added in v0.9.0
type SessionStartParamsBrowserbaseSessionCreateParams struct {
ExtensionID param.Opt[string] `json:"extensionId,omitzero"`
KeepAlive param.Opt[bool] `json:"keepAlive,omitzero"`
ProjectID param.Opt[string] `json:"projectId,omitzero"`
Timeout param.Opt[float64] `json:"timeout,omitzero"`
BrowserSettings SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettings `json:"browserSettings,omitzero"`
Proxies SessionStartParamsBrowserbaseSessionCreateParamsProxiesUnion `json:"proxies,omitzero"`
// Any of "us-west-2", "us-east-1", "eu-central-1", "ap-southeast-1".
Region string `json:"region,omitzero"`
UserMetadata map[string]any `json:"userMetadata,omitzero"`
// contains filtered or unexported fields
}
func (SessionStartParamsBrowserbaseSessionCreateParams) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowserbaseSessionCreateParams) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserbaseSessionCreateParams) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowserbaseSessionCreateParams) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettings ¶ added in v0.9.0
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettings struct {
AdvancedStealth param.Opt[bool] `json:"advancedStealth,omitzero"`
BlockAds param.Opt[bool] `json:"blockAds,omitzero"`
ExtensionID param.Opt[string] `json:"extensionId,omitzero"`
LogSession param.Opt[bool] `json:"logSession,omitzero"`
RecordSession param.Opt[bool] `json:"recordSession,omitzero"`
SolveCaptchas param.Opt[bool] `json:"solveCaptchas,omitzero"`
Context SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsContext `json:"context,omitzero"`
Fingerprint SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprint `json:"fingerprint,omitzero"`
Viewport SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsViewport `json:"viewport,omitzero"`
// contains filtered or unexported fields
}
func (SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettings) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettings) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettings) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettings) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsContext ¶ added in v0.9.0
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsContext struct {
ID string `json:"id,required"`
Persist param.Opt[bool] `json:"persist,omitzero"`
// contains filtered or unexported fields
}
The property ID is required.
func (SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsContext) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsContext) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsContext) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsContext) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprint ¶ added in v0.9.0
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprint struct {
// Any of "chrome", "edge", "firefox", "safari".
Browsers []string `json:"browsers,omitzero"`
// Any of "desktop", "mobile".
Devices []string `json:"devices,omitzero"`
// Any of "1", "2".
HTTPVersion string `json:"httpVersion,omitzero"`
Locales []string `json:"locales,omitzero"`
// Any of "android", "ios", "linux", "macos", "windows".
OperatingSystems []string `json:"operatingSystems,omitzero"`
Screen SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprintScreen `json:"screen,omitzero"`
// contains filtered or unexported fields
}
func (SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprint) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprint) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprint) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprint) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprintScreen ¶ added in v0.9.0
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprintScreen struct {
MaxHeight param.Opt[float64] `json:"maxHeight,omitzero"`
MaxWidth param.Opt[float64] `json:"maxWidth,omitzero"`
MinHeight param.Opt[float64] `json:"minHeight,omitzero"`
MinWidth param.Opt[float64] `json:"minWidth,omitzero"`
// contains filtered or unexported fields
}
func (SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprintScreen) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprintScreen) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprintScreen) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsFingerprintScreen) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsViewport ¶ added in v0.9.0
type SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsViewport struct {
Height param.Opt[float64] `json:"height,omitzero"`
Width param.Opt[float64] `json:"width,omitzero"`
// contains filtered or unexported fields
}
func (SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsViewport) MarshalJSON ¶ added in v0.9.0
func (r SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsViewport) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsViewport) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartParamsBrowserbaseSessionCreateParamsBrowserSettingsViewport) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbase ¶ added in v0.12.0
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbase struct {
DomainPattern param.Opt[string] `json:"domainPattern,omitzero"`
Geolocation SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbaseGeolocation `json:"geolocation,omitzero"`
// This field can be elided, and will marshal its zero value as "browserbase".
Type constant.Browserbase `json:"type,required"`
// contains filtered or unexported fields
}
The property Type is required.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbase) MarshalJSON ¶ added in v0.12.0
func (r SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbase) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbase) UnmarshalJSON ¶ added in v0.12.0
func (r *SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbase) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbaseGeolocation ¶ added in v0.12.0
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbaseGeolocation struct {
Country string `json:"country,required"`
City param.Opt[string] `json:"city,omitzero"`
State param.Opt[string] `json:"state,omitzero"`
// contains filtered or unexported fields
}
The property Country is required.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbaseGeolocation) MarshalJSON ¶ added in v0.12.0
func (r SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbaseGeolocation) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbaseGeolocation) UnmarshalJSON ¶ added in v0.12.0
func (r *SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbaseGeolocation) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemExternal ¶ added in v0.12.0
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemExternal struct {
Server string `json:"server,required"`
DomainPattern param.Opt[string] `json:"domainPattern,omitzero"`
Password param.Opt[string] `json:"password,omitzero"`
Username param.Opt[string] `json:"username,omitzero"`
// This field can be elided, and will marshal its zero value as "external".
Type constant.External `json:"type,required"`
// contains filtered or unexported fields
}
The properties Server, Type are required.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemExternal) MarshalJSON ¶ added in v0.12.0
func (r SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemExternal) MarshalJSON() (data []byte, err error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemExternal) UnmarshalJSON ¶ added in v0.12.0
func (r *SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemExternal) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion ¶ added in v0.12.0
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion struct {
OfBrowserbase *SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbase `json:",omitzero,inline"`
OfExternal *SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemExternal `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetDomainPattern ¶ added in v0.12.0
func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetDomainPattern() *string
Returns a pointer to the underlying variant's property, if present.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetGeolocation ¶ added in v0.12.0
func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetGeolocation() *SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemBrowserbaseGeolocation
Returns a pointer to the underlying variant's property, if present.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetPassword ¶ added in v0.12.0
func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetPassword() *string
Returns a pointer to the underlying variant's property, if present.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetServer ¶ added in v0.12.0
func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetServer() *string
Returns a pointer to the underlying variant's property, if present.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetType ¶ added in v0.12.0
func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetUsername ¶ added in v0.12.0
func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) GetUsername() *string
Returns a pointer to the underlying variant's property, if present.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) MarshalJSON ¶ added in v0.12.0
func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) MarshalJSON() ([]byte, error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) UnmarshalJSON ¶ added in v0.12.0
func (u *SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion) UnmarshalJSON(data []byte) error
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesUnion ¶ added in v0.9.0
type SessionStartParamsBrowserbaseSessionCreateParamsProxiesUnion struct {
OfBool param.Opt[bool] `json:",omitzero,inline"`
OfProxyConfigList []SessionStartParamsBrowserbaseSessionCreateParamsProxiesProxyConfigListItemUnion `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (SessionStartParamsBrowserbaseSessionCreateParamsProxiesUnion) MarshalJSON ¶ added in v0.9.0
func (u SessionStartParamsBrowserbaseSessionCreateParamsProxiesUnion) MarshalJSON() ([]byte, error)
func (*SessionStartParamsBrowserbaseSessionCreateParamsProxiesUnion) UnmarshalJSON ¶ added in v0.9.0
func (u *SessionStartParamsBrowserbaseSessionCreateParamsProxiesUnion) UnmarshalJSON(data []byte) error
type SessionStartParamsXLanguage ¶ added in v0.9.0
type SessionStartParamsXLanguage string
Client SDK language
const ( SessionStartParamsXLanguageTypescript SessionStartParamsXLanguage = "typescript" SessionStartParamsXLanguagePython SessionStartParamsXLanguage = "python" SessionStartParamsXLanguagePlayground SessionStartParamsXLanguage = "playground" )
type SessionStartParamsXStreamResponse ¶ added in v0.9.0
type SessionStartParamsXStreamResponse string
Whether to stream the response via SSE
const ( SessionStartParamsXStreamResponseTrue SessionStartParamsXStreamResponse = "true" SessionStartParamsXStreamResponseFalse SessionStartParamsXStreamResponse = "false" )
type SessionStartResponse ¶
type SessionStartResponse struct {
Data SessionStartResponseData `json:"data,required"`
// Indicates whether the request was successful
Success bool `json:"success,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionStartResponse) RawJSON ¶
func (r SessionStartResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionStartResponse) UnmarshalJSON ¶
func (r *SessionStartResponse) UnmarshalJSON(data []byte) error
type SessionStartResponseData ¶ added in v0.9.0
type SessionStartResponseData struct {
Available bool `json:"available,required"`
// CDP WebSocket URL for connecting to the Browserbase cloud browser
ConnectURL string `json:"connectUrl,required"`
// Unique Browserbase session identifier
SessionID string `json:"sessionId,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Available respjson.Field
ConnectURL respjson.Field
SessionID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SessionStartResponseData) RawJSON ¶ added in v0.9.0
func (r SessionStartResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SessionStartResponseData) UnmarshalJSON ¶ added in v0.9.0
func (r *SessionStartResponseData) UnmarshalJSON(data []byte) error
type StreamEvent ¶ added in v0.13.0
type StreamEvent struct {
// Unique identifier for this event
ID string `json:"id,required" format:"uuid"`
Data StreamEventDataUnion `json:"data,required"`
// Type of stream event - system events or log messages
//
// Any of "system", "log".
Type StreamEventType `json:"type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Server-Sent Event emitted during streaming responses. Events are sent as `data: <JSON>\n\n`.
func (StreamEvent) RawJSON ¶ added in v0.13.0
func (r StreamEvent) RawJSON() string
Returns the unmodified JSON received from the API
func (*StreamEvent) UnmarshalJSON ¶ added in v0.13.0
func (r *StreamEvent) UnmarshalJSON(data []byte) error
type StreamEventDataStreamEventLogDataOutput ¶ added in v0.13.0
type StreamEventDataStreamEventLogDataOutput struct {
// Log message from the operation
Message string `json:"message,required"`
Status constant.Running `json:"status,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Message respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StreamEventDataStreamEventLogDataOutput) RawJSON ¶ added in v0.13.0
func (r StreamEventDataStreamEventLogDataOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*StreamEventDataStreamEventLogDataOutput) UnmarshalJSON ¶ added in v0.13.0
func (r *StreamEventDataStreamEventLogDataOutput) UnmarshalJSON(data []byte) error
type StreamEventDataStreamEventSystemDataOutput ¶ added in v0.13.0
type StreamEventDataStreamEventSystemDataOutput struct {
// Current status of the streaming operation
//
// Any of "starting", "connected", "running", "finished", "error".
Status string `json:"status,required"`
// Error message (present when status is 'error')
Error string `json:"error"`
// Operation result (present when status is 'finished')
Result any `json:"result"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Status respjson.Field
Error respjson.Field
Result respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StreamEventDataStreamEventSystemDataOutput) RawJSON ¶ added in v0.13.0
func (r StreamEventDataStreamEventSystemDataOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*StreamEventDataStreamEventSystemDataOutput) UnmarshalJSON ¶ added in v0.13.0
func (r *StreamEventDataStreamEventSystemDataOutput) UnmarshalJSON(data []byte) error
type StreamEventDataUnion ¶ added in v0.13.0
type StreamEventDataUnion struct {
Status string `json:"status"`
// This field is from variant [StreamEventDataStreamEventSystemDataOutput].
Error string `json:"error"`
// This field is from variant [StreamEventDataStreamEventSystemDataOutput].
Result any `json:"result"`
// This field is from variant [StreamEventDataStreamEventLogDataOutput].
Message string `json:"message"`
JSON struct {
Status respjson.Field
Error respjson.Field
Result respjson.Field
Message respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
StreamEventDataUnion contains all possible properties and values from StreamEventDataStreamEventSystemDataOutput, StreamEventDataStreamEventLogDataOutput.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (StreamEventDataUnion) AsStreamEventDataStreamEventLogDataOutput ¶ added in v0.13.0
func (u StreamEventDataUnion) AsStreamEventDataStreamEventLogDataOutput() (v StreamEventDataStreamEventLogDataOutput)
func (StreamEventDataUnion) AsStreamEventDataStreamEventSystemDataOutput ¶ added in v0.13.0
func (u StreamEventDataUnion) AsStreamEventDataStreamEventSystemDataOutput() (v StreamEventDataStreamEventSystemDataOutput)
func (StreamEventDataUnion) RawJSON ¶ added in v0.13.0
func (u StreamEventDataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*StreamEventDataUnion) UnmarshalJSON ¶ added in v0.13.0
func (r *StreamEventDataUnion) UnmarshalJSON(data []byte) error
type StreamEventType ¶ added in v0.13.0
type StreamEventType string
Type of stream event - system events or log messages
const ( StreamEventTypeSystem StreamEventType = "system" StreamEventTypeLog StreamEventType = "log" )
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
|
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package. |
|
packages
|
|
|
shared
|
|