Juglow

package module
v1.71.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 43 Imported by: 0

README

# haijun SDK for Go

Go Reference

The haijun SDK for Go provides access to the haijun API from Go applications.

Documentation

Full documentation is available at platform.haijun.com/docs/en/api/sdks/go.

Installation

import (
	"github.com/takebox/juglow-sdk-go" // imported as Juglow
)

Or explicitly add the dependency:

go get -u 'github.com/takebox/juglow-sdk-go@v1.62.0'

Getting started

package main

import (
	"context"
	"fmt"

	"github.com/takebox/juglow-sdk-go"
	"github.com/takebox/juglow-sdk-go/option"
)

func main() {
	client := Juglow.NewClient(
		option.WithAPIKey("my-Juglow-api-key"), // defaults to os.LookupEnv("Juglow_API_KEY")
	)
	message, err := client.Messages.New(context.TODO(), Juglow.MessageNewParams{
		MaxTokens: 1024,
		Messages: []Juglow.MessageParam{
			Juglow.NewUserMessage(Juglow.NewTextBlock("What is a quaternion?")),
		},
		Model: Juglow.ModelHaijunOpus4_6,
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", message.Content)
}

Requirements

Go 1.24+

Contributing

See CONTRIBUTING.md.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Documentation

Index

Constants

View Source
const DefaultMaxIdle = 60 * time.Second

DefaultMaxIdle is used for SessionToolRunnerOptions.MaxIdle when it is nil: once the session goes idle with stop_reason "end_turn", the runner keeps running for this long before stopping (any new event resets the countdown).

View Source
const ErrorTypeAPIError = shared.ErrorTypeAPIError

Equals "api_error"

View Source
const ErrorTypeAuthenticationError = shared.ErrorTypeAuthenticationError

Equals "authentication_error"

View Source
const ErrorTypeBillingError = shared.ErrorTypeBillingError

Equals "billing_error"

View Source
const ErrorTypeInvalidRequestError = shared.ErrorTypeInvalidRequestError

Equals "invalid_request_error"

View Source
const ErrorTypeNotFoundError = shared.ErrorTypeNotFoundError

Equals "not_found_error"

View Source
const ErrorTypeOverloadedError = shared.ErrorTypeOverloadedError

Equals "overloaded_error"

View Source
const ErrorTypePermissionError = shared.ErrorTypePermissionError

Equals "permission_error"

View Source
const ErrorTypeRateLimitError = shared.ErrorTypeRateLimitError

Equals "rate_limit_error"

View Source
const ErrorTypeTimeoutError = shared.ErrorTypeTimeoutError

Equals "timeout_error"

View Source
const WebSearchToolRequestErrorErrorCodeInvalidToolInput = WebSearchToolResultErrorCodeInvalidToolInput
View Source
const WebSearchToolRequestErrorErrorCodeMaxUsesExceeded = WebSearchToolResultErrorCodeMaxUsesExceeded
View Source
const WebSearchToolRequestErrorErrorCodeQueryTooLong = WebSearchToolResultErrorCodeQueryTooLong
View Source
const WebSearchToolRequestErrorErrorCodeRequestTooLarge = WebSearchToolResultErrorCodeRequestTooLarge
View Source
const WebSearchToolRequestErrorErrorCodeTooManyRequests = WebSearchToolResultErrorCodeTooManyRequests
View Source
const WebSearchToolRequestErrorErrorCodeUnavailable = WebSearchToolResultErrorCodeUnavailable
View Source
const WebSearchToolResultErrorErrorCodeInvalidToolInput = WebSearchToolResultErrorCodeInvalidToolInput
View Source
const WebSearchToolResultErrorErrorCodeMaxUsesExceeded = WebSearchToolResultErrorCodeMaxUsesExceeded
View Source
const WebSearchToolResultErrorErrorCodeQueryTooLong = WebSearchToolResultErrorCodeQueryTooLong
View Source
const WebSearchToolResultErrorErrorCodeRequestTooLarge = WebSearchToolResultErrorCodeRequestTooLarge
View Source
const WebSearchToolResultErrorErrorCodeTooManyRequests = WebSearchToolResultErrorCodeTooManyRequests
View Source
const WebSearchToolResultErrorErrorCodeUnavailable = WebSearchToolResultErrorCodeUnavailable

Variables

View Source
var (
	// ErrSessionTerminated means the server emitted session.status_terminated
	// or session.deleted. Iteration ends normally; the consumer's outer loop
	// can move on.
	ErrSessionTerminated = errors.New("session terminated")

	// ErrIdleTimeout means the session went idle with stop_reason "end_turn"
	// and stayed quiet for MaxIdle. The consumer chose this timeout, so treat
	// it as expected.
	ErrIdleTimeout = errors.New("session idle after end_turn")
)

Sentinel errors returned via (*SessionToolRunner).Err so consumers can distinguish normal end-of-session from idle bailout.

View Source
var ErrStructuredOutputParse = errors.New("Juglow: failed to parse structured output")

ErrStructuredOutputParse is returned (wrapped) by BetaMessageService.New when the API request succeeds but the response body can't be unmarshaled into the struct pointer passed as Schema. The *BetaMessage is still returned in that case — check it alongside the error:

msg, err := client.Beta.Messages.New(ctx, params)
if errors.Is(err, Juglow.ErrStructuredOutputParse) {
    // msg is valid; the model's response didn't match the struct shape.
}

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func CalculateNonStreamingTimeout

func CalculateNonStreamingTimeout(maxTokens int, model Model, opts []option.RequestOption) (time.Duration, error)

CalculateNonStreamingTimeout calculates the appropriate timeout for a non-streaming request based on the maximum number of tokens and the model's non-streaming token limit

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions walks the default credential chain per the cross-SDK credential precedence spec:

  1. Juglow_API_KEY
  2. Juglow_AUTH_TOKEN
  3. Explicit profile via Juglow_PROFILE (surfaces the error if the named profile is missing — the user explicitly selected it)
  4. Env-var federation (Juglow_FEDERATION_RULE_ID + Juglow_ORGANIZATION_ID + Juglow_IDENTITY_TOKEN_FILE / _TOKEN)
  5. Fallback profile (active_config file or literal "default" — a quiet miss when absent, so a WIF-configured machine with a leftover default profile still uses WIF)

When no source produces a credential, the first request fails with an auth.NoCredentialsError. If Juglow_PROFILE points at a missing or invalid profile, the first request instead fails with a wrapped profile-load error naming the profile. An explicit credential option passed to NewClient (e.g. option.WithAPIKey or option.WithAuthToken) suppresses both paths. Also honors Juglow_BASE_URL.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type APIErrorObject

type APIErrorObject = shared.APIErrorObject

This is an alias to an internal type.

type AuthenticationError

type AuthenticationError = shared.AuthenticationError

This is an alias to an internal type.

type Base64ImageSourceMediaType

type Base64ImageSourceMediaType string
const (
	Base64ImageSourceMediaTypeImageJPEG Base64ImageSourceMediaType = "image/jpeg"
	Base64ImageSourceMediaTypeImagePNG  Base64ImageSourceMediaType = "image/png"
	Base64ImageSourceMediaTypeImageGIF  Base64ImageSourceMediaType = "image/gif"
	Base64ImageSourceMediaTypeImageWebP Base64ImageSourceMediaType = "image/webp"
)

type Base64ImageSourceParam

type Base64ImageSourceParam struct {
	Data string `json:"data" api:"required" format:"byte"`
	// Any of "image/jpeg", "image/png", "image/gif", "image/webp".
	MediaType Base64ImageSourceMediaType `json:"media_type,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "base64".
	Type constant.Base64 `json:"type" default:"base64"`
	// contains filtered or unexported fields
}

The properties Data, MediaType, Type are required.

func (Base64ImageSourceParam) MarshalJSON

func (r Base64ImageSourceParam) MarshalJSON() (data []byte, err error)

func (*Base64ImageSourceParam) UnmarshalJSON

func (r *Base64ImageSourceParam) UnmarshalJSON(data []byte) error

type Base64PDFSource

type Base64PDFSource struct {
	Data      string                  `json:"data" api:"required" format:"byte"`
	MediaType constant.ApplicationPDF `json:"media_type" default:"application/pdf"`
	Type      constant.Base64         `json:"type" default:"base64"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		MediaType   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Base64PDFSource) RawJSON

func (r Base64PDFSource) RawJSON() string

Returns the unmodified JSON received from the API

func (Base64PDFSource) ToParam

ToParam converts this Base64PDFSource to a Base64PDFSourceParam.

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 Base64PDFSourceParam.Overrides()

func (*Base64PDFSource) UnmarshalJSON

func (r *Base64PDFSource) UnmarshalJSON(data []byte) error

type Base64PDFSourceParam

type Base64PDFSourceParam struct {
	Data string `json:"data" api:"required" format:"byte"`
	// This field can be elided, and will marshal its zero value as "application/pdf".
	MediaType constant.ApplicationPDF `json:"media_type" default:"application/pdf"`
	// This field can be elided, and will marshal its zero value as "base64".
	Type constant.Base64 `json:"type" default:"base64"`
	// contains filtered or unexported fields
}

The properties Data, MediaType, Type are required.

func (Base64PDFSourceParam) MarshalJSON

func (r Base64PDFSourceParam) MarshalJSON() (data []byte, err error)

func (*Base64PDFSourceParam) UnmarshalJSON

func (r *Base64PDFSourceParam) UnmarshalJSON(data []byte) error

type BashCodeExecutionOutputBlock

type BashCodeExecutionOutputBlock struct {
	FileID string                           `json:"file_id" api:"required"`
	Type   constant.BashCodeExecutionOutput `json:"type" default:"bash_code_execution_output"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BashCodeExecutionOutputBlock) RawJSON

Returns the unmodified JSON received from the API

func (BashCodeExecutionOutputBlock) ToParam

func (*BashCodeExecutionOutputBlock) UnmarshalJSON

func (r *BashCodeExecutionOutputBlock) UnmarshalJSON(data []byte) error

type BashCodeExecutionOutputBlockParam

type BashCodeExecutionOutputBlockParam struct {
	FileID string `json:"file_id" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "bash_code_execution_output".
	Type constant.BashCodeExecutionOutput `json:"type" default:"bash_code_execution_output"`
	// contains filtered or unexported fields
}

The properties FileID, Type are required.

func (BashCodeExecutionOutputBlockParam) MarshalJSON

func (r BashCodeExecutionOutputBlockParam) MarshalJSON() (data []byte, err error)

func (*BashCodeExecutionOutputBlockParam) UnmarshalJSON

func (r *BashCodeExecutionOutputBlockParam) UnmarshalJSON(data []byte) error

type BashCodeExecutionResultBlock

type BashCodeExecutionResultBlock struct {
	Content    []BashCodeExecutionOutputBlock   `json:"content" api:"required"`
	ReturnCode int64                            `json:"return_code" api:"required"`
	Stderr     string                           `json:"stderr" api:"required"`
	Stdout     string                           `json:"stdout" api:"required"`
	Type       constant.BashCodeExecutionResult `json:"type" default:"bash_code_execution_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ReturnCode  respjson.Field
		Stderr      respjson.Field
		Stdout      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BashCodeExecutionResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BashCodeExecutionResultBlock) UnmarshalJSON

func (r *BashCodeExecutionResultBlock) UnmarshalJSON(data []byte) error

type BashCodeExecutionResultBlockParam

type BashCodeExecutionResultBlockParam struct {
	Content    []BashCodeExecutionOutputBlockParam `json:"content,omitzero" api:"required"`
	ReturnCode int64                               `json:"return_code" api:"required"`
	Stderr     string                              `json:"stderr" api:"required"`
	Stdout     string                              `json:"stdout" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "bash_code_execution_result".
	Type constant.BashCodeExecutionResult `json:"type" default:"bash_code_execution_result"`
	// contains filtered or unexported fields
}

The properties Content, ReturnCode, Stderr, Stdout, Type are required.

func (BashCodeExecutionResultBlockParam) MarshalJSON

func (r BashCodeExecutionResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BashCodeExecutionResultBlockParam) UnmarshalJSON

func (r *BashCodeExecutionResultBlockParam) UnmarshalJSON(data []byte) error

type BashCodeExecutionToolResultBlock

type BashCodeExecutionToolResultBlock struct {
	Content   BashCodeExecutionToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                       `json:"tool_use_id" api:"required"`
	Type      constant.BashCodeExecutionToolResult         `json:"type" default:"bash_code_execution_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BashCodeExecutionToolResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (BashCodeExecutionToolResultBlock) ToParam

func (*BashCodeExecutionToolResultBlock) UnmarshalJSON

func (r *BashCodeExecutionToolResultBlock) UnmarshalJSON(data []byte) error

type BashCodeExecutionToolResultBlockContentUnion

type BashCodeExecutionToolResultBlockContentUnion struct {
	// This field is from variant [BashCodeExecutionToolResultError].
	ErrorCode BashCodeExecutionToolResultErrorCode `json:"error_code"`
	Type      string                               `json:"type"`
	// This field is from variant [BashCodeExecutionResultBlock].
	Content []BashCodeExecutionOutputBlock `json:"content"`
	// This field is from variant [BashCodeExecutionResultBlock].
	ReturnCode int64 `json:"return_code"`
	// This field is from variant [BashCodeExecutionResultBlock].
	Stderr string `json:"stderr"`
	// This field is from variant [BashCodeExecutionResultBlock].
	Stdout string `json:"stdout"`
	JSON   struct {
		ErrorCode  respjson.Field
		Type       respjson.Field
		Content    respjson.Field
		ReturnCode respjson.Field
		Stderr     respjson.Field
		Stdout     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BashCodeExecutionToolResultBlockContentUnion contains all possible properties and values from BashCodeExecutionToolResultError, BashCodeExecutionResultBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BashCodeExecutionToolResultBlockContentUnion) AsResponseBashCodeExecutionResultBlock

func (u BashCodeExecutionToolResultBlockContentUnion) AsResponseBashCodeExecutionResultBlock() (v BashCodeExecutionResultBlock)

func (BashCodeExecutionToolResultBlockContentUnion) AsResponseBashCodeExecutionToolResultError

func (u BashCodeExecutionToolResultBlockContentUnion) AsResponseBashCodeExecutionToolResultError() (v BashCodeExecutionToolResultError)

func (BashCodeExecutionToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BashCodeExecutionToolResultBlockContentUnion) UnmarshalJSON

func (r *BashCodeExecutionToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type BashCodeExecutionToolResultBlockParam

type BashCodeExecutionToolResultBlockParam struct {
	Content   BashCodeExecutionToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                            `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "bash_code_execution_tool_result".
	Type constant.BashCodeExecutionToolResult `json:"type" default:"bash_code_execution_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (BashCodeExecutionToolResultBlockParam) MarshalJSON

func (r BashCodeExecutionToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BashCodeExecutionToolResultBlockParam) UnmarshalJSON

func (r *BashCodeExecutionToolResultBlockParam) UnmarshalJSON(data []byte) error

type BashCodeExecutionToolResultBlockParamContentUnion

type BashCodeExecutionToolResultBlockParamContentUnion struct {
	OfRequestBashCodeExecutionToolResultError *BashCodeExecutionToolResultErrorParam `json:",omitzero,inline"`
	OfRequestBashCodeExecutionResultBlock     *BashCodeExecutionResultBlockParam     `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 (BashCodeExecutionToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BashCodeExecutionToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (BashCodeExecutionToolResultBlockParamContentUnion) GetReturnCode

Returns a pointer to the underlying variant's property, if present.

func (BashCodeExecutionToolResultBlockParamContentUnion) GetStderr

Returns a pointer to the underlying variant's property, if present.

func (BashCodeExecutionToolResultBlockParamContentUnion) GetStdout

Returns a pointer to the underlying variant's property, if present.

func (BashCodeExecutionToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BashCodeExecutionToolResultBlockParamContentUnion) MarshalJSON

func (*BashCodeExecutionToolResultBlockParamContentUnion) UnmarshalJSON

type BashCodeExecutionToolResultError

type BashCodeExecutionToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded", "output_file_too_large".
	ErrorCode BashCodeExecutionToolResultErrorCode      `json:"error_code" api:"required"`
	Type      constant.BashCodeExecutionToolResultError `json:"type" default:"bash_code_execution_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BashCodeExecutionToolResultError) RawJSON

Returns the unmodified JSON received from the API

func (*BashCodeExecutionToolResultError) UnmarshalJSON

func (r *BashCodeExecutionToolResultError) UnmarshalJSON(data []byte) error

type BashCodeExecutionToolResultErrorCode

type BashCodeExecutionToolResultErrorCode string
const (
	BashCodeExecutionToolResultErrorCodeInvalidToolInput      BashCodeExecutionToolResultErrorCode = "invalid_tool_input"
	BashCodeExecutionToolResultErrorCodeUnavailable           BashCodeExecutionToolResultErrorCode = "unavailable"
	BashCodeExecutionToolResultErrorCodeTooManyRequests       BashCodeExecutionToolResultErrorCode = "too_many_requests"
	BashCodeExecutionToolResultErrorCodeExecutionTimeExceeded BashCodeExecutionToolResultErrorCode = "execution_time_exceeded"
	BashCodeExecutionToolResultErrorCodeOutputFileTooLarge    BashCodeExecutionToolResultErrorCode = "output_file_too_large"
)

type BashCodeExecutionToolResultErrorParam

type BashCodeExecutionToolResultErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded", "output_file_too_large".
	ErrorCode BashCodeExecutionToolResultErrorCode `json:"error_code,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "bash_code_execution_tool_result_error".
	Type constant.BashCodeExecutionToolResultError `json:"type" default:"bash_code_execution_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (BashCodeExecutionToolResultErrorParam) MarshalJSON

func (r BashCodeExecutionToolResultErrorParam) MarshalJSON() (data []byte, err error)

func (*BashCodeExecutionToolResultErrorParam) UnmarshalJSON

func (r *BashCodeExecutionToolResultErrorParam) UnmarshalJSON(data []byte) error

type BetaAPIError

type BetaAPIError struct {
	Message string            `json:"message" api:"required"`
	Type    constant.APIError `json:"type" default:"api_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaAPIError) RawJSON

func (r BetaAPIError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaAPIError) UnmarshalJSON

func (r *BetaAPIError) UnmarshalJSON(data []byte) error

type BetaAdvisorMessageIterationUsage

type BetaAdvisorMessageIterationUsage struct {
	// Breakdown of cached tokens by TTL
	CacheCreation BetaCacheCreation `json:"cache_creation" api:"required"`
	// The number of input tokens used to create the cache entry.
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// The number of input tokens read from the cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// The number of input tokens which were used.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model" api:"required"`
	// The number of output tokens which were used.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// Usage for an advisor sub-inference iteration
	Type constant.AdvisorMessage `json:"type" default:"advisor_message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreation            respjson.Field
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		Model                    respjson.Field
		OutputTokens             respjson.Field
		Type                     respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token usage for an advisor sub-inference iteration.

func (BetaAdvisorMessageIterationUsage) RawJSON

Returns the unmodified JSON received from the API

func (*BetaAdvisorMessageIterationUsage) UnmarshalJSON

func (r *BetaAdvisorMessageIterationUsage) UnmarshalJSON(data []byte) error

type BetaAdvisorRedactedResultBlock

type BetaAdvisorRedactedResultBlock struct {
	// Opaque blob containing the advisor's output. Round-trip verbatim; do not inspect
	// or modify.
	EncryptedContent string `json:"encrypted_content" api:"required"`
	// The advisor sub-inference's stop reason (same values as the top-level message
	// `stop_reason`).
	StopReason string                         `json:"stop_reason" api:"required"`
	Type       constant.AdvisorRedactedResult `json:"type" default:"advisor_redacted_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EncryptedContent respjson.Field
		StopReason       respjson.Field
		Type             respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaAdvisorRedactedResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BetaAdvisorRedactedResultBlock) UnmarshalJSON

func (r *BetaAdvisorRedactedResultBlock) UnmarshalJSON(data []byte) error

type BetaAdvisorRedactedResultBlockParam

type BetaAdvisorRedactedResultBlockParam struct {
	// Opaque blob produced by a prior response; must be round-tripped verbatim.
	EncryptedContent string            `json:"encrypted_content" api:"required"`
	StopReason       param.Opt[string] `json:"stop_reason,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "advisor_redacted_result".
	Type constant.AdvisorRedactedResult `json:"type" default:"advisor_redacted_result"`
	// contains filtered or unexported fields
}

The properties EncryptedContent, Type are required.

func (BetaAdvisorRedactedResultBlockParam) MarshalJSON

func (r BetaAdvisorRedactedResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaAdvisorRedactedResultBlockParam) UnmarshalJSON

func (r *BetaAdvisorRedactedResultBlockParam) UnmarshalJSON(data []byte) error

type BetaAdvisorResultBlock

type BetaAdvisorResultBlock struct {
	// The advisor sub-inference's stop reason (same values as the top-level message
	// `stop_reason`). `max_tokens` indicates the advisor's output was truncated at the
	// tool's `max_tokens` value or the advisor model's policy cap.
	StopReason string                 `json:"stop_reason" api:"required"`
	Text       string                 `json:"text" api:"required"`
	Type       constant.AdvisorResult `json:"type" default:"advisor_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StopReason  respjson.Field
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaAdvisorResultBlock) RawJSON

func (r BetaAdvisorResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaAdvisorResultBlock) UnmarshalJSON

func (r *BetaAdvisorResultBlock) UnmarshalJSON(data []byte) error

type BetaAdvisorResultBlockParam

type BetaAdvisorResultBlockParam struct {
	Text       string            `json:"text" api:"required"`
	StopReason param.Opt[string] `json:"stop_reason,omitzero"`
	// This field can be elided, and will marshal its zero value as "advisor_result".
	Type constant.AdvisorResult `json:"type" default:"advisor_result"`
	// contains filtered or unexported fields
}

The properties Text, Type are required.

func (BetaAdvisorResultBlockParam) MarshalJSON

func (r BetaAdvisorResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaAdvisorResultBlockParam) UnmarshalJSON

func (r *BetaAdvisorResultBlockParam) UnmarshalJSON(data []byte) error

type BetaAdvisorTool20260301Param

type BetaAdvisorTool20260301Param struct {
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model,omitzero" api:"required"`
	// Bounds the advisor's total output (thinking + text) per call. When the advisor
	// hits this cap, the returned advisor_result or advisor_redacted_result block
	// carries stop_reason='max_tokens', and a truncation note is appended to the
	// advice text the worker model sees (inside the encrypted blob in redacted mode).
	// When set, the server also emits a remaining-tokens budget block in the advisor's
	// prompt so the advisor self-shapes toward the cap. When omitted, the advisor
	// model's default output cap applies and no budget block is emitted.
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Caching for the advisor's own prompt. When set, each advisor call writes a cache
	// entry at the given TTL so subsequent calls in the same conversation read the
	// stable prefix. When omitted, the advisor prompt is not cached.
	Caching BetaCacheControlEphemeralParam `json:"caching,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "advisor".
	Name constant.Advisor `json:"name" default:"advisor"`
	// This field can be elided, and will marshal its zero value as "advisor_20260301".
	Type constant.Advisor20260301 `json:"type" default:"advisor_20260301"`
	// contains filtered or unexported fields
}

The properties Model, Name, Type are required.

func (BetaAdvisorTool20260301Param) MarshalJSON

func (r BetaAdvisorTool20260301Param) MarshalJSON() (data []byte, err error)

func (*BetaAdvisorTool20260301Param) UnmarshalJSON

func (r *BetaAdvisorTool20260301Param) UnmarshalJSON(data []byte) error

type BetaAdvisorToolResultBlock

type BetaAdvisorToolResultBlock struct {
	Content   BetaAdvisorToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                 `json:"tool_use_id" api:"required"`
	Type      constant.AdvisorToolResult             `json:"type" default:"advisor_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaAdvisorToolResultBlock) RawJSON

func (r BetaAdvisorToolResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaAdvisorToolResultBlock) ToParam

func (*BetaAdvisorToolResultBlock) UnmarshalJSON

func (r *BetaAdvisorToolResultBlock) UnmarshalJSON(data []byte) error

type BetaAdvisorToolResultBlockContentUnion

type BetaAdvisorToolResultBlockContentUnion struct {
	// This field is from variant [BetaAdvisorToolResultError].
	ErrorCode  BetaAdvisorToolResultErrorErrorCode `json:"error_code"`
	Type       string                              `json:"type"`
	StopReason string                              `json:"stop_reason"`
	// This field is from variant [BetaAdvisorResultBlock].
	Text string `json:"text"`
	// This field is from variant [BetaAdvisorRedactedResultBlock].
	EncryptedContent string `json:"encrypted_content"`
	JSON             struct {
		ErrorCode        respjson.Field
		Type             respjson.Field
		StopReason       respjson.Field
		Text             respjson.Field
		EncryptedContent respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaAdvisorToolResultBlockContentUnion contains all possible properties and values from BetaAdvisorToolResultError, BetaAdvisorResultBlock, BetaAdvisorRedactedResultBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaAdvisorToolResultBlockContentUnion) AsResponseAdvisorRedactedResultBlock

func (u BetaAdvisorToolResultBlockContentUnion) AsResponseAdvisorRedactedResultBlock() (v BetaAdvisorRedactedResultBlock)

func (BetaAdvisorToolResultBlockContentUnion) AsResponseAdvisorResultBlock

func (u BetaAdvisorToolResultBlockContentUnion) AsResponseAdvisorResultBlock() (v BetaAdvisorResultBlock)

func (BetaAdvisorToolResultBlockContentUnion) AsResponseAdvisorToolResultError

func (u BetaAdvisorToolResultBlockContentUnion) AsResponseAdvisorToolResultError() (v BetaAdvisorToolResultError)

func (BetaAdvisorToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaAdvisorToolResultBlockContentUnion) UnmarshalJSON

func (r *BetaAdvisorToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type BetaAdvisorToolResultBlockParam

type BetaAdvisorToolResultBlockParam struct {
	Content   BetaAdvisorToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                      `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "advisor_tool_result".
	Type constant.AdvisorToolResult `json:"type" default:"advisor_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (BetaAdvisorToolResultBlockParam) MarshalJSON

func (r BetaAdvisorToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaAdvisorToolResultBlockParam) UnmarshalJSON

func (r *BetaAdvisorToolResultBlockParam) UnmarshalJSON(data []byte) error

type BetaAdvisorToolResultBlockParamContentUnion

type BetaAdvisorToolResultBlockParamContentUnion struct {
	OfRequestAdvisorToolResultError     *BetaAdvisorToolResultErrorParam     `json:",omitzero,inline"`
	OfRequestAdvisorResultBlock         *BetaAdvisorResultBlockParam         `json:",omitzero,inline"`
	OfRequestAdvisorRedactedResultBlock *BetaAdvisorRedactedResultBlockParam `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 (BetaAdvisorToolResultBlockParamContentUnion) GetEncryptedContent

func (u BetaAdvisorToolResultBlockParamContentUnion) GetEncryptedContent() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaAdvisorToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (BetaAdvisorToolResultBlockParamContentUnion) GetStopReason

Returns a pointer to the underlying variant's property, if present.

func (BetaAdvisorToolResultBlockParamContentUnion) GetText

Returns a pointer to the underlying variant's property, if present.

func (BetaAdvisorToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaAdvisorToolResultBlockParamContentUnion) MarshalJSON

func (*BetaAdvisorToolResultBlockParamContentUnion) UnmarshalJSON

func (u *BetaAdvisorToolResultBlockParamContentUnion) UnmarshalJSON(data []byte) error

type BetaAdvisorToolResultError

type BetaAdvisorToolResultError struct {
	// Any of "max_uses_exceeded", "prompt_too_long", "too_many_requests",
	// "overloaded", "unavailable", "execution_time_exceeded", "model_not_found".
	ErrorCode BetaAdvisorToolResultErrorErrorCode `json:"error_code" api:"required"`
	Type      constant.AdvisorToolResultError     `json:"type" default:"advisor_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaAdvisorToolResultError) RawJSON

func (r BetaAdvisorToolResultError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaAdvisorToolResultError) UnmarshalJSON

func (r *BetaAdvisorToolResultError) UnmarshalJSON(data []byte) error

type BetaAdvisorToolResultErrorErrorCode

type BetaAdvisorToolResultErrorErrorCode string
const (
	BetaAdvisorToolResultErrorErrorCodeMaxUsesExceeded       BetaAdvisorToolResultErrorErrorCode = "max_uses_exceeded"
	BetaAdvisorToolResultErrorErrorCodePromptTooLong         BetaAdvisorToolResultErrorErrorCode = "prompt_too_long"
	BetaAdvisorToolResultErrorErrorCodeTooManyRequests       BetaAdvisorToolResultErrorErrorCode = "too_many_requests"
	BetaAdvisorToolResultErrorErrorCodeOverloaded            BetaAdvisorToolResultErrorErrorCode = "overloaded"
	BetaAdvisorToolResultErrorErrorCodeUnavailable           BetaAdvisorToolResultErrorErrorCode = "unavailable"
	BetaAdvisorToolResultErrorErrorCodeExecutionTimeExceeded BetaAdvisorToolResultErrorErrorCode = "execution_time_exceeded"
	BetaAdvisorToolResultErrorErrorCodeModelNotFound         BetaAdvisorToolResultErrorErrorCode = "model_not_found"
)

type BetaAdvisorToolResultErrorParam

type BetaAdvisorToolResultErrorParam struct {
	// Any of "max_uses_exceeded", "prompt_too_long", "too_many_requests",
	// "overloaded", "unavailable", "execution_time_exceeded", "model_not_found".
	ErrorCode BetaAdvisorToolResultErrorParamErrorCode `json:"error_code,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "advisor_tool_result_error".
	Type constant.AdvisorToolResultError `json:"type" default:"advisor_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (BetaAdvisorToolResultErrorParam) MarshalJSON

func (r BetaAdvisorToolResultErrorParam) MarshalJSON() (data []byte, err error)

func (*BetaAdvisorToolResultErrorParam) UnmarshalJSON

func (r *BetaAdvisorToolResultErrorParam) UnmarshalJSON(data []byte) error

type BetaAdvisorToolResultErrorParamErrorCode

type BetaAdvisorToolResultErrorParamErrorCode string
const (
	BetaAdvisorToolResultErrorParamErrorCodeMaxUsesExceeded       BetaAdvisorToolResultErrorParamErrorCode = "max_uses_exceeded"
	BetaAdvisorToolResultErrorParamErrorCodePromptTooLong         BetaAdvisorToolResultErrorParamErrorCode = "prompt_too_long"
	BetaAdvisorToolResultErrorParamErrorCodeTooManyRequests       BetaAdvisorToolResultErrorParamErrorCode = "too_many_requests"
	BetaAdvisorToolResultErrorParamErrorCodeOverloaded            BetaAdvisorToolResultErrorParamErrorCode = "overloaded"
	BetaAdvisorToolResultErrorParamErrorCodeUnavailable           BetaAdvisorToolResultErrorParamErrorCode = "unavailable"
	BetaAdvisorToolResultErrorParamErrorCodeExecutionTimeExceeded BetaAdvisorToolResultErrorParamErrorCode = "execution_time_exceeded"
	BetaAdvisorToolResultErrorParamErrorCodeModelNotFound         BetaAdvisorToolResultErrorParamErrorCode = "model_not_found"
)

type BetaAgentArchiveParams

type BetaAgentArchiveParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaAgentGetParams

type BetaAgentGetParams struct {
	// Agent version. Omit for the most recent version. Must be at least 1 if
	// specified.
	Version param.Opt[int64] `query:"version,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaAgentGetParams) URLQuery

func (r BetaAgentGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaAgentGetParams's query parameters as `url.Values`.

type BetaAgentListParams

type BetaAgentListParams struct {
	// Return agents created at or after this time (inclusive).
	CreatedAtGte param.Opt[time.Time] `query:"created_at[gte],omitzero" format:"date-time" json:"-"`
	// Return agents created at or before this time (inclusive).
	CreatedAtLte param.Opt[time.Time] `query:"created_at[lte],omitzero" format:"date-time" json:"-"`
	// Include archived agents in results. Defaults to false.
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Maximum results per page. Default 20, maximum 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor from a previous response.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaAgentListParams) URLQuery

func (r BetaAgentListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaAgentListParams's query parameters as `url.Values`.

type BetaAgentNewParams

type BetaAgentNewParams struct {
	// Model identifier. Accepts the
	// [model string](https://platform.haijun.com/docs/en/about-haijun/models/overview#latest-models-comparison),
	// e.g. `haijun-opus-4-6`, or a `model_config` object for additional configuration
	// control
	Model BetaManagedAgentsModelConfigParams `json:"model,omitzero" api:"required"`
	// Human-readable name for the agent.
	Name string `json:"name" api:"required"`
	// Description of what the agent does.
	Description param.Opt[string] `json:"description,omitzero"`
	// System prompt for the agent.
	System param.Opt[string] `json:"system,omitzero"`
	// MCP servers this agent connects to. Maximum 20. Names must be unique within the
	// array. Every server must be referenced by an `mcp_toolset` in `tools`;
	// unreferenced servers are rejected. See the
	// [MCP connector guide](https://platform.haijun.com/docs/en/managed-agents/mcp-connector).
	MCPServers []BetaManagedAgentsURLMCPServerParams `json:"mcp_servers,omitzero"`
	// Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up
	// to 512 chars.
	Metadata map[string]string `json:"metadata,omitzero"`
	// A coordinator topology: the session's primary thread orchestrates work by
	// spawning session threads, each running an agent drawn from the `agents` roster.
	Multiagent BetaManagedAgentsMultiagentParams `json:"multiagent,omitzero"`
	// tracks available to the agent.
	Tracks []BetaManagedAgentsTrackParamsUnion `json:"tracks,omitzero"`
	// Tool configurations available to the agent. Maximum of 128 tools across all
	// toolsets allowed.
	Tools []BetaAgentNewParamsToolUnion `json:"tools,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaAgentNewParams) MarshalJSON

func (r BetaAgentNewParams) MarshalJSON() (data []byte, err error)

func (*BetaAgentNewParams) UnmarshalJSON

func (r *BetaAgentNewParams) UnmarshalJSON(data []byte) error

type BetaAgentNewParamsToolUnion

type BetaAgentNewParamsToolUnion struct {
	OfAgentToolset20260401 *BetaManagedAgentsAgentToolset20260401Params `json:",omitzero,inline"`
	OfMCPToolset           *BetaManagedAgentsMCPToolsetParams           `json:",omitzero,inline"`
	OfCustom               *BetaManagedAgentsCustomToolParams           `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 (BetaAgentNewParamsToolUnion) GetConfigs

func (u BetaAgentNewParamsToolUnion) GetConfigs() (res betaAgentNewParamsToolUnionConfigs)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaAgentNewParamsToolUnion) GetDefaultConfig

func (u BetaAgentNewParamsToolUnion) GetDefaultConfig() (res betaAgentNewParamsToolUnionDefaultConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaAgentNewParamsToolUnion) GetDescription

func (u BetaAgentNewParamsToolUnion) GetDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentNewParamsToolUnion) GetInputSchema

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentNewParamsToolUnion) GetMCPServerName

func (u BetaAgentNewParamsToolUnion) GetMCPServerName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentNewParamsToolUnion) GetName

func (u BetaAgentNewParamsToolUnion) GetName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentNewParamsToolUnion) GetType

func (u BetaAgentNewParamsToolUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentNewParamsToolUnion) MarshalJSON

func (u BetaAgentNewParamsToolUnion) MarshalJSON() ([]byte, error)

func (*BetaAgentNewParamsToolUnion) UnmarshalJSON

func (u *BetaAgentNewParamsToolUnion) UnmarshalJSON(data []byte) error

type BetaAgentService

type BetaAgentService struct {
	Options  []option.RequestOption
	Versions BetaAgentVersionService
}

BetaAgentService contains methods and other services that help with interacting with the Juglow 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 NewBetaAgentService method instead.

func NewBetaAgentService

func NewBetaAgentService(opts ...option.RequestOption) (r BetaAgentService)

NewBetaAgentService 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 (*BetaAgentService) Archive

Archive Agent

func (*BetaAgentService) Get

func (r *BetaAgentService) Get(ctx context.Context, agentID string, params BetaAgentGetParams, opts ...option.RequestOption) (res *BetaManagedAgentsAgent, err error)

Get Agent

func (*BetaAgentService) List

List Agents

func (*BetaAgentService) ListAutoPaging

List Agents

func (*BetaAgentService) New

Create Agent

func (*BetaAgentService) Update

func (r *BetaAgentService) Update(ctx context.Context, agentID string, params BetaAgentUpdateParams, opts ...option.RequestOption) (res *BetaManagedAgentsAgent, err error)

Update Agent

type BetaAgentUpdateParams

type BetaAgentUpdateParams struct {
	// Description. Omit to preserve; send empty string or null to clear.
	Description param.Opt[string] `json:"description,omitzero"`
	// System prompt. Omit to preserve; send empty string or null to clear.
	System param.Opt[string] `json:"system,omitzero"`
	// Human-readable name. Must be non-empty. Omit to preserve. Cannot be cleared.
	Name param.Opt[string] `json:"name,omitzero"`
	// The agent's current version, used to prevent concurrent overwrites. Obtain this
	// value from a create or retrieve response. Must be at least 1 if specified. When
	// supplied, the request fails if it does not match the server's current version;
	// omit to apply the update unconditionally.
	Version param.Opt[int64] `json:"version,omitzero"`
	// MCP servers. Full replacement. Omit to preserve; send empty array or `null` to
	// clear. Names must be unique. Maximum 20. Every server must be referenced by an
	// `mcp_toolset` in the agent's resulting `tools`; unreferenced servers are
	// rejected. See the
	// [MCP connector guide](https://platform.haijun.com/docs/en/managed-agents/mcp-connector).
	MCPServers []BetaManagedAgentsURLMCPServerParams `json:"mcp_servers,omitzero"`
	// Metadata patch. Set a key to a string to upsert it, or to null to delete it.
	// Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars
	// each) with values up to 512 chars.
	Metadata map[string]string `json:"metadata,omitzero"`
	// tracks. Full replacement. Omit to preserve; send empty array or null to clear.
	Tracks []BetaManagedAgentsTrackParamsUnion `json:"tracks,omitzero"`
	// Tool configurations available to the agent. Full replacement. Omit to preserve;
	// send empty array or null to clear. Maximum of 128 tools across all toolsets
	// allowed.
	Tools []BetaAgentUpdateParamsToolUnion `json:"tools,omitzero"`
	// Model identifier. Accepts the
	// [model string](https://platform.haijun.com/docs/en/about-haijun/models/overview#latest-models-comparison),
	// e.g. `haijun-opus-4-6`, or a `model_config` object for additional configuration
	// control. Omit to preserve. Cannot be cleared.
	Model BetaManagedAgentsModelConfigParams `json:"model,omitzero"`
	// A coordinator topology: the session's primary thread orchestrates work by
	// spawning session threads, each running an agent drawn from the `agents` roster.
	Multiagent BetaManagedAgentsMultiagentParams `json:"multiagent,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaAgentUpdateParams) MarshalJSON

func (r BetaAgentUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaAgentUpdateParams) UnmarshalJSON

func (r *BetaAgentUpdateParams) UnmarshalJSON(data []byte) error

type BetaAgentUpdateParamsToolUnion

type BetaAgentUpdateParamsToolUnion struct {
	OfAgentToolset20260401 *BetaManagedAgentsAgentToolset20260401Params `json:",omitzero,inline"`
	OfMCPToolset           *BetaManagedAgentsMCPToolsetParams           `json:",omitzero,inline"`
	OfCustom               *BetaManagedAgentsCustomToolParams           `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 (BetaAgentUpdateParamsToolUnion) GetConfigs

func (u BetaAgentUpdateParamsToolUnion) GetConfigs() (res betaAgentUpdateParamsToolUnionConfigs)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaAgentUpdateParamsToolUnion) GetDefaultConfig

func (u BetaAgentUpdateParamsToolUnion) GetDefaultConfig() (res betaAgentUpdateParamsToolUnionDefaultConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaAgentUpdateParamsToolUnion) GetDescription

func (u BetaAgentUpdateParamsToolUnion) GetDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentUpdateParamsToolUnion) GetInputSchema

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentUpdateParamsToolUnion) GetMCPServerName

func (u BetaAgentUpdateParamsToolUnion) GetMCPServerName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentUpdateParamsToolUnion) GetName

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentUpdateParamsToolUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaAgentUpdateParamsToolUnion) MarshalJSON

func (u BetaAgentUpdateParamsToolUnion) MarshalJSON() ([]byte, error)

func (*BetaAgentUpdateParamsToolUnion) UnmarshalJSON

func (u *BetaAgentUpdateParamsToolUnion) UnmarshalJSON(data []byte) error

type BetaAgentVersionListParams

type BetaAgentVersionListParams struct {
	// Maximum results per page. Default 20, maximum 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaAgentVersionListParams) URLQuery

func (r BetaAgentVersionListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaAgentVersionListParams's query parameters as `url.Values`.

type BetaAgentVersionService

type BetaAgentVersionService struct {
	Options []option.RequestOption
}

BetaAgentVersionService contains methods and other services that help with interacting with the Juglow 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 NewBetaAgentVersionService method instead.

func NewBetaAgentVersionService

func NewBetaAgentVersionService(opts ...option.RequestOption) (r BetaAgentVersionService)

NewBetaAgentVersionService 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 (*BetaAgentVersionService) List

List Agent Versions

func (*BetaAgentVersionService) ListAutoPaging

List Agent Versions

type BetaAllThinkingTurnsParam

type BetaAllThinkingTurnsParam struct {
	Type constant.All `json:"type" default:"all"`
	// contains filtered or unexported fields
}

This struct has a constant value, construct it with NewBetaAllThinkingTurnsParam.

func NewBetaAllThinkingTurnsParam

func NewBetaAllThinkingTurnsParam() BetaAllThinkingTurnsParam

func (BetaAllThinkingTurnsParam) MarshalJSON

func (r BetaAllThinkingTurnsParam) MarshalJSON() (data []byte, err error)

func (*BetaAllThinkingTurnsParam) UnmarshalJSON

func (r *BetaAllThinkingTurnsParam) UnmarshalJSON(data []byte) error

type BetaAuthenticationError

type BetaAuthenticationError struct {
	Message string                       `json:"message" api:"required"`
	Type    constant.AuthenticationError `json:"type" default:"authentication_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaAuthenticationError) RawJSON

func (r BetaAuthenticationError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaAuthenticationError) UnmarshalJSON

func (r *BetaAuthenticationError) UnmarshalJSON(data []byte) error

type BetaBase64ImageSourceMediaType

type BetaBase64ImageSourceMediaType string
const (
	BetaBase64ImageSourceMediaTypeImageJPEG BetaBase64ImageSourceMediaType = "image/jpeg"
	BetaBase64ImageSourceMediaTypeImagePNG  BetaBase64ImageSourceMediaType = "image/png"
	BetaBase64ImageSourceMediaTypeImageGIF  BetaBase64ImageSourceMediaType = "image/gif"
	BetaBase64ImageSourceMediaTypeImageWebP BetaBase64ImageSourceMediaType = "image/webp"
)

type BetaBase64ImageSourceParam

type BetaBase64ImageSourceParam struct {
	Data string `json:"data" api:"required" format:"byte"`
	// Any of "image/jpeg", "image/png", "image/gif", "image/webp".
	MediaType BetaBase64ImageSourceMediaType `json:"media_type,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "base64".
	Type constant.Base64 `json:"type" default:"base64"`
	// contains filtered or unexported fields
}

The properties Data, MediaType, Type are required.

func (BetaBase64ImageSourceParam) MarshalJSON

func (r BetaBase64ImageSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaBase64ImageSourceParam) UnmarshalJSON

func (r *BetaBase64ImageSourceParam) UnmarshalJSON(data []byte) error

type BetaBase64PDFSource

type BetaBase64PDFSource struct {
	Data      string                  `json:"data" api:"required" format:"byte"`
	MediaType constant.ApplicationPDF `json:"media_type" default:"application/pdf"`
	Type      constant.Base64         `json:"type" default:"base64"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		MediaType   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaBase64PDFSource) RawJSON

func (r BetaBase64PDFSource) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaBase64PDFSource) ToParam

ToParam converts this BetaBase64PDFSource to a BetaBase64PDFSourceParam.

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 BetaBase64PDFSourceParam.Overrides()

func (*BetaBase64PDFSource) UnmarshalJSON

func (r *BetaBase64PDFSource) UnmarshalJSON(data []byte) error

type BetaBase64PDFSourceParam

type BetaBase64PDFSourceParam struct {
	Data string `json:"data" api:"required" format:"byte"`
	// This field can be elided, and will marshal its zero value as "application/pdf".
	MediaType constant.ApplicationPDF `json:"media_type" default:"application/pdf"`
	// This field can be elided, and will marshal its zero value as "base64".
	Type constant.Base64 `json:"type" default:"base64"`
	// contains filtered or unexported fields
}

The properties Data, MediaType, Type are required.

func (BetaBase64PDFSourceParam) MarshalJSON

func (r BetaBase64PDFSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaBase64PDFSourceParam) UnmarshalJSON

func (r *BetaBase64PDFSourceParam) UnmarshalJSON(data []byte) error

type BetaBashCodeExecutionOutputBlock

type BetaBashCodeExecutionOutputBlock struct {
	FileID string                           `json:"file_id" api:"required"`
	Type   constant.BashCodeExecutionOutput `json:"type" default:"bash_code_execution_output"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaBashCodeExecutionOutputBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaBashCodeExecutionOutputBlock) ToParam

func (*BetaBashCodeExecutionOutputBlock) UnmarshalJSON

func (r *BetaBashCodeExecutionOutputBlock) UnmarshalJSON(data []byte) error

type BetaBashCodeExecutionOutputBlockParam

type BetaBashCodeExecutionOutputBlockParam struct {
	FileID string `json:"file_id" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "bash_code_execution_output".
	Type constant.BashCodeExecutionOutput `json:"type" default:"bash_code_execution_output"`
	// contains filtered or unexported fields
}

The properties FileID, Type are required.

func (BetaBashCodeExecutionOutputBlockParam) MarshalJSON

func (r BetaBashCodeExecutionOutputBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaBashCodeExecutionOutputBlockParam) UnmarshalJSON

func (r *BetaBashCodeExecutionOutputBlockParam) UnmarshalJSON(data []byte) error

type BetaBashCodeExecutionResultBlock

type BetaBashCodeExecutionResultBlock struct {
	Content    []BetaBashCodeExecutionOutputBlock `json:"content" api:"required"`
	ReturnCode int64                              `json:"return_code" api:"required"`
	Stderr     string                             `json:"stderr" api:"required"`
	Stdout     string                             `json:"stdout" api:"required"`
	Type       constant.BashCodeExecutionResult   `json:"type" default:"bash_code_execution_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ReturnCode  respjson.Field
		Stderr      respjson.Field
		Stdout      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaBashCodeExecutionResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BetaBashCodeExecutionResultBlock) UnmarshalJSON

func (r *BetaBashCodeExecutionResultBlock) UnmarshalJSON(data []byte) error

type BetaBashCodeExecutionResultBlockParam

type BetaBashCodeExecutionResultBlockParam struct {
	Content    []BetaBashCodeExecutionOutputBlockParam `json:"content,omitzero" api:"required"`
	ReturnCode int64                                   `json:"return_code" api:"required"`
	Stderr     string                                  `json:"stderr" api:"required"`
	Stdout     string                                  `json:"stdout" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "bash_code_execution_result".
	Type constant.BashCodeExecutionResult `json:"type" default:"bash_code_execution_result"`
	// contains filtered or unexported fields
}

The properties Content, ReturnCode, Stderr, Stdout, Type are required.

func (BetaBashCodeExecutionResultBlockParam) MarshalJSON

func (r BetaBashCodeExecutionResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaBashCodeExecutionResultBlockParam) UnmarshalJSON

func (r *BetaBashCodeExecutionResultBlockParam) UnmarshalJSON(data []byte) error

type BetaBashCodeExecutionToolResultBlock

type BetaBashCodeExecutionToolResultBlock struct {
	Content   BetaBashCodeExecutionToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                           `json:"tool_use_id" api:"required"`
	Type      constant.BashCodeExecutionToolResult             `json:"type" default:"bash_code_execution_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaBashCodeExecutionToolResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaBashCodeExecutionToolResultBlock) ToParam

func (*BetaBashCodeExecutionToolResultBlock) UnmarshalJSON

func (r *BetaBashCodeExecutionToolResultBlock) UnmarshalJSON(data []byte) error

type BetaBashCodeExecutionToolResultBlockContentUnion

type BetaBashCodeExecutionToolResultBlockContentUnion struct {
	// This field is from variant [BetaBashCodeExecutionToolResultError].
	ErrorCode BetaBashCodeExecutionToolResultErrorErrorCode `json:"error_code"`
	Type      string                                        `json:"type"`
	// This field is from variant [BetaBashCodeExecutionResultBlock].
	Content []BetaBashCodeExecutionOutputBlock `json:"content"`
	// This field is from variant [BetaBashCodeExecutionResultBlock].
	ReturnCode int64 `json:"return_code"`
	// This field is from variant [BetaBashCodeExecutionResultBlock].
	Stderr string `json:"stderr"`
	// This field is from variant [BetaBashCodeExecutionResultBlock].
	Stdout string `json:"stdout"`
	JSON   struct {
		ErrorCode  respjson.Field
		Type       respjson.Field
		Content    respjson.Field
		ReturnCode respjson.Field
		Stderr     respjson.Field
		Stdout     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaBashCodeExecutionToolResultBlockContentUnion contains all possible properties and values from BetaBashCodeExecutionToolResultError, BetaBashCodeExecutionResultBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaBashCodeExecutionToolResultBlockContentUnion) AsResponseBashCodeExecutionResultBlock

func (u BetaBashCodeExecutionToolResultBlockContentUnion) AsResponseBashCodeExecutionResultBlock() (v BetaBashCodeExecutionResultBlock)

func (BetaBashCodeExecutionToolResultBlockContentUnion) AsResponseBashCodeExecutionToolResultError

func (u BetaBashCodeExecutionToolResultBlockContentUnion) AsResponseBashCodeExecutionToolResultError() (v BetaBashCodeExecutionToolResultError)

func (BetaBashCodeExecutionToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaBashCodeExecutionToolResultBlockContentUnion) UnmarshalJSON

type BetaBashCodeExecutionToolResultBlockParam

type BetaBashCodeExecutionToolResultBlockParam struct {
	Content   BetaBashCodeExecutionToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                                `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "bash_code_execution_tool_result".
	Type constant.BashCodeExecutionToolResult `json:"type" default:"bash_code_execution_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (BetaBashCodeExecutionToolResultBlockParam) MarshalJSON

func (r BetaBashCodeExecutionToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaBashCodeExecutionToolResultBlockParam) UnmarshalJSON

func (r *BetaBashCodeExecutionToolResultBlockParam) UnmarshalJSON(data []byte) error

type BetaBashCodeExecutionToolResultBlockParamContentUnion

type BetaBashCodeExecutionToolResultBlockParamContentUnion struct {
	OfRequestBashCodeExecutionToolResultError *BetaBashCodeExecutionToolResultErrorParam `json:",omitzero,inline"`
	OfRequestBashCodeExecutionResultBlock     *BetaBashCodeExecutionResultBlockParam     `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 (BetaBashCodeExecutionToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BetaBashCodeExecutionToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (BetaBashCodeExecutionToolResultBlockParamContentUnion) GetReturnCode

Returns a pointer to the underlying variant's property, if present.

func (BetaBashCodeExecutionToolResultBlockParamContentUnion) GetStderr

Returns a pointer to the underlying variant's property, if present.

func (BetaBashCodeExecutionToolResultBlockParamContentUnion) GetStdout

Returns a pointer to the underlying variant's property, if present.

func (BetaBashCodeExecutionToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaBashCodeExecutionToolResultBlockParamContentUnion) MarshalJSON

func (*BetaBashCodeExecutionToolResultBlockParamContentUnion) UnmarshalJSON

type BetaBashCodeExecutionToolResultError

type BetaBashCodeExecutionToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded", "output_file_too_large".
	ErrorCode BetaBashCodeExecutionToolResultErrorErrorCode `json:"error_code" api:"required"`
	Type      constant.BashCodeExecutionToolResultError     `json:"type" default:"bash_code_execution_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaBashCodeExecutionToolResultError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaBashCodeExecutionToolResultError) UnmarshalJSON

func (r *BetaBashCodeExecutionToolResultError) UnmarshalJSON(data []byte) error

type BetaBashCodeExecutionToolResultErrorErrorCode

type BetaBashCodeExecutionToolResultErrorErrorCode string
const (
	BetaBashCodeExecutionToolResultErrorErrorCodeInvalidToolInput      BetaBashCodeExecutionToolResultErrorErrorCode = "invalid_tool_input"
	BetaBashCodeExecutionToolResultErrorErrorCodeUnavailable           BetaBashCodeExecutionToolResultErrorErrorCode = "unavailable"
	BetaBashCodeExecutionToolResultErrorErrorCodeTooManyRequests       BetaBashCodeExecutionToolResultErrorErrorCode = "too_many_requests"
	BetaBashCodeExecutionToolResultErrorErrorCodeExecutionTimeExceeded BetaBashCodeExecutionToolResultErrorErrorCode = "execution_time_exceeded"
	BetaBashCodeExecutionToolResultErrorErrorCodeOutputFileTooLarge    BetaBashCodeExecutionToolResultErrorErrorCode = "output_file_too_large"
)

type BetaBashCodeExecutionToolResultErrorParam

type BetaBashCodeExecutionToolResultErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded", "output_file_too_large".
	ErrorCode BetaBashCodeExecutionToolResultErrorParamErrorCode `json:"error_code,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "bash_code_execution_tool_result_error".
	Type constant.BashCodeExecutionToolResultError `json:"type" default:"bash_code_execution_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (BetaBashCodeExecutionToolResultErrorParam) MarshalJSON

func (r BetaBashCodeExecutionToolResultErrorParam) MarshalJSON() (data []byte, err error)

func (*BetaBashCodeExecutionToolResultErrorParam) UnmarshalJSON

func (r *BetaBashCodeExecutionToolResultErrorParam) UnmarshalJSON(data []byte) error

type BetaBashCodeExecutionToolResultErrorParamErrorCode

type BetaBashCodeExecutionToolResultErrorParamErrorCode string
const (
	BetaBashCodeExecutionToolResultErrorParamErrorCodeInvalidToolInput      BetaBashCodeExecutionToolResultErrorParamErrorCode = "invalid_tool_input"
	BetaBashCodeExecutionToolResultErrorParamErrorCodeUnavailable           BetaBashCodeExecutionToolResultErrorParamErrorCode = "unavailable"
	BetaBashCodeExecutionToolResultErrorParamErrorCodeTooManyRequests       BetaBashCodeExecutionToolResultErrorParamErrorCode = "too_many_requests"
	BetaBashCodeExecutionToolResultErrorParamErrorCodeExecutionTimeExceeded BetaBashCodeExecutionToolResultErrorParamErrorCode = "execution_time_exceeded"
	BetaBashCodeExecutionToolResultErrorParamErrorCodeOutputFileTooLarge    BetaBashCodeExecutionToolResultErrorParamErrorCode = "output_file_too_large"
)

type BetaBillingError

type BetaBillingError struct {
	Message string                `json:"message" api:"required"`
	Type    constant.BillingError `json:"type" default:"billing_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaBillingError) RawJSON

func (r BetaBillingError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaBillingError) UnmarshalJSON

func (r *BetaBillingError) UnmarshalJSON(data []byte) error

type BetaCacheControlEphemeralParam

type BetaCacheControlEphemeralParam struct {
	// The time-to-live for the cache control breakpoint.
	//
	// This may be one the following values:
	//
	// - `5m`: 5 minutes
	// - `1h`: 1 hour
	//
	// Defaults to `5m`. See
	// [prompt caching pricing](https://platform.haijun.com/docs/en/build-with-haijun/prompt-caching)
	// for details.
	//
	// Any of "5m", "1h".
	TTL  BetaCacheControlEphemeralTTL `json:"ttl,omitzero"`
	Type constant.Ephemeral           `json:"type" default:"ephemeral"`
	// contains filtered or unexported fields
}

This struct has a constant value, construct it with NewBetaCacheControlEphemeralParam.

func NewBetaCacheControlEphemeralParam

func NewBetaCacheControlEphemeralParam() BetaCacheControlEphemeralParam

func (BetaCacheControlEphemeralParam) MarshalJSON

func (r BetaCacheControlEphemeralParam) MarshalJSON() (data []byte, err error)

func (*BetaCacheControlEphemeralParam) UnmarshalJSON

func (r *BetaCacheControlEphemeralParam) UnmarshalJSON(data []byte) error

type BetaCacheControlEphemeralTTL

type BetaCacheControlEphemeralTTL string

The time-to-live for the cache control breakpoint.

This may be one the following values:

- `5m`: 5 minutes - `1h`: 1 hour

Defaults to `5m`. See [prompt caching pricing](https://platform.haijun.com/docs/en/build-with-haijun/prompt-caching) for details.

const (
	BetaCacheControlEphemeralTTLTTL5m BetaCacheControlEphemeralTTL = "5m"
	BetaCacheControlEphemeralTTLTTL1h BetaCacheControlEphemeralTTL = "1h"
)

type BetaCacheCreation

type BetaCacheCreation struct {
	// The number of input tokens used to create the 1 hour cache entry.
	Ephemeral1hInputTokens int64 `json:"ephemeral_1h_input_tokens" api:"required"`
	// The number of input tokens used to create the 5 minute cache entry.
	Ephemeral5mInputTokens int64 `json:"ephemeral_5m_input_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Ephemeral1hInputTokens respjson.Field
		Ephemeral5mInputTokens respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCacheCreation) RawJSON

func (r BetaCacheCreation) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCacheCreation) UnmarshalJSON

func (r *BetaCacheCreation) UnmarshalJSON(data []byte) error

type BetaCacheMissMessagesChanged

type BetaCacheMissMessagesChanged struct {
	// Approximate number of input tokens that would have been read from cache had the
	// prefix matched the previous request.
	CacheMissedInputTokens int64                    `json:"cache_missed_input_tokens" api:"required"`
	Type                   constant.MessagesChanged `json:"type" default:"messages_changed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMissedInputTokens respjson.Field
		Type                   respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCacheMissMessagesChanged) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCacheMissMessagesChanged) UnmarshalJSON

func (r *BetaCacheMissMessagesChanged) UnmarshalJSON(data []byte) error

type BetaCacheMissModelChanged

type BetaCacheMissModelChanged struct {
	// Approximate number of input tokens that would have been read from cache had the
	// prefix matched the previous request.
	CacheMissedInputTokens int64                 `json:"cache_missed_input_tokens" api:"required"`
	Type                   constant.ModelChanged `json:"type" default:"model_changed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMissedInputTokens respjson.Field
		Type                   respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCacheMissModelChanged) RawJSON

func (r BetaCacheMissModelChanged) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCacheMissModelChanged) UnmarshalJSON

func (r *BetaCacheMissModelChanged) UnmarshalJSON(data []byte) error

type BetaCacheMissPreviousMessageNotFound

type BetaCacheMissPreviousMessageNotFound struct {
	Type constant.PreviousMessageNotFound `json:"type" default:"previous_message_not_found"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCacheMissPreviousMessageNotFound) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCacheMissPreviousMessageNotFound) UnmarshalJSON

func (r *BetaCacheMissPreviousMessageNotFound) UnmarshalJSON(data []byte) error

type BetaCacheMissSystemChanged

type BetaCacheMissSystemChanged struct {
	// Approximate number of input tokens that would have been read from cache had the
	// prefix matched the previous request.
	CacheMissedInputTokens int64                  `json:"cache_missed_input_tokens" api:"required"`
	Type                   constant.SystemChanged `json:"type" default:"system_changed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMissedInputTokens respjson.Field
		Type                   respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCacheMissSystemChanged) RawJSON

func (r BetaCacheMissSystemChanged) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCacheMissSystemChanged) UnmarshalJSON

func (r *BetaCacheMissSystemChanged) UnmarshalJSON(data []byte) error

type BetaCacheMissToolsChanged

type BetaCacheMissToolsChanged struct {
	// Approximate number of input tokens that would have been read from cache had the
	// prefix matched the previous request.
	CacheMissedInputTokens int64                 `json:"cache_missed_input_tokens" api:"required"`
	Type                   constant.ToolsChanged `json:"type" default:"tools_changed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMissedInputTokens respjson.Field
		Type                   respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCacheMissToolsChanged) RawJSON

func (r BetaCacheMissToolsChanged) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCacheMissToolsChanged) UnmarshalJSON

func (r *BetaCacheMissToolsChanged) UnmarshalJSON(data []byte) error

type BetaCacheMissUnavailable

type BetaCacheMissUnavailable struct {
	Type constant.Unavailable `json:"type" default:"unavailable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCacheMissUnavailable) RawJSON

func (r BetaCacheMissUnavailable) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCacheMissUnavailable) UnmarshalJSON

func (r *BetaCacheMissUnavailable) UnmarshalJSON(data []byte) error

type BetaCapabilitySupport

type BetaCapabilitySupport struct {
	// Whether this capability is supported by the model.
	Supported bool `json:"supported" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Supported   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates whether a capability is supported.

func (BetaCapabilitySupport) RawJSON

func (r BetaCapabilitySupport) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCapabilitySupport) UnmarshalJSON

func (r *BetaCapabilitySupport) UnmarshalJSON(data []byte) error

type BetaCitationCharLocation

type BetaCitationCharLocation struct {
	CitedText      string                `json:"cited_text" api:"required"`
	DocumentIndex  int64                 `json:"document_index" api:"required"`
	DocumentTitle  string                `json:"document_title" api:"required"`
	EndCharIndex   int64                 `json:"end_char_index" api:"required"`
	FileID         string                `json:"file_id" api:"required"`
	StartCharIndex int64                 `json:"start_char_index" api:"required"`
	Type           constant.CharLocation `json:"type" default:"char_location"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText      respjson.Field
		DocumentIndex  respjson.Field
		DocumentTitle  respjson.Field
		EndCharIndex   respjson.Field
		FileID         respjson.Field
		StartCharIndex respjson.Field
		Type           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCitationCharLocation) RawJSON

func (r BetaCitationCharLocation) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCitationCharLocation) UnmarshalJSON

func (r *BetaCitationCharLocation) UnmarshalJSON(data []byte) error

type BetaCitationCharLocationParam

type BetaCitationCharLocationParam struct {
	DocumentTitle  param.Opt[string] `json:"document_title,omitzero" api:"required"`
	CitedText      string            `json:"cited_text" api:"required"`
	DocumentIndex  int64             `json:"document_index" api:"required"`
	EndCharIndex   int64             `json:"end_char_index" api:"required"`
	StartCharIndex int64             `json:"start_char_index" api:"required"`
	// This field can be elided, and will marshal its zero value as "char_location".
	Type constant.CharLocation `json:"type" default:"char_location"`
	// contains filtered or unexported fields
}

The properties CitedText, DocumentIndex, DocumentTitle, EndCharIndex, StartCharIndex, Type are required.

func (BetaCitationCharLocationParam) MarshalJSON

func (r BetaCitationCharLocationParam) MarshalJSON() (data []byte, err error)

func (*BetaCitationCharLocationParam) UnmarshalJSON

func (r *BetaCitationCharLocationParam) UnmarshalJSON(data []byte) error

type BetaCitationConfig

type BetaCitationConfig struct {
	Enabled bool `json:"enabled" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCitationConfig) RawJSON

func (r BetaCitationConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCitationConfig) UnmarshalJSON

func (r *BetaCitationConfig) UnmarshalJSON(data []byte) error

type BetaCitationContentBlockLocation

type BetaCitationContentBlockLocation struct {
	// The full text of the cited block range, concatenated.
	//
	// Always equals the contents of `content[start_block_index:end_block_index]`
	// joined together. The text block is the minimal citable unit; this field is never
	// a substring of a single block. Not counted toward output tokens, and not counted
	// toward input tokens when sent back in subsequent turns.
	CitedText     string `json:"cited_text" api:"required"`
	DocumentIndex int64  `json:"document_index" api:"required"`
	DocumentTitle string `json:"document_title" api:"required"`
	// Exclusive 0-based end index of the cited block range in the source's `content`
	// array.
	//
	// Always greater than `start_block_index`; a single-block citation has
	// `end_block_index = start_block_index + 1`.
	EndBlockIndex int64  `json:"end_block_index" api:"required"`
	FileID        string `json:"file_id" api:"required"`
	// 0-based index of the first cited block in the source's `content` array.
	StartBlockIndex int64                         `json:"start_block_index" api:"required"`
	Type            constant.ContentBlockLocation `json:"type" default:"content_block_location"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText       respjson.Field
		DocumentIndex   respjson.Field
		DocumentTitle   respjson.Field
		EndBlockIndex   respjson.Field
		FileID          respjson.Field
		StartBlockIndex respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCitationContentBlockLocation) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCitationContentBlockLocation) UnmarshalJSON

func (r *BetaCitationContentBlockLocation) UnmarshalJSON(data []byte) error

type BetaCitationContentBlockLocationParam

type BetaCitationContentBlockLocationParam struct {
	DocumentTitle param.Opt[string] `json:"document_title,omitzero" api:"required"`
	// The full text of the cited block range, concatenated.
	//
	// Always equals the contents of `content[start_block_index:end_block_index]`
	// joined together. The text block is the minimal citable unit; this field is never
	// a substring of a single block. Not counted toward output tokens, and not counted
	// toward input tokens when sent back in subsequent turns.
	CitedText     string `json:"cited_text" api:"required"`
	DocumentIndex int64  `json:"document_index" api:"required"`
	// Exclusive 0-based end index of the cited block range in the source's `content`
	// array.
	//
	// Always greater than `start_block_index`; a single-block citation has
	// `end_block_index = start_block_index + 1`.
	EndBlockIndex int64 `json:"end_block_index" api:"required"`
	// 0-based index of the first cited block in the source's `content` array.
	StartBlockIndex int64 `json:"start_block_index" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "content_block_location".
	Type constant.ContentBlockLocation `json:"type" default:"content_block_location"`
	// contains filtered or unexported fields
}

The properties CitedText, DocumentIndex, DocumentTitle, EndBlockIndex, StartBlockIndex, Type are required.

func (BetaCitationContentBlockLocationParam) MarshalJSON

func (r BetaCitationContentBlockLocationParam) MarshalJSON() (data []byte, err error)

func (*BetaCitationContentBlockLocationParam) UnmarshalJSON

func (r *BetaCitationContentBlockLocationParam) UnmarshalJSON(data []byte) error

type BetaCitationPageLocation

type BetaCitationPageLocation struct {
	CitedText       string                `json:"cited_text" api:"required"`
	DocumentIndex   int64                 `json:"document_index" api:"required"`
	DocumentTitle   string                `json:"document_title" api:"required"`
	EndPageNumber   int64                 `json:"end_page_number" api:"required"`
	FileID          string                `json:"file_id" api:"required"`
	StartPageNumber int64                 `json:"start_page_number" api:"required"`
	Type            constant.PageLocation `json:"type" default:"page_location"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText       respjson.Field
		DocumentIndex   respjson.Field
		DocumentTitle   respjson.Field
		EndPageNumber   respjson.Field
		FileID          respjson.Field
		StartPageNumber respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCitationPageLocation) RawJSON

func (r BetaCitationPageLocation) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCitationPageLocation) UnmarshalJSON

func (r *BetaCitationPageLocation) UnmarshalJSON(data []byte) error

type BetaCitationPageLocationParam

type BetaCitationPageLocationParam struct {
	DocumentTitle   param.Opt[string] `json:"document_title,omitzero" api:"required"`
	CitedText       string            `json:"cited_text" api:"required"`
	DocumentIndex   int64             `json:"document_index" api:"required"`
	EndPageNumber   int64             `json:"end_page_number" api:"required"`
	StartPageNumber int64             `json:"start_page_number" api:"required"`
	// This field can be elided, and will marshal its zero value as "page_location".
	Type constant.PageLocation `json:"type" default:"page_location"`
	// contains filtered or unexported fields
}

The properties CitedText, DocumentIndex, DocumentTitle, EndPageNumber, StartPageNumber, Type are required.

func (BetaCitationPageLocationParam) MarshalJSON

func (r BetaCitationPageLocationParam) MarshalJSON() (data []byte, err error)

func (*BetaCitationPageLocationParam) UnmarshalJSON

func (r *BetaCitationPageLocationParam) UnmarshalJSON(data []byte) error

type BetaCitationSearchResultLocation

type BetaCitationSearchResultLocation struct {
	// The full text of the cited block range, concatenated.
	//
	// Always equals the contents of `content[start_block_index:end_block_index]`
	// joined together. The text block is the minimal citable unit; this field is never
	// a substring of a single block. Not counted toward output tokens, and not counted
	// toward input tokens when sent back in subsequent turns.
	CitedText string `json:"cited_text" api:"required"`
	// Exclusive 0-based end index of the cited block range in the source's `content`
	// array.
	//
	// Always greater than `start_block_index`; a single-block citation has
	// `end_block_index = start_block_index + 1`.
	EndBlockIndex int64 `json:"end_block_index" api:"required"`
	// 0-based index of the cited search result among all `search_result` content
	// blocks in the request, in the order they appear across messages and tool
	// results.
	//
	// Counted separately from `document_index`; server-side web search results are not
	// included in this count.
	SearchResultIndex int64  `json:"search_result_index" api:"required"`
	Source            string `json:"source" api:"required"`
	// 0-based index of the first cited block in the source's `content` array.
	StartBlockIndex int64                         `json:"start_block_index" api:"required"`
	Title           string                        `json:"title" api:"required"`
	Type            constant.SearchResultLocation `json:"type" default:"search_result_location"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText         respjson.Field
		EndBlockIndex     respjson.Field
		SearchResultIndex respjson.Field
		Source            respjson.Field
		StartBlockIndex   respjson.Field
		Title             respjson.Field
		Type              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCitationSearchResultLocation) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCitationSearchResultLocation) UnmarshalJSON

func (r *BetaCitationSearchResultLocation) UnmarshalJSON(data []byte) error

type BetaCitationSearchResultLocationParam

type BetaCitationSearchResultLocationParam struct {
	Title param.Opt[string] `json:"title,omitzero" api:"required"`
	// The full text of the cited block range, concatenated.
	//
	// Always equals the contents of `content[start_block_index:end_block_index]`
	// joined together. The text block is the minimal citable unit; this field is never
	// a substring of a single block. Not counted toward output tokens, and not counted
	// toward input tokens when sent back in subsequent turns.
	CitedText string `json:"cited_text" api:"required"`
	// Exclusive 0-based end index of the cited block range in the source's `content`
	// array.
	//
	// Always greater than `start_block_index`; a single-block citation has
	// `end_block_index = start_block_index + 1`.
	EndBlockIndex int64 `json:"end_block_index" api:"required"`
	// 0-based index of the cited search result among all `search_result` content
	// blocks in the request, in the order they appear across messages and tool
	// results.
	//
	// Counted separately from `document_index`; server-side web search results are not
	// included in this count.
	SearchResultIndex int64  `json:"search_result_index" api:"required"`
	Source            string `json:"source" api:"required"`
	// 0-based index of the first cited block in the source's `content` array.
	StartBlockIndex int64 `json:"start_block_index" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "search_result_location".
	Type constant.SearchResultLocation `json:"type" default:"search_result_location"`
	// contains filtered or unexported fields
}

The properties CitedText, EndBlockIndex, SearchResultIndex, Source, StartBlockIndex, Title, Type are required.

func (BetaCitationSearchResultLocationParam) MarshalJSON

func (r BetaCitationSearchResultLocationParam) MarshalJSON() (data []byte, err error)

func (*BetaCitationSearchResultLocationParam) UnmarshalJSON

func (r *BetaCitationSearchResultLocationParam) UnmarshalJSON(data []byte) error

type BetaCitationWebSearchResultLocationParam

type BetaCitationWebSearchResultLocationParam struct {
	Title          param.Opt[string] `json:"title,omitzero" api:"required"`
	CitedText      string            `json:"cited_text" api:"required"`
	EncryptedIndex string            `json:"encrypted_index" api:"required"`
	URL            string            `json:"url" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_result_location".
	Type constant.WebSearchResultLocation `json:"type" default:"web_search_result_location"`
	// contains filtered or unexported fields
}

The properties CitedText, EncryptedIndex, Title, Type, URL are required.

func (BetaCitationWebSearchResultLocationParam) MarshalJSON

func (r BetaCitationWebSearchResultLocationParam) MarshalJSON() (data []byte, err error)

func (*BetaCitationWebSearchResultLocationParam) UnmarshalJSON

func (r *BetaCitationWebSearchResultLocationParam) UnmarshalJSON(data []byte) error

type BetaCitationsConfigParam

type BetaCitationsConfigParam struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (BetaCitationsConfigParam) MarshalJSON

func (r BetaCitationsConfigParam) MarshalJSON() (data []byte, err error)

func (*BetaCitationsConfigParam) UnmarshalJSON

func (r *BetaCitationsConfigParam) UnmarshalJSON(data []byte) error

type BetaCitationsDelta

type BetaCitationsDelta struct {
	Citation BetaCitationsDeltaCitationUnion `json:"citation" api:"required"`
	Type     constant.CitationsDelta         `json:"type" default:"citations_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Citation    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCitationsDelta) RawJSON

func (r BetaCitationsDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCitationsDelta) UnmarshalJSON

func (r *BetaCitationsDelta) UnmarshalJSON(data []byte) error

type BetaCitationsDeltaCitationUnion

type BetaCitationsDeltaCitationUnion struct {
	CitedText     string `json:"cited_text"`
	DocumentIndex int64  `json:"document_index"`
	DocumentTitle string `json:"document_title"`
	// This field is from variant [BetaCitationCharLocation].
	EndCharIndex int64  `json:"end_char_index"`
	FileID       string `json:"file_id"`
	// This field is from variant [BetaCitationCharLocation].
	StartCharIndex int64 `json:"start_char_index"`
	// Any of "char_location", "page_location", "content_block_location",
	// "web_search_result_location", "search_result_location".
	Type string `json:"type"`
	// This field is from variant [BetaCitationPageLocation].
	EndPageNumber int64 `json:"end_page_number"`
	// This field is from variant [BetaCitationPageLocation].
	StartPageNumber int64 `json:"start_page_number"`
	EndBlockIndex   int64 `json:"end_block_index"`
	StartBlockIndex int64 `json:"start_block_index"`
	// This field is from variant [BetaCitationsWebSearchResultLocation].
	EncryptedIndex string `json:"encrypted_index"`
	Title          string `json:"title"`
	// This field is from variant [BetaCitationsWebSearchResultLocation].
	URL string `json:"url"`
	// This field is from variant [BetaCitationSearchResultLocation].
	SearchResultIndex int64 `json:"search_result_index"`
	// This field is from variant [BetaCitationSearchResultLocation].
	Source string `json:"source"`
	JSON   struct {
		CitedText         respjson.Field
		DocumentIndex     respjson.Field
		DocumentTitle     respjson.Field
		EndCharIndex      respjson.Field
		FileID            respjson.Field
		StartCharIndex    respjson.Field
		Type              respjson.Field
		EndPageNumber     respjson.Field
		StartPageNumber   respjson.Field
		EndBlockIndex     respjson.Field
		StartBlockIndex   respjson.Field
		EncryptedIndex    respjson.Field
		Title             respjson.Field
		URL               respjson.Field
		SearchResultIndex respjson.Field
		Source            respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaCitationsDeltaCitationUnion contains all possible properties and values from BetaCitationCharLocation, BetaCitationPageLocation, BetaCitationContentBlockLocation, BetaCitationsWebSearchResultLocation, BetaCitationSearchResultLocation.

Use the BetaCitationsDeltaCitationUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaCitationsDeltaCitationUnion) AsAny

func (u BetaCitationsDeltaCitationUnion) AsAny() anyBetaCitationsDeltaCitation

Use the following switch statement to find the correct variant

switch variant := BetaCitationsDeltaCitationUnion.AsAny().(type) {
case Juglow.BetaCitationCharLocation:
case Juglow.BetaCitationPageLocation:
case Juglow.BetaCitationContentBlockLocation:
case Juglow.BetaCitationsWebSearchResultLocation:
case Juglow.BetaCitationSearchResultLocation:
default:
  fmt.Errorf("no variant present")
}

func (BetaCitationsDeltaCitationUnion) AsCharLocation

func (BetaCitationsDeltaCitationUnion) AsContentBlockLocation

func (BetaCitationsDeltaCitationUnion) AsPageLocation

func (BetaCitationsDeltaCitationUnion) AsSearchResultLocation

func (BetaCitationsDeltaCitationUnion) AsWebSearchResultLocation

func (BetaCitationsDeltaCitationUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCitationsDeltaCitationUnion) UnmarshalJSON

func (r *BetaCitationsDeltaCitationUnion) UnmarshalJSON(data []byte) error

type BetaCitationsWebSearchResultLocation

type BetaCitationsWebSearchResultLocation struct {
	CitedText      string                           `json:"cited_text" api:"required"`
	EncryptedIndex string                           `json:"encrypted_index" api:"required"`
	Title          string                           `json:"title" api:"required"`
	Type           constant.WebSearchResultLocation `json:"type" default:"web_search_result_location"`
	URL            string                           `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText      respjson.Field
		EncryptedIndex respjson.Field
		Title          respjson.Field
		Type           respjson.Field
		URL            respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCitationsWebSearchResultLocation) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCitationsWebSearchResultLocation) UnmarshalJSON

func (r *BetaCitationsWebSearchResultLocation) UnmarshalJSON(data []byte) error

type BetaClearThinking20251015EditKeepUnionParam

type BetaClearThinking20251015EditKeepUnionParam struct {
	OfThinkingTurns    *BetaThinkingTurnsParam    `json:",omitzero,inline"`
	OfAllThinkingTurns *BetaAllThinkingTurnsParam `json:",omitzero,inline"`
	// Construct this variant with constant.ValueOf[constant.All]()
	OfAll constant.All `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 (BetaClearThinking20251015EditKeepUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaClearThinking20251015EditKeepUnionParam) GetValue

Returns a pointer to the underlying variant's property, if present.

func (BetaClearThinking20251015EditKeepUnionParam) MarshalJSON

func (*BetaClearThinking20251015EditKeepUnionParam) UnmarshalJSON

func (u *BetaClearThinking20251015EditKeepUnionParam) UnmarshalJSON(data []byte) error

type BetaClearThinking20251015EditParam

type BetaClearThinking20251015EditParam struct {
	// Number of most recent assistant turns to keep thinking blocks for. Older turns
	// will have their thinking blocks removed.
	Keep BetaClearThinking20251015EditKeepUnionParam `json:"keep,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "clear_thinking_20251015".
	Type constant.ClearThinking20251015 `json:"type" default:"clear_thinking_20251015"`
	// contains filtered or unexported fields
}

The property Type is required.

func (BetaClearThinking20251015EditParam) MarshalJSON

func (r BetaClearThinking20251015EditParam) MarshalJSON() (data []byte, err error)

func (*BetaClearThinking20251015EditParam) UnmarshalJSON

func (r *BetaClearThinking20251015EditParam) UnmarshalJSON(data []byte) error

type BetaClearThinking20251015EditResponse

type BetaClearThinking20251015EditResponse struct {
	// Number of input tokens cleared by this edit.
	ClearedInputTokens int64 `json:"cleared_input_tokens" api:"required"`
	// Number of thinking turns that were cleared.
	ClearedThinkingTurns int64 `json:"cleared_thinking_turns" api:"required"`
	// The type of context management edit applied.
	Type constant.ClearThinking20251015 `json:"type" default:"clear_thinking_20251015"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClearedInputTokens   respjson.Field
		ClearedThinkingTurns respjson.Field
		Type                 respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaClearThinking20251015EditResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaClearThinking20251015EditResponse) UnmarshalJSON

func (r *BetaClearThinking20251015EditResponse) UnmarshalJSON(data []byte) error

type BetaClearToolUses20250919EditClearToolInputsUnionParam

type BetaClearToolUses20250919EditClearToolInputsUnionParam 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 (BetaClearToolUses20250919EditClearToolInputsUnionParam) MarshalJSON

func (*BetaClearToolUses20250919EditClearToolInputsUnionParam) UnmarshalJSON

type BetaClearToolUses20250919EditParam

type BetaClearToolUses20250919EditParam struct {
	// Whether to clear all tool inputs (bool) or specific tool inputs to clear (list)
	ClearToolInputs BetaClearToolUses20250919EditClearToolInputsUnionParam `json:"clear_tool_inputs,omitzero"`
	// Tool names whose uses are preserved from clearing
	ExcludeTools []string `json:"exclude_tools,omitzero"`
	// Minimum number of tokens that must be cleared when triggered. Context will only
	// be modified if at least this many tokens can be removed.
	ClearAtLeast BetaInputTokensClearAtLeastParam `json:"clear_at_least,omitzero"`
	// Number of tool uses to retain in the conversation
	Keep BetaToolUsesKeepParam `json:"keep,omitzero"`
	// Condition that triggers the context management strategy
	Trigger BetaClearToolUses20250919EditTriggerUnionParam `json:"trigger,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "clear_tool_uses_20250919".
	Type constant.ClearToolUses20250919 `json:"type" default:"clear_tool_uses_20250919"`
	// contains filtered or unexported fields
}

The property Type is required.

func (BetaClearToolUses20250919EditParam) MarshalJSON

func (r BetaClearToolUses20250919EditParam) MarshalJSON() (data []byte, err error)

func (*BetaClearToolUses20250919EditParam) UnmarshalJSON

func (r *BetaClearToolUses20250919EditParam) UnmarshalJSON(data []byte) error

type BetaClearToolUses20250919EditResponse

type BetaClearToolUses20250919EditResponse struct {
	// Number of input tokens cleared by this edit.
	ClearedInputTokens int64 `json:"cleared_input_tokens" api:"required"`
	// Number of tool uses that were cleared.
	ClearedToolUses int64 `json:"cleared_tool_uses" api:"required"`
	// The type of context management edit applied.
	Type constant.ClearToolUses20250919 `json:"type" default:"clear_tool_uses_20250919"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClearedInputTokens respjson.Field
		ClearedToolUses    respjson.Field
		Type               respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaClearToolUses20250919EditResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaClearToolUses20250919EditResponse) UnmarshalJSON

func (r *BetaClearToolUses20250919EditResponse) UnmarshalJSON(data []byte) error

type BetaClearToolUses20250919EditTriggerUnionParam

type BetaClearToolUses20250919EditTriggerUnionParam struct {
	OfInputTokens *BetaInputTokensTriggerParam `json:",omitzero,inline"`
	OfToolUses    *BetaToolUsesTriggerParam    `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 (BetaClearToolUses20250919EditTriggerUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaClearToolUses20250919EditTriggerUnionParam) GetValue

Returns a pointer to the underlying variant's property, if present.

func (BetaClearToolUses20250919EditTriggerUnionParam) MarshalJSON

func (*BetaClearToolUses20250919EditTriggerUnionParam) UnmarshalJSON

type BetaCloudConfig

type BetaCloudConfig struct {
	// Network configuration policy.
	Networking BetaCloudConfigNetworkingUnion `json:"networking" api:"required"`
	// Package manager configuration.
	Packages BetaPackages `json:"packages" api:"required"`
	// Environment type
	Type constant.Cloud `json:"type" default:"cloud"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Networking  respjson.Field
		Packages    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

`cloud` environment configuration.

func (BetaCloudConfig) RawJSON

func (r BetaCloudConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaCloudConfig) UnmarshalJSON

func (r *BetaCloudConfig) UnmarshalJSON(data []byte) error

type BetaCloudConfigNetworkingUnion

type BetaCloudConfigNetworkingUnion struct {
	// Any of "unrestricted", "limited".
	Type string `json:"type"`
	// This field is from variant [BetaLimitedNetwork].
	AllowMCPServers bool `json:"allow_mcp_servers"`
	// This field is from variant [BetaLimitedNetwork].
	AllowPackageManagers bool `json:"allow_package_managers"`
	// This field is from variant [BetaLimitedNetwork].
	AllowedHosts []string `json:"allowed_hosts"`
	JSON         struct {
		Type                 respjson.Field
		AllowMCPServers      respjson.Field
		AllowPackageManagers respjson.Field
		AllowedHosts         respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaCloudConfigNetworkingUnion contains all possible properties and values from BetaUnrestrictedNetwork, BetaLimitedNetwork.

Use the BetaCloudConfigNetworkingUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaCloudConfigNetworkingUnion) AsAny

func (u BetaCloudConfigNetworkingUnion) AsAny() anyBetaCloudConfigNetworking

Use the following switch statement to find the correct variant

switch variant := BetaCloudConfigNetworkingUnion.AsAny().(type) {
case Juglow.BetaUnrestrictedNetwork:
case Juglow.BetaLimitedNetwork:
default:
  fmt.Errorf("no variant present")
}

func (BetaCloudConfigNetworkingUnion) AsLimited

func (BetaCloudConfigNetworkingUnion) AsUnrestricted

func (BetaCloudConfigNetworkingUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCloudConfigNetworkingUnion) UnmarshalJSON

func (r *BetaCloudConfigNetworkingUnion) UnmarshalJSON(data []byte) error

type BetaCloudConfigParams

type BetaCloudConfigParams struct {
	// Network configuration policy. Omit on update to preserve the existing value.
	Networking BetaCloudConfigParamsNetworkingUnion `json:"networking,omitzero"`
	// Specify packages (and optionally their versions) available in this environment.
	//
	// When versioning, use the version semantics relevant for the package manager,
	// e.g. for `pip` use `package==1.0.0`. You are responsible for validating the
	// package and version exist. Unversioned installs the latest.
	Packages BetaPackagesParams `json:"packages,omitzero"`
	// Environment type
	//
	// This field can be elided, and will marshal its zero value as "cloud".
	Type constant.Cloud `json:"type" default:"cloud"`
	// contains filtered or unexported fields
}

Request params for `cloud` environment configuration.

Fields default to null; on update, omitted fields preserve the existing value.

The property Type is required.

func (BetaCloudConfigParams) MarshalJSON

func (r BetaCloudConfigParams) MarshalJSON() (data []byte, err error)

func (*BetaCloudConfigParams) UnmarshalJSON

func (r *BetaCloudConfigParams) UnmarshalJSON(data []byte) error

type BetaCloudConfigParamsNetworkingUnion

type BetaCloudConfigParamsNetworkingUnion struct {
	OfUnrestricted *BetaUnrestrictedNetworkParam `json:",omitzero,inline"`
	OfLimited      *BetaLimitedNetworkParams     `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 (BetaCloudConfigParamsNetworkingUnion) GetAllowMCPServers

func (u BetaCloudConfigParamsNetworkingUnion) GetAllowMCPServers() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaCloudConfigParamsNetworkingUnion) GetAllowPackageManagers

func (u BetaCloudConfigParamsNetworkingUnion) GetAllowPackageManagers() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaCloudConfigParamsNetworkingUnion) GetAllowedHosts

func (u BetaCloudConfigParamsNetworkingUnion) GetAllowedHosts() []string

Returns a pointer to the underlying variant's property, if present.

func (BetaCloudConfigParamsNetworkingUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaCloudConfigParamsNetworkingUnion) MarshalJSON

func (u BetaCloudConfigParamsNetworkingUnion) MarshalJSON() ([]byte, error)

func (*BetaCloudConfigParamsNetworkingUnion) UnmarshalJSON

func (u *BetaCloudConfigParamsNetworkingUnion) UnmarshalJSON(data []byte) error

type BetaCodeExecutionOutputBlock

type BetaCodeExecutionOutputBlock struct {
	FileID string                       `json:"file_id" api:"required"`
	Type   constant.CodeExecutionOutput `json:"type" default:"code_execution_output"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCodeExecutionOutputBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaCodeExecutionOutputBlock) ToParam

func (*BetaCodeExecutionOutputBlock) UnmarshalJSON

func (r *BetaCodeExecutionOutputBlock) UnmarshalJSON(data []byte) error

type BetaCodeExecutionOutputBlockParam

type BetaCodeExecutionOutputBlockParam struct {
	FileID string `json:"file_id" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_output".
	Type constant.CodeExecutionOutput `json:"type" default:"code_execution_output"`
	// contains filtered or unexported fields
}

The properties FileID, Type are required.

func (BetaCodeExecutionOutputBlockParam) MarshalJSON

func (r BetaCodeExecutionOutputBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaCodeExecutionOutputBlockParam) UnmarshalJSON

func (r *BetaCodeExecutionOutputBlockParam) UnmarshalJSON(data []byte) error

type BetaCodeExecutionResultBlock

type BetaCodeExecutionResultBlock struct {
	Content    []BetaCodeExecutionOutputBlock `json:"content" api:"required"`
	ReturnCode int64                          `json:"return_code" api:"required"`
	Stderr     string                         `json:"stderr" api:"required"`
	Stdout     string                         `json:"stdout" api:"required"`
	Type       constant.CodeExecutionResult   `json:"type" default:"code_execution_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ReturnCode  respjson.Field
		Stderr      respjson.Field
		Stdout      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCodeExecutionResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCodeExecutionResultBlock) UnmarshalJSON

func (r *BetaCodeExecutionResultBlock) UnmarshalJSON(data []byte) error

type BetaCodeExecutionResultBlockParam

type BetaCodeExecutionResultBlockParam struct {
	Content    []BetaCodeExecutionOutputBlockParam `json:"content,omitzero" api:"required"`
	ReturnCode int64                               `json:"return_code" api:"required"`
	Stderr     string                              `json:"stderr" api:"required"`
	Stdout     string                              `json:"stdout" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_result".
	Type constant.CodeExecutionResult `json:"type" default:"code_execution_result"`
	// contains filtered or unexported fields
}

The properties Content, ReturnCode, Stderr, Stdout, Type are required.

func (BetaCodeExecutionResultBlockParam) MarshalJSON

func (r BetaCodeExecutionResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaCodeExecutionResultBlockParam) UnmarshalJSON

func (r *BetaCodeExecutionResultBlockParam) UnmarshalJSON(data []byte) error

type BetaCodeExecutionTool20250522Param

type BetaCodeExecutionTool20250522Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "code_execution".
	Name constant.CodeExecution `json:"name" default:"code_execution"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20250522".
	Type constant.CodeExecution20250522 `json:"type" default:"code_execution_20250522"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaCodeExecutionTool20250522Param) MarshalJSON

func (r BetaCodeExecutionTool20250522Param) MarshalJSON() (data []byte, err error)

func (*BetaCodeExecutionTool20250522Param) UnmarshalJSON

func (r *BetaCodeExecutionTool20250522Param) UnmarshalJSON(data []byte) error

type BetaCodeExecutionTool20250825Param

type BetaCodeExecutionTool20250825Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "code_execution".
	Name constant.CodeExecution `json:"name" default:"code_execution"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20250825".
	Type constant.CodeExecution20250825 `json:"type" default:"code_execution_20250825"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaCodeExecutionTool20250825Param) MarshalJSON

func (r BetaCodeExecutionTool20250825Param) MarshalJSON() (data []byte, err error)

func (*BetaCodeExecutionTool20250825Param) UnmarshalJSON

func (r *BetaCodeExecutionTool20250825Param) UnmarshalJSON(data []byte) error

type BetaCodeExecutionTool20260120Param

type BetaCodeExecutionTool20260120Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "code_execution".
	Name constant.CodeExecution `json:"name" default:"code_execution"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20260120".
	Type constant.CodeExecution20260120 `json:"type" default:"code_execution_20260120"`
	// contains filtered or unexported fields
}

Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).

The properties Name, Type are required.

func (BetaCodeExecutionTool20260120Param) MarshalJSON

func (r BetaCodeExecutionTool20260120Param) MarshalJSON() (data []byte, err error)

func (*BetaCodeExecutionTool20260120Param) UnmarshalJSON

func (r *BetaCodeExecutionTool20260120Param) UnmarshalJSON(data []byte) error

type BetaCodeExecutionTool20260521Param

type BetaCodeExecutionTool20260521Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "code_execution".
	Name constant.CodeExecution `json:"name" default:"code_execution"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20260521".
	Type constant.CodeExecution20260521 `json:"type" default:"code_execution_20260521"`
	// contains filtered or unexported fields
}

Code execution tool with REPL state persistence.

The properties Name, Type are required.

func (BetaCodeExecutionTool20260521Param) MarshalJSON

func (r BetaCodeExecutionTool20260521Param) MarshalJSON() (data []byte, err error)

func (*BetaCodeExecutionTool20260521Param) UnmarshalJSON

func (r *BetaCodeExecutionTool20260521Param) UnmarshalJSON(data []byte) error

type BetaCodeExecutionToolResultBlock

type BetaCodeExecutionToolResultBlock struct {
	// Code execution result with encrypted stdout for PFC + web_search results.
	Content   BetaCodeExecutionToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                       `json:"tool_use_id" api:"required"`
	Type      constant.CodeExecutionToolResult             `json:"type" default:"code_execution_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCodeExecutionToolResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaCodeExecutionToolResultBlock) ToParam

func (*BetaCodeExecutionToolResultBlock) UnmarshalJSON

func (r *BetaCodeExecutionToolResultBlock) UnmarshalJSON(data []byte) error

type BetaCodeExecutionToolResultBlockContentUnion

type BetaCodeExecutionToolResultBlockContentUnion struct {
	// This field is from variant [BetaCodeExecutionToolResultError].
	ErrorCode  BetaCodeExecutionToolResultErrorCode `json:"error_code"`
	Type       string                               `json:"type"`
	Content    []BetaCodeExecutionOutputBlock       `json:"content"`
	ReturnCode int64                                `json:"return_code"`
	Stderr     string                               `json:"stderr"`
	// This field is from variant [BetaCodeExecutionResultBlock].
	Stdout string `json:"stdout"`
	// This field is from variant [BetaEncryptedCodeExecutionResultBlock].
	EncryptedStdout string `json:"encrypted_stdout"`
	JSON            struct {
		ErrorCode       respjson.Field
		Type            respjson.Field
		Content         respjson.Field
		ReturnCode      respjson.Field
		Stderr          respjson.Field
		Stdout          respjson.Field
		EncryptedStdout respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaCodeExecutionToolResultBlockContentUnion contains all possible properties and values from BetaCodeExecutionToolResultError, BetaCodeExecutionResultBlock, BetaEncryptedCodeExecutionResultBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaCodeExecutionToolResultBlockContentUnion) AsResponseCodeExecutionResultBlock

func (u BetaCodeExecutionToolResultBlockContentUnion) AsResponseCodeExecutionResultBlock() (v BetaCodeExecutionResultBlock)

func (BetaCodeExecutionToolResultBlockContentUnion) AsResponseCodeExecutionToolResultError

func (u BetaCodeExecutionToolResultBlockContentUnion) AsResponseCodeExecutionToolResultError() (v BetaCodeExecutionToolResultError)

func (BetaCodeExecutionToolResultBlockContentUnion) AsResponseEncryptedCodeExecutionResultBlock

func (u BetaCodeExecutionToolResultBlockContentUnion) AsResponseEncryptedCodeExecutionResultBlock() (v BetaEncryptedCodeExecutionResultBlock)

func (BetaCodeExecutionToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCodeExecutionToolResultBlockContentUnion) UnmarshalJSON

func (r *BetaCodeExecutionToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type BetaCodeExecutionToolResultBlockParam

type BetaCodeExecutionToolResultBlockParam struct {
	// Code execution result with encrypted stdout for PFC + web_search results.
	Content   BetaCodeExecutionToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                            `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_tool_result".
	Type constant.CodeExecutionToolResult `json:"type" default:"code_execution_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (BetaCodeExecutionToolResultBlockParam) MarshalJSON

func (r BetaCodeExecutionToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaCodeExecutionToolResultBlockParam) UnmarshalJSON

func (r *BetaCodeExecutionToolResultBlockParam) UnmarshalJSON(data []byte) error

type BetaCodeExecutionToolResultBlockParamContentUnion

type BetaCodeExecutionToolResultBlockParamContentUnion struct {
	OfError                                    *BetaCodeExecutionToolResultErrorParam      `json:",omitzero,inline"`
	OfResultBlock                              *BetaCodeExecutionResultBlockParam          `json:",omitzero,inline"`
	OfRequestEncryptedCodeExecutionResultBlock *BetaEncryptedCodeExecutionResultBlockParam `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 (BetaCodeExecutionToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's Content property, if present.

func (BetaCodeExecutionToolResultBlockParamContentUnion) GetEncryptedStdout

Returns a pointer to the underlying variant's property, if present.

func (BetaCodeExecutionToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (BetaCodeExecutionToolResultBlockParamContentUnion) GetReturnCode

Returns a pointer to the underlying variant's property, if present.

func (BetaCodeExecutionToolResultBlockParamContentUnion) GetStderr

Returns a pointer to the underlying variant's property, if present.

func (BetaCodeExecutionToolResultBlockParamContentUnion) GetStdout

Returns a pointer to the underlying variant's property, if present.

func (BetaCodeExecutionToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaCodeExecutionToolResultBlockParamContentUnion) MarshalJSON

func (*BetaCodeExecutionToolResultBlockParamContentUnion) UnmarshalJSON

type BetaCodeExecutionToolResultError

type BetaCodeExecutionToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded".
	ErrorCode BetaCodeExecutionToolResultErrorCode  `json:"error_code" api:"required"`
	Type      constant.CodeExecutionToolResultError `json:"type" default:"code_execution_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCodeExecutionToolResultError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCodeExecutionToolResultError) UnmarshalJSON

func (r *BetaCodeExecutionToolResultError) UnmarshalJSON(data []byte) error

type BetaCodeExecutionToolResultErrorCode

type BetaCodeExecutionToolResultErrorCode string
const (
	BetaCodeExecutionToolResultErrorCodeInvalidToolInput      BetaCodeExecutionToolResultErrorCode = "invalid_tool_input"
	BetaCodeExecutionToolResultErrorCodeUnavailable           BetaCodeExecutionToolResultErrorCode = "unavailable"
	BetaCodeExecutionToolResultErrorCodeTooManyRequests       BetaCodeExecutionToolResultErrorCode = "too_many_requests"
	BetaCodeExecutionToolResultErrorCodeExecutionTimeExceeded BetaCodeExecutionToolResultErrorCode = "execution_time_exceeded"
)

type BetaCodeExecutionToolResultErrorParam

type BetaCodeExecutionToolResultErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded".
	ErrorCode BetaCodeExecutionToolResultErrorCode `json:"error_code,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_tool_result_error".
	Type constant.CodeExecutionToolResultError `json:"type" default:"code_execution_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (BetaCodeExecutionToolResultErrorParam) MarshalJSON

func (r BetaCodeExecutionToolResultErrorParam) MarshalJSON() (data []byte, err error)

func (*BetaCodeExecutionToolResultErrorParam) UnmarshalJSON

func (r *BetaCodeExecutionToolResultErrorParam) UnmarshalJSON(data []byte) error

type BetaCompact20260112EditParam

type BetaCompact20260112EditParam struct {
	// Additional instructions for summarization.
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	// Whether to pause after compaction and return the compaction block to the user.
	PauseAfterCompaction param.Opt[bool] `json:"pause_after_compaction,omitzero"`
	// When to trigger compaction. Defaults to 150000 input tokens.
	Trigger BetaInputTokensTriggerParam `json:"trigger,omitzero"`
	// This field can be elided, and will marshal its zero value as "compact_20260112".
	Type constant.Compact20260112 `json:"type" default:"compact_20260112"`
	// contains filtered or unexported fields
}

Automatically compact older context when reaching the configured trigger threshold.

The property Type is required.

func (BetaCompact20260112EditParam) MarshalJSON

func (r BetaCompact20260112EditParam) MarshalJSON() (data []byte, err error)

func (*BetaCompact20260112EditParam) UnmarshalJSON

func (r *BetaCompact20260112EditParam) UnmarshalJSON(data []byte) error

type BetaCompactionBlock

type BetaCompactionBlock struct {
	// Summary of compacted content, or null if compaction failed
	Content string `json:"content" api:"required"`
	// Opaque metadata from prior compaction, to be round-tripped verbatim
	EncryptedContent string              `json:"encrypted_content" api:"required"`
	Type             constant.Compaction `json:"type" default:"compaction"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content          respjson.Field
		EncryptedContent respjson.Field
		Type             respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A compaction block returned when autocompact is triggered.

When content is None, it indicates the compaction failed to produce a valid summary (e.g., malformed output from the model). Clients may round-trip compaction blocks with null content; the server treats them as no-ops.

func (BetaCompactionBlock) RawJSON

func (r BetaCompactionBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaCompactionBlock) ToParam

func (*BetaCompactionBlock) UnmarshalJSON

func (r *BetaCompactionBlock) UnmarshalJSON(data []byte) error

type BetaCompactionBlockParam

type BetaCompactionBlockParam struct {
	// Summary of previously compacted content, or null if compaction failed
	Content param.Opt[string] `json:"content,omitzero"`
	// Opaque metadata from prior compaction, to be round-tripped verbatim
	EncryptedContent param.Opt[string] `json:"encrypted_content,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "compaction".
	Type constant.Compaction `json:"type" default:"compaction"`
	// contains filtered or unexported fields
}

A compaction block containing summary of previous context.

Users should round-trip these blocks from responses to subsequent requests to maintain context across compaction boundaries.

When content is None, the block represents a failed compaction. The server treats these as no-ops. Empty string content is not allowed.

The property Type is required.

func (BetaCompactionBlockParam) MarshalJSON

func (r BetaCompactionBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaCompactionBlockParam) UnmarshalJSON

func (r *BetaCompactionBlockParam) UnmarshalJSON(data []byte) error

type BetaCompactionContentBlockDelta

type BetaCompactionContentBlockDelta struct {
	Content string `json:"content" api:"required"`
	// Opaque metadata from prior compaction, to be round-tripped verbatim
	EncryptedContent string                   `json:"encrypted_content" api:"required"`
	Type             constant.CompactionDelta `json:"type" default:"compaction_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content          respjson.Field
		EncryptedContent respjson.Field
		Type             respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCompactionContentBlockDelta) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCompactionContentBlockDelta) UnmarshalJSON

func (r *BetaCompactionContentBlockDelta) UnmarshalJSON(data []byte) error

type BetaCompactionIterationUsage

type BetaCompactionIterationUsage struct {
	// Breakdown of cached tokens by TTL
	CacheCreation BetaCacheCreation `json:"cache_creation" api:"required"`
	// The number of input tokens used to create the cache entry.
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// The number of input tokens read from the cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// The number of input tokens which were used.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// The number of output tokens which were used.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// Usage for a compaction iteration
	Type constant.Compaction `json:"type" default:"compaction"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreation            respjson.Field
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		OutputTokens             respjson.Field
		Type                     respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token usage for a compaction iteration.

func (BetaCompactionIterationUsage) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCompactionIterationUsage) UnmarshalJSON

func (r *BetaCompactionIterationUsage) UnmarshalJSON(data []byte) error

type BetaContainer

type BetaContainer struct {
	// Identifier for the container used in this request
	ID string `json:"id" api:"required"`
	// The time at which the container will expire.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// tracks loaded in the container
	Tracks []BetaTrack `json:"tracks" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExpiresAt   respjson.Field
		Tracks      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about the container used in the request (for the code execution tool)

func (BetaContainer) RawJSON

func (r BetaContainer) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaContainer) UnmarshalJSON

func (r *BetaContainer) UnmarshalJSON(data []byte) error

type BetaContainerParams

type BetaContainerParams struct {
	// Container id
	ID param.Opt[string] `json:"id,omitzero"`
	// List of tracks to load in the container
	Tracks []BetaTrackParams `json:"tracks,omitzero"`
	// contains filtered or unexported fields
}

Container parameters with tracks to be loaded.

func (BetaContainerParams) MarshalJSON

func (r BetaContainerParams) MarshalJSON() (data []byte, err error)

func (*BetaContainerParams) UnmarshalJSON

func (r *BetaContainerParams) UnmarshalJSON(data []byte) error

type BetaContainerUploadBlock

type BetaContainerUploadBlock struct {
	FileID string                   `json:"file_id" api:"required"`
	Type   constant.ContainerUpload `json:"type" default:"container_upload"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response model for a file uploaded to the container.

func (BetaContainerUploadBlock) RawJSON

func (r BetaContainerUploadBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaContainerUploadBlock) ToParam

func (*BetaContainerUploadBlock) UnmarshalJSON

func (r *BetaContainerUploadBlock) UnmarshalJSON(data []byte) error

type BetaContainerUploadBlockParam

type BetaContainerUploadBlockParam struct {
	FileID string `json:"file_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "container_upload".
	Type constant.ContainerUpload `json:"type" default:"container_upload"`
	// contains filtered or unexported fields
}

A content block that represents a file to be uploaded to the container Files uploaded via this block will be available in the container's input directory.

The properties FileID, Type are required.

func (BetaContainerUploadBlockParam) MarshalJSON

func (r BetaContainerUploadBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaContainerUploadBlockParam) UnmarshalJSON

func (r *BetaContainerUploadBlockParam) UnmarshalJSON(data []byte) error

type BetaContentBlockParamUnion

type BetaContentBlockParamUnion struct {
	OfText                              *BetaTextBlockParam                              `json:",omitzero,inline"`
	OfImage                             *BetaImageBlockParam                             `json:",omitzero,inline"`
	OfDocument                          *BetaRequestDocumentBlockParam                   `json:",omitzero,inline"`
	OfSearchResult                      *BetaSearchResultBlockParam                      `json:",omitzero,inline"`
	OfThinking                          *BetaThinkingBlockParam                          `json:",omitzero,inline"`
	OfRedactedThinking                  *BetaRedactedThinkingBlockParam                  `json:",omitzero,inline"`
	OfToolUse                           *BetaToolUseBlockParam                           `json:",omitzero,inline"`
	OfToolResult                        *BetaToolResultBlockParam                        `json:",omitzero,inline"`
	OfServerToolUse                     *BetaServerToolUseBlockParam                     `json:",omitzero,inline"`
	OfWebSearchToolResult               *BetaWebSearchToolResultBlockParam               `json:",omitzero,inline"`
	OfWebFetchToolResult                *BetaWebFetchToolResultBlockParam                `json:",omitzero,inline"`
	OfAdvisorToolResult                 *BetaAdvisorToolResultBlockParam                 `json:",omitzero,inline"`
	OfCodeExecutionToolResult           *BetaCodeExecutionToolResultBlockParam           `json:",omitzero,inline"`
	OfBashCodeExecutionToolResult       *BetaBashCodeExecutionToolResultBlockParam       `json:",omitzero,inline"`
	OfTextEditorCodeExecutionToolResult *BetaTextEditorCodeExecutionToolResultBlockParam `json:",omitzero,inline"`
	OfToolSearchToolResult              *BetaToolSearchToolResultBlockParam              `json:",omitzero,inline"`
	OfMCPToolUse                        *BetaMCPToolUseBlockParam                        `json:",omitzero,inline"`
	OfMCPToolResult                     *BetaRequestMCPToolResultBlockParam              `json:",omitzero,inline"`
	OfContainerUpload                   *BetaContainerUploadBlockParam                   `json:",omitzero,inline"`
	OfCompaction                        *BetaCompactionBlockParam                        `json:",omitzero,inline"`
	OfMidConvSystem                     *BetaMidConversationSystemBlockParam             `json:",omitzero,inline"`
	OfToolAddition                      *BetaRequestToolAdditionBlockParam               `json:",omitzero,inline"`
	OfToolRemoval                       *BetaRequestToolRemovalBlockParam                `json:",omitzero,inline"`
	OfFallback                          *BetaFallbackBlockParam                          `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 NewBetaContainerUploadBlock

func NewBetaContainerUploadBlock(fileID string) BetaContentBlockParamUnion

func NewBetaMCPToolResultBlock

func NewBetaMCPToolResultBlock(toolUseID string) BetaContentBlockParamUnion

func NewBetaRedactedThinkingBlock

func NewBetaRedactedThinkingBlock(data string) BetaContentBlockParamUnion

func NewBetaSearchResultBlock

func NewBetaSearchResultBlock(content []BetaTextBlockParam, source string, title string) BetaContentBlockParamUnion

func NewBetaTextBlock

func NewBetaTextBlock(text string) BetaContentBlockParamUnion

func NewBetaThinkingBlock

func NewBetaThinkingBlock(signature string, thinking string) BetaContentBlockParamUnion

func NewBetaToolResultBlock

func NewBetaToolResultBlock(toolUseID string, content string, isError bool) BetaContentBlockParamUnion

func NewBetaToolUseBlock

func NewBetaToolUseBlock(id string, input any, name string) BetaContentBlockParamUnion

func (BetaContentBlockParamUnion) GetCacheControl

Returns a pointer to the underlying variant's CacheControl property, if present.

func (BetaContentBlockParamUnion) GetCaller

func (u BetaContentBlockParamUnion) GetCaller() (res betaContentBlockParamUnionCaller)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaContentBlockParamUnion) GetCitations

func (u BetaContentBlockParamUnion) GetCitations() (res betaContentBlockParamUnionCitations)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaContentBlockParamUnion) GetContent

func (u BetaContentBlockParamUnion) GetContent() (res betaContentBlockParamUnionContent)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaContentBlockParamUnion) GetContext

func (u BetaContentBlockParamUnion) GetContext() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetData

func (u BetaContentBlockParamUnion) GetData() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetEncryptedContent

func (u BetaContentBlockParamUnion) GetEncryptedContent() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetFileID

func (u BetaContentBlockParamUnion) GetFileID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetFrom

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetID

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetInput

func (u BetaContentBlockParamUnion) GetInput() *any

Returns a pointer to the underlying variant's Input property, if present.

func (BetaContentBlockParamUnion) GetIsError

func (u BetaContentBlockParamUnion) GetIsError() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetName

func (u BetaContentBlockParamUnion) GetName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetServerName

func (u BetaContentBlockParamUnion) GetServerName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetSignature

func (u BetaContentBlockParamUnion) GetSignature() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetSource

func (u BetaContentBlockParamUnion) GetSource() (res betaContentBlockParamUnionSource)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaContentBlockParamUnion) GetText

func (u BetaContentBlockParamUnion) GetText() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetThinking

func (u BetaContentBlockParamUnion) GetThinking() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetTitle

func (u BetaContentBlockParamUnion) GetTitle() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetTo

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetTool

func (u BetaContentBlockParamUnion) GetTool() (res betaContentBlockParamUnionTool)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaContentBlockParamUnion) GetToolUseID

func (u BetaContentBlockParamUnion) GetToolUseID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetTrigger

func (u BetaContentBlockParamUnion) GetTrigger() *any

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) GetType

func (u BetaContentBlockParamUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaContentBlockParamUnion) MarshalJSON

func (u BetaContentBlockParamUnion) MarshalJSON() ([]byte, error)

func (*BetaContentBlockParamUnion) UnmarshalJSON

func (u *BetaContentBlockParamUnion) UnmarshalJSON(data []byte) error

type BetaContentBlockSourceContentUnionParam

type BetaContentBlockSourceContentUnionParam struct {
	OfString                        param.Opt[string]                         `json:",omitzero,inline"`
	OfBetaContentBlockSourceContent []BetaContentBlockSourceContentUnionParam `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 (BetaContentBlockSourceContentUnionParam) MarshalJSON

func (u BetaContentBlockSourceContentUnionParam) MarshalJSON() ([]byte, error)

func (*BetaContentBlockSourceContentUnionParam) UnmarshalJSON

func (u *BetaContentBlockSourceContentUnionParam) UnmarshalJSON(data []byte) error

type BetaContentBlockSourceParam

type BetaContentBlockSourceParam struct {
	Content BetaContentBlockSourceContentUnionParam `json:"content,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "content".
	Type constant.Content `json:"type" default:"content"`
	// contains filtered or unexported fields
}

The properties Content, Type are required.

func (BetaContentBlockSourceParam) MarshalJSON

func (r BetaContentBlockSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaContentBlockSourceParam) UnmarshalJSON

func (r *BetaContentBlockSourceParam) UnmarshalJSON(data []byte) error

type BetaContentBlockUnion

type BetaContentBlockUnion struct {
	// This field is from variant [BetaTextBlock].
	Citations []BetaTextCitationUnion `json:"citations"`
	// This field is from variant [BetaTextBlock].
	Text string `json:"text"`
	// Any of "text", "thinking", "redacted_thinking", "tool_use", "server_tool_use",
	// "web_search_tool_result", "web_fetch_tool_result", "advisor_tool_result",
	// "code_execution_tool_result", "bash_code_execution_tool_result",
	// "text_editor_code_execution_tool_result", "tool_search_tool_result",
	// "mcp_tool_use", "mcp_tool_result", "container_upload", "compaction", "fallback".
	Type string `json:"type"`
	// This field is from variant [BetaThinkingBlock].
	Signature string `json:"signature"`
	// This field is from variant [BetaThinkingBlock].
	Thinking string `json:"thinking"`
	// This field is from variant [BetaRedactedThinkingBlock].
	Data string `json:"data"`
	ID   string `json:"id"`
	// necessary custom code modification
	Input json.RawMessage `json:"input"`
	Name  string          `json:"name"`
	// This field is a union of [BetaToolUseBlockCallerUnion],
	// [BetaServerToolUseBlockCallerUnion], [BetaWebSearchToolResultBlockCallerUnion],
	// [BetaWebFetchToolResultBlockCallerUnion]
	Caller BetaContentBlockUnionCaller `json:"caller"`
	// This field is a union of [BetaWebSearchToolResultBlockContentUnion],
	// [BetaWebFetchToolResultBlockContentUnion],
	// [BetaAdvisorToolResultBlockContentUnion],
	// [BetaCodeExecutionToolResultBlockContentUnion],
	// [BetaBashCodeExecutionToolResultBlockContentUnion],
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion],
	// [BetaToolSearchToolResultBlockContentUnion],
	// [BetaMCPToolResultBlockContentUnion], [string]
	Content   BetaContentBlockUnionContent `json:"content"`
	ToolUseID string                       `json:"tool_use_id"`
	// This field is from variant [BetaMCPToolUseBlock].
	ServerName string `json:"server_name"`
	// This field is from variant [BetaMCPToolResultBlock].
	IsError bool `json:"is_error"`
	// This field is from variant [BetaContainerUploadBlock].
	FileID string `json:"file_id"`
	// This field is from variant [BetaCompactionBlock].
	EncryptedContent string `json:"encrypted_content"`
	// This field is from variant [BetaFallbackBlock].
	From BetaFallbackInfo `json:"from"`
	// This field is from variant [BetaFallbackBlock].
	To BetaFallbackInfo `json:"to"`
	// This field is from variant [BetaFallbackBlock].
	Trigger BetaFallbackRefusalTrigger `json:"trigger"`
	JSON    struct {
		Citations        respjson.Field
		Text             respjson.Field
		Type             respjson.Field
		Signature        respjson.Field
		Thinking         respjson.Field
		Data             respjson.Field
		ID               respjson.Field
		Input            respjson.Field
		Name             respjson.Field
		Caller           respjson.Field
		Content          respjson.Field
		ToolUseID        respjson.Field
		ServerName       respjson.Field
		IsError          respjson.Field
		FileID           respjson.Field
		EncryptedContent respjson.Field
		From             respjson.Field
		To               respjson.Field
		Trigger          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaContentBlockUnion contains all possible properties and values from BetaTextBlock, BetaThinkingBlock, BetaRedactedThinkingBlock, BetaToolUseBlock, BetaServerToolUseBlock, BetaWebSearchToolResultBlock, BetaWebFetchToolResultBlock, BetaAdvisorToolResultBlock, BetaCodeExecutionToolResultBlock, BetaBashCodeExecutionToolResultBlock, BetaTextEditorCodeExecutionToolResultBlock, BetaToolSearchToolResultBlock, BetaMCPToolUseBlock, BetaMCPToolResultBlock, BetaContainerUploadBlock, BetaCompactionBlock, BetaFallbackBlock.

Use the BetaContentBlockUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaContentBlockUnion) AsAdvisorToolResult

func (u BetaContentBlockUnion) AsAdvisorToolResult() (v BetaAdvisorToolResultBlock)

func (BetaContentBlockUnion) AsAny

func (u BetaContentBlockUnion) AsAny() anyBetaContentBlock

Use the following switch statement to find the correct variant

switch variant := BetaContentBlockUnion.AsAny().(type) {
case Juglow.BetaTextBlock:
case Juglow.BetaThinkingBlock:
case Juglow.BetaRedactedThinkingBlock:
case Juglow.BetaToolUseBlock:
case Juglow.BetaServerToolUseBlock:
case Juglow.BetaWebSearchToolResultBlock:
case Juglow.BetaWebFetchToolResultBlock:
case Juglow.BetaAdvisorToolResultBlock:
case Juglow.BetaCodeExecutionToolResultBlock:
case Juglow.BetaBashCodeExecutionToolResultBlock:
case Juglow.BetaTextEditorCodeExecutionToolResultBlock:
case Juglow.BetaToolSearchToolResultBlock:
case Juglow.BetaMCPToolUseBlock:
case Juglow.BetaMCPToolResultBlock:
case Juglow.BetaContainerUploadBlock:
case Juglow.BetaCompactionBlock:
case Juglow.BetaFallbackBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaContentBlockUnion) AsBashCodeExecutionToolResult

func (u BetaContentBlockUnion) AsBashCodeExecutionToolResult() (v BetaBashCodeExecutionToolResultBlock)

func (BetaContentBlockUnion) AsCodeExecutionToolResult

func (u BetaContentBlockUnion) AsCodeExecutionToolResult() (v BetaCodeExecutionToolResultBlock)

func (BetaContentBlockUnion) AsCompaction

func (u BetaContentBlockUnion) AsCompaction() (v BetaCompactionBlock)

func (BetaContentBlockUnion) AsContainerUpload

func (u BetaContentBlockUnion) AsContainerUpload() (v BetaContainerUploadBlock)

func (BetaContentBlockUnion) AsFallback

func (u BetaContentBlockUnion) AsFallback() (v BetaFallbackBlock)

func (BetaContentBlockUnion) AsMCPToolResult

func (u BetaContentBlockUnion) AsMCPToolResult() (v BetaMCPToolResultBlock)

func (BetaContentBlockUnion) AsMCPToolUse

func (u BetaContentBlockUnion) AsMCPToolUse() (v BetaMCPToolUseBlock)

func (BetaContentBlockUnion) AsRedactedThinking

func (u BetaContentBlockUnion) AsRedactedThinking() (v BetaRedactedThinkingBlock)

func (BetaContentBlockUnion) AsServerToolUse

func (u BetaContentBlockUnion) AsServerToolUse() (v BetaServerToolUseBlock)

func (BetaContentBlockUnion) AsText

func (u BetaContentBlockUnion) AsText() (v BetaTextBlock)

func (BetaContentBlockUnion) AsTextEditorCodeExecutionToolResult

func (u BetaContentBlockUnion) AsTextEditorCodeExecutionToolResult() (v BetaTextEditorCodeExecutionToolResultBlock)

func (BetaContentBlockUnion) AsThinking

func (u BetaContentBlockUnion) AsThinking() (v BetaThinkingBlock)

func (BetaContentBlockUnion) AsToolSearchToolResult

func (u BetaContentBlockUnion) AsToolSearchToolResult() (v BetaToolSearchToolResultBlock)

func (BetaContentBlockUnion) AsToolUse

func (u BetaContentBlockUnion) AsToolUse() (v BetaToolUseBlock)

func (BetaContentBlockUnion) AsWebFetchToolResult

func (u BetaContentBlockUnion) AsWebFetchToolResult() (v BetaWebFetchToolResultBlock)

func (BetaContentBlockUnion) AsWebSearchToolResult

func (u BetaContentBlockUnion) AsWebSearchToolResult() (v BetaWebSearchToolResultBlock)

func (BetaContentBlockUnion) RawJSON

func (u BetaContentBlockUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaContentBlockUnion) ToParam

func (*BetaContentBlockUnion) UnmarshalJSON

func (r *BetaContentBlockUnion) UnmarshalJSON(data []byte) error

type BetaContentBlockUnionCaller

type BetaContentBlockUnionCaller struct {
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaContentBlockUnionCaller is an implicit subunion of BetaContentBlockUnion. BetaContentBlockUnionCaller provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaContentBlockUnion.

func (*BetaContentBlockUnionCaller) UnmarshalJSON

func (r *BetaContentBlockUnionCaller) UnmarshalJSON(data []byte) error

type BetaContentBlockUnionContent

type BetaContentBlockUnionContent struct {
	// This field will be present if the value is a [[]BetaWebSearchResultBlock]
	// instead of an object.
	OfBetaWebSearchResultBlockArray []BetaWebSearchResultBlock `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]BetaTextBlock] instead of an
	// object.
	OfBetaMCPToolResultBlockContent []BetaTextBlock `json:",inline"`
	ErrorCode                       string          `json:"error_code"`
	Type                            string          `json:"type"`
	// This field is a union of [BetaDocumentBlock], [[]BetaCodeExecutionOutputBlock],
	// [[]BetaCodeExecutionOutputBlock], [[]BetaBashCodeExecutionOutputBlock], [string]
	Content BetaContentBlockUnionContentContent `json:"content"`
	// This field is from variant [BetaWebFetchToolResultBlockContentUnion].
	RetrievedAt string `json:"retrieved_at"`
	// This field is from variant [BetaWebFetchToolResultBlockContentUnion].
	URL        string `json:"url"`
	StopReason string `json:"stop_reason"`
	// This field is from variant [BetaAdvisorToolResultBlockContentUnion].
	Text string `json:"text"`
	// This field is from variant [BetaAdvisorToolResultBlockContentUnion].
	EncryptedContent string `json:"encrypted_content"`
	ReturnCode       int64  `json:"return_code"`
	Stderr           string `json:"stderr"`
	Stdout           string `json:"stdout"`
	// This field is from variant [BetaCodeExecutionToolResultBlockContentUnion].
	EncryptedStdout string `json:"encrypted_stdout"`
	ErrorMessage    string `json:"error_message"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	FileType BetaTextEditorCodeExecutionViewResultBlockFileType `json:"file_type"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	NumLines int64 `json:"num_lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	StartLine int64 `json:"start_line"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	TotalLines int64 `json:"total_lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	IsFileUpdate bool `json:"is_file_update"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	Lines []string `json:"lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	NewLines int64 `json:"new_lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	NewStart int64 `json:"new_start"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	OldLines int64 `json:"old_lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	OldStart int64 `json:"old_start"`
	// This field is from variant [BetaToolSearchToolResultBlockContentUnion].
	ToolReferences []BetaToolReferenceBlock `json:"tool_references"`
	JSON           struct {
		OfBetaWebSearchResultBlockArray respjson.Field
		OfString                        respjson.Field
		OfBetaMCPToolResultBlockContent respjson.Field
		ErrorCode                       respjson.Field
		Type                            respjson.Field
		Content                         respjson.Field
		RetrievedAt                     respjson.Field
		URL                             respjson.Field
		StopReason                      respjson.Field
		Text                            respjson.Field
		EncryptedContent                respjson.Field
		ReturnCode                      respjson.Field
		Stderr                          respjson.Field
		Stdout                          respjson.Field
		EncryptedStdout                 respjson.Field
		ErrorMessage                    respjson.Field
		FileType                        respjson.Field
		NumLines                        respjson.Field
		StartLine                       respjson.Field
		TotalLines                      respjson.Field
		IsFileUpdate                    respjson.Field
		Lines                           respjson.Field
		NewLines                        respjson.Field
		NewStart                        respjson.Field
		OldLines                        respjson.Field
		OldStart                        respjson.Field
		ToolReferences                  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaContentBlockUnionContent is an implicit subunion of BetaContentBlockUnion. BetaContentBlockUnionContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaContentBlockUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaWebSearchResultBlockArray OfString OfBetaMCPToolResultBlockContent]

func (*BetaContentBlockUnionContent) UnmarshalJSON

func (r *BetaContentBlockUnionContent) UnmarshalJSON(data []byte) error

type BetaContentBlockUnionContentContent

type BetaContentBlockUnionContentContent struct {
	// This field will be present if the value is a [[]BetaCodeExecutionOutputBlock]
	// instead of an object.
	OfContent []BetaCodeExecutionOutputBlock `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field is from variant [BetaDocumentBlock].
	Citations BetaCitationConfig `json:"citations"`
	// This field is from variant [BetaDocumentBlock].
	Source BetaDocumentBlockSourceUnion `json:"source"`
	// This field is from variant [BetaDocumentBlock].
	Title string `json:"title"`
	// This field is from variant [BetaDocumentBlock].
	Type constant.Document `json:"type"`
	JSON struct {
		OfContent respjson.Field
		OfString  respjson.Field
		Citations respjson.Field
		Source    respjson.Field
		Title     respjson.Field
		Type      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaContentBlockUnionContentContent is an implicit subunion of BetaContentBlockUnion. BetaContentBlockUnionContentContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaContentBlockUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfContent OfString]

func (*BetaContentBlockUnionContentContent) UnmarshalJSON

func (r *BetaContentBlockUnionContentContent) UnmarshalJSON(data []byte) error

type BetaContextManagementCapability

type BetaContextManagementCapability struct {
	// Indicates whether a capability is supported.
	ClearThinking20251015 BetaCapabilitySupport `json:"clear_thinking_20251015" api:"required"`
	// Indicates whether a capability is supported.
	ClearToolUses20250919 BetaCapabilitySupport `json:"clear_tool_uses_20250919" api:"required"`
	// Indicates whether a capability is supported.
	Compact20260112 BetaCapabilitySupport `json:"compact_20260112" api:"required"`
	// Whether this capability is supported by the model.
	Supported bool `json:"supported" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClearThinking20251015 respjson.Field
		ClearToolUses20250919 respjson.Field
		Compact20260112       respjson.Field
		Supported             respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Context management capability details.

func (BetaContextManagementCapability) RawJSON

Returns the unmodified JSON received from the API

func (*BetaContextManagementCapability) UnmarshalJSON

func (r *BetaContextManagementCapability) UnmarshalJSON(data []byte) error

type BetaContextManagementConfigEditUnionParam

type BetaContextManagementConfigEditUnionParam struct {
	OfClearToolUses20250919 *BetaClearToolUses20250919EditParam `json:",omitzero,inline"`
	OfClearThinking20251015 *BetaClearThinking20251015EditParam `json:",omitzero,inline"`
	OfCompact20260112       *BetaCompact20260112EditParam       `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 (BetaContextManagementConfigEditUnionParam) GetClearAtLeast

Returns a pointer to the underlying variant's property, if present.

func (BetaContextManagementConfigEditUnionParam) GetClearToolInputs

Returns a pointer to the underlying variant's property, if present.

func (BetaContextManagementConfigEditUnionParam) GetExcludeTools

func (u BetaContextManagementConfigEditUnionParam) GetExcludeTools() []string

Returns a pointer to the underlying variant's property, if present.

func (BetaContextManagementConfigEditUnionParam) GetInstructions

Returns a pointer to the underlying variant's property, if present.

func (BetaContextManagementConfigEditUnionParam) GetKeep

func (u BetaContextManagementConfigEditUnionParam) GetKeep() (res betaContextManagementConfigEditUnionParamKeep)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaContextManagementConfigEditUnionParam) GetPauseAfterCompaction

func (u BetaContextManagementConfigEditUnionParam) GetPauseAfterCompaction() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaContextManagementConfigEditUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaContextManagementConfigEditUnionParam) MarshalJSON

func (*BetaContextManagementConfigEditUnionParam) UnmarshalJSON

func (u *BetaContextManagementConfigEditUnionParam) UnmarshalJSON(data []byte) error

type BetaContextManagementConfigParam

type BetaContextManagementConfigParam struct {
	// List of context management edits to apply
	Edits []BetaContextManagementConfigEditUnionParam `json:"edits,omitzero"`
	// contains filtered or unexported fields
}

func (BetaContextManagementConfigParam) MarshalJSON

func (r BetaContextManagementConfigParam) MarshalJSON() (data []byte, err error)

func (*BetaContextManagementConfigParam) UnmarshalJSON

func (r *BetaContextManagementConfigParam) UnmarshalJSON(data []byte) error

type BetaContextManagementResponse

type BetaContextManagementResponse struct {
	// List of context management edits that were applied.
	AppliedEdits []BetaContextManagementResponseAppliedEditUnion `json:"applied_edits" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppliedEdits respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaContextManagementResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaContextManagementResponse) UnmarshalJSON

func (r *BetaContextManagementResponse) UnmarshalJSON(data []byte) error

type BetaContextManagementResponseAppliedEditUnion

type BetaContextManagementResponseAppliedEditUnion struct {
	ClearedInputTokens int64 `json:"cleared_input_tokens"`
	// This field is from variant [BetaClearToolUses20250919EditResponse].
	ClearedToolUses int64 `json:"cleared_tool_uses"`
	// Any of "clear_tool_uses_20250919", "clear_thinking_20251015".
	Type string `json:"type"`
	// This field is from variant [BetaClearThinking20251015EditResponse].
	ClearedThinkingTurns int64 `json:"cleared_thinking_turns"`
	JSON                 struct {
		ClearedInputTokens   respjson.Field
		ClearedToolUses      respjson.Field
		Type                 respjson.Field
		ClearedThinkingTurns respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaContextManagementResponseAppliedEditUnion contains all possible properties and values from BetaClearToolUses20250919EditResponse, BetaClearThinking20251015EditResponse.

Use the BetaContextManagementResponseAppliedEditUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaContextManagementResponseAppliedEditUnion) AsAny

func (u BetaContextManagementResponseAppliedEditUnion) AsAny() anyBetaContextManagementResponseAppliedEdit

Use the following switch statement to find the correct variant

switch variant := BetaContextManagementResponseAppliedEditUnion.AsAny().(type) {
case Juglow.BetaClearToolUses20250919EditResponse:
case Juglow.BetaClearThinking20251015EditResponse:
default:
  fmt.Errorf("no variant present")
}

func (BetaContextManagementResponseAppliedEditUnion) AsClearThinking20251015

func (BetaContextManagementResponseAppliedEditUnion) AsClearToolUses20250919

func (BetaContextManagementResponseAppliedEditUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaContextManagementResponseAppliedEditUnion) UnmarshalJSON

func (r *BetaContextManagementResponseAppliedEditUnion) UnmarshalJSON(data []byte) error

type BetaCountTokensContextManagementResponse

type BetaCountTokensContextManagementResponse struct {
	// The original token count before context management was applied
	OriginalInputTokens int64 `json:"original_input_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		OriginalInputTokens respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaCountTokensContextManagementResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaCountTokensContextManagementResponse) UnmarshalJSON

func (r *BetaCountTokensContextManagementResponse) UnmarshalJSON(data []byte) error

type BetaCurrency

type BetaCurrency string
const (
	BetaCurrencyUsd BetaCurrency = "USD"
)

type BetaDeletedMessageBatch

type BetaDeletedMessageBatch struct {
	// ID of the Message Batch.
	ID string `json:"id" api:"required"`
	// Deleted object type.
	//
	// For Message Batches, this is always `"message_batch_deleted"`.
	Type constant.MessageBatchDeleted `json:"type" default:"message_batch_deleted"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaDeletedMessageBatch) RawJSON

func (r BetaDeletedMessageBatch) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaDeletedMessageBatch) UnmarshalJSON

func (r *BetaDeletedMessageBatch) UnmarshalJSON(data []byte) error

type BetaDeploymentArchiveParams

type BetaDeploymentArchiveParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaDeploymentGetParams

type BetaDeploymentGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaDeploymentListParams

type BetaDeploymentListParams struct {
	// Filter by agent ID.
	AgentID param.Opt[string] `query:"agent_id,omitzero" json:"-"`
	// Return deployments created at or after this time (inclusive).
	CreatedAtGte param.Opt[time.Time] `query:"created_at[gte],omitzero" format:"date-time" json:"-"`
	// Return deployments created at or before this time (inclusive).
	CreatedAtLte param.Opt[time.Time] `query:"created_at[lte],omitzero" format:"date-time" json:"-"`
	// When true, includes archived deployments. Default: false (exclude archived).
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Maximum results per page. Default 20, maximum 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Filter by status: active or paused. Omit for both. To include archived
	// deployments, use include_archived instead; the two cannot be combined.
	//
	// Any of "active", "paused".
	Status BetaManagedAgentsDeploymentStatus `query:"status,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaDeploymentListParams) URLQuery

func (r BetaDeploymentListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaDeploymentListParams's query parameters as `url.Values`.

type BetaDeploymentNewParams

type BetaDeploymentNewParams struct {
	// Agent to deploy. Accepts the `agent` ID string, which pins the latest version,
	// or an `agent` object with both id and version specified. The agent must exist
	// and not be archived.
	Agent BetaDeploymentNewParamsAgentUnion `json:"agent,omitzero" api:"required"`
	// ID of the `environment` defining the container configuration for sessions
	// created from this deployment.
	EnvironmentID string `json:"environment_id" api:"required"`
	// Events to send to each session immediately after creation. At least 1,
	// maximum 50.
	InitialEvents []BetaManagedAgentsDeploymentInitialEventParamsUnion `json:"initial_events,omitzero" api:"required"`
	// Human-readable name for the deployment.
	Name string `json:"name" api:"required"`
	// Description of what the deployment does.
	Description param.Opt[string] `json:"description,omitzero"`
	// A hard spend ceiling. The session stops issuing new model requests once the
	// tracked list cost reaches `max_list_cost`.
	Budget BetaManagedAgentsBudgetLimitParam `json:"budget,omitzero"`
	// Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up
	// to 512 chars.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Resources (e.g. repositories, files) to mount into each session's container.
	// Maximum 500.
	Resources []BetaDeploymentNewParamsResourceUnion `json:"resources,omitzero"`
	// 5-field POSIX cron schedule. Literal wall-clock matching in the configured
	// timezone.
	Schedule BetaManagedAgentsScheduleParams `json:"schedule,omitzero"`
	// Vault IDs for stored credentials the agent can use during sessions created from
	// this deployment. Maximum 50.
	VaultIDs []string `json:"vault_ids,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaDeploymentNewParams) MarshalJSON

func (r BetaDeploymentNewParams) MarshalJSON() (data []byte, err error)

func (*BetaDeploymentNewParams) UnmarshalJSON

func (r *BetaDeploymentNewParams) UnmarshalJSON(data []byte) error

type BetaDeploymentNewParamsAgentUnion

type BetaDeploymentNewParamsAgentUnion struct {
	OfString                  param.Opt[string]             `json:",omitzero,inline"`
	OfBetaManagedAgentsAgents *BetaManagedAgentsAgentParams `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 (BetaDeploymentNewParamsAgentUnion) MarshalJSON

func (u BetaDeploymentNewParamsAgentUnion) MarshalJSON() ([]byte, error)

func (*BetaDeploymentNewParamsAgentUnion) UnmarshalJSON

func (u *BetaDeploymentNewParamsAgentUnion) UnmarshalJSON(data []byte) error

type BetaDeploymentNewParamsResourceUnion

type BetaDeploymentNewParamsResourceUnion struct {
	OfGitHubRepository *BetaManagedAgentsGitHubRepositoryResourceParams `json:",omitzero,inline"`
	OfFile             *BetaManagedAgentsFileResourceParams             `json:",omitzero,inline"`
	OfMemoryStore      *BetaManagedAgentsMemoryStoreResourceParam       `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 (BetaDeploymentNewParamsResourceUnion) GetAccess

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentNewParamsResourceUnion) GetAuthorizationToken

func (u BetaDeploymentNewParamsResourceUnion) GetAuthorizationToken() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentNewParamsResourceUnion) GetCheckout

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentNewParamsResourceUnion) GetFileID

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentNewParamsResourceUnion) GetInstructions

func (u BetaDeploymentNewParamsResourceUnion) GetInstructions() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentNewParamsResourceUnion) GetMemoryStoreID

func (u BetaDeploymentNewParamsResourceUnion) GetMemoryStoreID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentNewParamsResourceUnion) GetMountPath

func (u BetaDeploymentNewParamsResourceUnion) GetMountPath() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentNewParamsResourceUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentNewParamsResourceUnion) GetURL

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentNewParamsResourceUnion) MarshalJSON

func (u BetaDeploymentNewParamsResourceUnion) MarshalJSON() ([]byte, error)

func (*BetaDeploymentNewParamsResourceUnion) UnmarshalJSON

func (u *BetaDeploymentNewParamsResourceUnion) UnmarshalJSON(data []byte) error

type BetaDeploymentPauseParams

type BetaDeploymentPauseParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaDeploymentRunGetParams

type BetaDeploymentRunGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaDeploymentRunListParams

type BetaDeploymentRunListParams struct {
	// Return runs created strictly after this time (exclusive).
	CreatedAtGt param.Opt[time.Time] `query:"created_at[gt],omitzero" format:"date-time" json:"-"`
	// Return runs created at or after this time (inclusive).
	CreatedAtGte param.Opt[time.Time] `query:"created_at[gte],omitzero" format:"date-time" json:"-"`
	// Return runs created strictly before this time (exclusive).
	CreatedAtLt param.Opt[time.Time] `query:"created_at[lt],omitzero" format:"date-time" json:"-"`
	// Return runs created at or before this time (inclusive).
	CreatedAtLte param.Opt[time.Time] `query:"created_at[lte],omitzero" format:"date-time" json:"-"`
	// Filter to a specific deployment. Omit to list across all deployments in the
	// workspace. Filtering by a non-existent deployment_id returns 200 with empty
	// data.
	DeploymentID param.Opt[string] `query:"deployment_id,omitzero" json:"-"`
	// Filter: true for runs with non-null error, false for runs with non-null
	// session_id. Omit for all.
	HasError param.Opt[bool] `query:"has_error,omitzero" json:"-"`
	// Maximum results per page. Default 20, maximum 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor. Pass next_page from the previous response. Invalid or
	// expired cursors return 400.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Filter runs by what triggered them. Omit to return all runs.
	//
	// Any of "schedule", "manual".
	TriggerType BetaManagedAgentsTriggerType `query:"trigger_type,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaDeploymentRunListParams) URLQuery

func (r BetaDeploymentRunListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaDeploymentRunListParams's query parameters as `url.Values`.

type BetaDeploymentRunParams

type BetaDeploymentRunParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaDeploymentRunService

type BetaDeploymentRunService struct {
	Options []option.RequestOption
}

BetaDeploymentRunService contains methods and other services that help with interacting with the Juglow 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 NewBetaDeploymentRunService method instead.

func NewBetaDeploymentRunService

func NewBetaDeploymentRunService(opts ...option.RequestOption) (r BetaDeploymentRunService)

NewBetaDeploymentRunService 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 (*BetaDeploymentRunService) Get

Get Deployment Run

func (*BetaDeploymentRunService) List

List Deployment Runs

func (*BetaDeploymentRunService) ListAutoPaging

List Deployment Runs

type BetaDeploymentService

type BetaDeploymentService struct {
	Options []option.RequestOption
}

BetaDeploymentService contains methods and other services that help with interacting with the Juglow 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 NewBetaDeploymentService method instead.

func NewBetaDeploymentService

func NewBetaDeploymentService(opts ...option.RequestOption) (r BetaDeploymentService)

NewBetaDeploymentService 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 (*BetaDeploymentService) Archive

Archive Deployment

func (*BetaDeploymentService) Get

Get Deployment

func (*BetaDeploymentService) List

List Deployments

func (*BetaDeploymentService) ListAutoPaging

List Deployments

func (*BetaDeploymentService) New

Create Deployment

func (*BetaDeploymentService) Pause

Pause Deployment

func (*BetaDeploymentService) Run

Run Deployment Now

func (*BetaDeploymentService) Unpause

Unpause Deployment

func (*BetaDeploymentService) Update

Update Deployment

type BetaDeploymentUnpauseParams

type BetaDeploymentUnpauseParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaDeploymentUpdateParams

type BetaDeploymentUpdateParams struct {
	// Description. Omit to preserve; send empty string or null to clear.
	Description param.Opt[string] `json:"description,omitzero"`
	// ID of the `environment` where sessions run. Omit to preserve. Cannot be cleared.
	EnvironmentID param.Opt[string] `json:"environment_id,omitzero"`
	// Human-readable name. Must be non-empty. Omit to preserve. Cannot be cleared.
	Name param.Opt[string] `json:"name,omitzero"`
	// Metadata patch. Set a key to a string to upsert it, or to null to delete it.
	// Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars
	// each) with values up to 512 chars.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Session resources. Full replacement. Omit to preserve; send empty array or null
	// to clear. Maximum 500.
	Resources []BetaDeploymentUpdateParamsResourceUnion `json:"resources,omitzero"`
	// Vault IDs. Full replacement. Omit to preserve; send empty array or null to
	// clear. Maximum 50.
	VaultIDs []string `json:"vault_ids,omitzero"`
	// Agent to deploy. Accepts the `agent` ID string, which re-pins to the latest
	// version, or an `agent` object with both id and version specified. Omit to
	// preserve. Cannot be cleared.
	Agent BetaDeploymentUpdateParamsAgentUnion `json:"agent,omitzero"`
	// A hard spend ceiling. The session stops issuing new model requests once the
	// tracked list cost reaches `max_list_cost`.
	Budget BetaManagedAgentsBudgetLimitParam `json:"budget,omitzero"`
	// Initial events. Full replacement. Omit to preserve. Cannot be cleared. At least
	// 1, maximum 50.
	InitialEvents []BetaManagedAgentsDeploymentInitialEventParamsUnion `json:"initial_events,omitzero"`
	// 5-field POSIX cron schedule. Literal wall-clock matching in the configured
	// timezone.
	Schedule BetaManagedAgentsScheduleParams `json:"schedule,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaDeploymentUpdateParams) MarshalJSON

func (r BetaDeploymentUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaDeploymentUpdateParams) UnmarshalJSON

func (r *BetaDeploymentUpdateParams) UnmarshalJSON(data []byte) error

type BetaDeploymentUpdateParamsAgentUnion

type BetaDeploymentUpdateParamsAgentUnion struct {
	OfString                  param.Opt[string]             `json:",omitzero,inline"`
	OfBetaManagedAgentsAgents *BetaManagedAgentsAgentParams `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 (BetaDeploymentUpdateParamsAgentUnion) MarshalJSON

func (u BetaDeploymentUpdateParamsAgentUnion) MarshalJSON() ([]byte, error)

func (*BetaDeploymentUpdateParamsAgentUnion) UnmarshalJSON

func (u *BetaDeploymentUpdateParamsAgentUnion) UnmarshalJSON(data []byte) error

type BetaDeploymentUpdateParamsResourceUnion

type BetaDeploymentUpdateParamsResourceUnion struct {
	OfGitHubRepository *BetaManagedAgentsGitHubRepositoryResourceParams `json:",omitzero,inline"`
	OfFile             *BetaManagedAgentsFileResourceParams             `json:",omitzero,inline"`
	OfMemoryStore      *BetaManagedAgentsMemoryStoreResourceParam       `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 (BetaDeploymentUpdateParamsResourceUnion) GetAccess

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentUpdateParamsResourceUnion) GetAuthorizationToken

func (u BetaDeploymentUpdateParamsResourceUnion) GetAuthorizationToken() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentUpdateParamsResourceUnion) GetCheckout

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentUpdateParamsResourceUnion) GetFileID

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentUpdateParamsResourceUnion) GetInstructions

func (u BetaDeploymentUpdateParamsResourceUnion) GetInstructions() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentUpdateParamsResourceUnion) GetMemoryStoreID

func (u BetaDeploymentUpdateParamsResourceUnion) GetMemoryStoreID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentUpdateParamsResourceUnion) GetMountPath

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentUpdateParamsResourceUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentUpdateParamsResourceUnion) GetURL

Returns a pointer to the underlying variant's property, if present.

func (BetaDeploymentUpdateParamsResourceUnion) MarshalJSON

func (u BetaDeploymentUpdateParamsResourceUnion) MarshalJSON() ([]byte, error)

func (*BetaDeploymentUpdateParamsResourceUnion) UnmarshalJSON

func (u *BetaDeploymentUpdateParamsResourceUnion) UnmarshalJSON(data []byte) error

type BetaDiagnostics

type BetaDiagnostics struct {
	// Explains why the prompt cache could not fully reuse the prefix from the request
	// identified by `diagnostics.previous_message_id`. `null` means diagnosis is still
	// pending — the response was serialized before the background comparison
	// completed.
	CacheMissReason BetaDiagnosticsCacheMissReasonUnion `json:"cache_miss_reason" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMissReason respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response envelope for request-level diagnostics. Present (possibly null) whenever the caller supplied `diagnostics` on the request.

func (BetaDiagnostics) RawJSON

func (r BetaDiagnostics) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaDiagnostics) UnmarshalJSON

func (r *BetaDiagnostics) UnmarshalJSON(data []byte) error

type BetaDiagnosticsCacheMissReasonUnion

type BetaDiagnosticsCacheMissReasonUnion struct {
	CacheMissedInputTokens int64 `json:"cache_missed_input_tokens"`
	// Any of "model_changed", "system_changed", "tools_changed", "messages_changed",
	// "previous_message_not_found", "unavailable".
	Type string `json:"type"`
	JSON struct {
		CacheMissedInputTokens respjson.Field
		Type                   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaDiagnosticsCacheMissReasonUnion contains all possible properties and values from BetaCacheMissModelChanged, BetaCacheMissSystemChanged, BetaCacheMissToolsChanged, BetaCacheMissMessagesChanged, BetaCacheMissPreviousMessageNotFound, BetaCacheMissUnavailable.

Use the BetaDiagnosticsCacheMissReasonUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaDiagnosticsCacheMissReasonUnion) AsAny

func (u BetaDiagnosticsCacheMissReasonUnion) AsAny() anyBetaDiagnosticsCacheMissReason

Use the following switch statement to find the correct variant

switch variant := BetaDiagnosticsCacheMissReasonUnion.AsAny().(type) {
case Juglow.BetaCacheMissModelChanged:
case Juglow.BetaCacheMissSystemChanged:
case Juglow.BetaCacheMissToolsChanged:
case Juglow.BetaCacheMissMessagesChanged:
case Juglow.BetaCacheMissPreviousMessageNotFound:
case Juglow.BetaCacheMissUnavailable:
default:
  fmt.Errorf("no variant present")
}

func (BetaDiagnosticsCacheMissReasonUnion) AsMessagesChanged

func (BetaDiagnosticsCacheMissReasonUnion) AsModelChanged

func (BetaDiagnosticsCacheMissReasonUnion) AsPreviousMessageNotFound

func (BetaDiagnosticsCacheMissReasonUnion) AsSystemChanged

func (BetaDiagnosticsCacheMissReasonUnion) AsToolsChanged

func (BetaDiagnosticsCacheMissReasonUnion) AsUnavailable

func (BetaDiagnosticsCacheMissReasonUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaDiagnosticsCacheMissReasonUnion) UnmarshalJSON

func (r *BetaDiagnosticsCacheMissReasonUnion) UnmarshalJSON(data []byte) error

type BetaDiagnosticsParam

type BetaDiagnosticsParam struct {
	// The `id` (`msg_...`) from this client's previous /v1/messages response. The
	// server compares that request's prompt fingerprint against this one and returns
	// `diagnostics.cache_miss_reason` when the prompt-cache prefix could not be
	// reused. Pass `null` on the first turn to opt in without a prior message to
	// compare.
	PreviousMessageID param.Opt[string] `json:"previous_message_id,omitzero"`
	// contains filtered or unexported fields
}

Request-level diagnostics. Currently carries the previous response id for prompt-cache divergence reporting.

func (BetaDiagnosticsParam) MarshalJSON

func (r BetaDiagnosticsParam) MarshalJSON() (data []byte, err error)

func (*BetaDiagnosticsParam) UnmarshalJSON

func (r *BetaDiagnosticsParam) UnmarshalJSON(data []byte) error

type BetaDirectCaller

type BetaDirectCaller struct {
	Type constant.Direct `json:"type" default:"direct"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tool invocation directly from the model.

func (BetaDirectCaller) RawJSON

func (r BetaDirectCaller) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaDirectCaller) ToParam

ToParam converts this BetaDirectCaller to a BetaDirectCallerParam.

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 BetaDirectCallerParam.Overrides()

func (*BetaDirectCaller) UnmarshalJSON

func (r *BetaDirectCaller) UnmarshalJSON(data []byte) error

type BetaDirectCallerParam

type BetaDirectCallerParam struct {
	Type constant.Direct `json:"type" default:"direct"`
	// contains filtered or unexported fields
}

Tool invocation directly from the model.

This struct has a constant value, construct it with NewBetaDirectCallerParam.

func NewBetaDirectCallerParam

func NewBetaDirectCallerParam() BetaDirectCallerParam

func (BetaDirectCallerParam) MarshalJSON

func (r BetaDirectCallerParam) MarshalJSON() (data []byte, err error)

func (*BetaDirectCallerParam) UnmarshalJSON

func (r *BetaDirectCallerParam) UnmarshalJSON(data []byte) error

type BetaDocumentBlock

type BetaDocumentBlock struct {
	// Citation configuration for the document
	Citations BetaCitationConfig           `json:"citations" api:"required"`
	Source    BetaDocumentBlockSourceUnion `json:"source" api:"required"`
	// The title of the document
	Title string            `json:"title" api:"required"`
	Type  constant.Document `json:"type" default:"document"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Citations   respjson.Field
		Source      respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaDocumentBlock) RawJSON

func (r BetaDocumentBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaDocumentBlock) UnmarshalJSON

func (r *BetaDocumentBlock) UnmarshalJSON(data []byte) error

type BetaDocumentBlockSourceUnion

type BetaDocumentBlockSourceUnion struct {
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	// Any of "base64", "text".
	Type string `json:"type"`
	JSON struct {
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaDocumentBlockSourceUnion contains all possible properties and values from BetaBase64PDFSource, BetaPlainTextSource.

Use the BetaDocumentBlockSourceUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaDocumentBlockSourceUnion) AsAny

func (u BetaDocumentBlockSourceUnion) AsAny() anyBetaDocumentBlockSource

Use the following switch statement to find the correct variant

switch variant := BetaDocumentBlockSourceUnion.AsAny().(type) {
case Juglow.BetaBase64PDFSource:
case Juglow.BetaPlainTextSource:
default:
  fmt.Errorf("no variant present")
}

func (BetaDocumentBlockSourceUnion) AsBase64

func (BetaDocumentBlockSourceUnion) AsText

func (BetaDocumentBlockSourceUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaDocumentBlockSourceUnion) UnmarshalJSON

func (r *BetaDocumentBlockSourceUnion) UnmarshalJSON(data []byte) error

type BetaDream

type BetaDream struct {
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	EndedAt time.Time `json:"ended_at" api:"required" format:"date-time"`
	// Failure detail for a Dream whose `status` is `failed`.
	Error        BetaDreamError        `json:"error" api:"required"`
	Inputs       []BetaDreamInputUnion `json:"inputs" api:"required"`
	Instructions string                `json:"instructions" api:"required"`
	// Model identifier and configuration applied to every pipeline stage. Same wire
	// shape as the Agents API ModelConfig.
	Model     BetaDreamModelConfig `json:"model" api:"required"`
	Outputs   []BetaDreamOutput    `json:"outputs" api:"required"`
	SessionID string               `json:"session_id" api:"required"`
	// Lifecycle status of a Dream.
	//
	// Any of "pending", "running", "completed", "failed", "canceled".
	Status BetaDreamStatus `json:"status" api:"required"`
	// Any of "dream".
	Type BetaDreamType `json:"type" api:"required"`
	// Cumulative token usage for the dream across every pipeline stage.
	Usage BetaDreamUsage `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		ArchivedAt   respjson.Field
		CreatedAt    respjson.Field
		EndedAt      respjson.Field
		Error        respjson.Field
		Inputs       respjson.Field
		Instructions respjson.Field
		Model        respjson.Field
		Outputs      respjson.Field
		SessionID    respjson.Field
		Status       respjson.Field
		Type         respjson.Field
		Usage        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An asynchronous memory-consolidation job that reads a memory store plus a set of session transcripts and writes consolidated memories into a new output memory store. The Dreams API is in research preview: the request and response shapes are volatile and may change without the deprecation period that applies to generally-available endpoints.

func (BetaDream) RawJSON

func (r BetaDream) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaDream) UnmarshalJSON

func (r *BetaDream) UnmarshalJSON(data []byte) error

type BetaDreamArchiveParams

type BetaDreamArchiveParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaDreamCancelParams

type BetaDreamCancelParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaDreamError

type BetaDreamError struct {
	Message string `json:"message" api:"required"`
	Type    string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Failure detail for a Dream whose `status` is `failed`.

func (BetaDreamError) RawJSON

func (r BetaDreamError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaDreamError) UnmarshalJSON

func (r *BetaDreamError) UnmarshalJSON(data []byte) error

type BetaDreamGetParams

type BetaDreamGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaDreamInputUnion

type BetaDreamInputUnion struct {
	// This field is from variant [BetaDreamMemoryStoreInput].
	MemoryStoreID string `json:"memory_store_id"`
	// Any of "memory_store", "sessions".
	Type string `json:"type"`
	// This field is from variant [BetaDreamSessionsInput].
	SessionIDs []string `json:"session_ids"`
	JSON       struct {
		MemoryStoreID respjson.Field
		Type          respjson.Field
		SessionIDs    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaDreamInputUnion contains all possible properties and values from BetaDreamMemoryStoreInput, BetaDreamSessionsInput.

Use the BetaDreamInputUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaDreamInputUnion) AsAny

func (u BetaDreamInputUnion) AsAny() anyBetaDreamInput

Use the following switch statement to find the correct variant

switch variant := BetaDreamInputUnion.AsAny().(type) {
case Juglow.BetaDreamMemoryStoreInput:
case Juglow.BetaDreamSessionsInput:
default:
  fmt.Errorf("no variant present")
}

func (BetaDreamInputUnion) AsMemoryStore

func (u BetaDreamInputUnion) AsMemoryStore() (v BetaDreamMemoryStoreInput)

func (BetaDreamInputUnion) AsSessions

func (u BetaDreamInputUnion) AsSessions() (v BetaDreamSessionsInput)

func (BetaDreamInputUnion) RawJSON

func (u BetaDreamInputUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaDreamInputUnion) ToParam

ToParam converts this BetaDreamInputUnion to a BetaDreamInputUnionParam.

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 BetaDreamInputUnionParam.Overrides()

func (*BetaDreamInputUnion) UnmarshalJSON

func (r *BetaDreamInputUnion) UnmarshalJSON(data []byte) error

type BetaDreamInputUnionParam

type BetaDreamInputUnionParam struct {
	OfMemoryStore *BetaDreamMemoryStoreInputParam `json:",omitzero,inline"`
	OfSessions    *BetaDreamSessionsInputParam    `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 BetaDreamInputParamOfMemoryStore

func BetaDreamInputParamOfMemoryStore(memoryStoreID string) BetaDreamInputUnionParam

func BetaDreamInputParamOfSessions

func BetaDreamInputParamOfSessions(sessionIDs []string) BetaDreamInputUnionParam

func (BetaDreamInputUnionParam) GetMemoryStoreID

func (u BetaDreamInputUnionParam) GetMemoryStoreID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaDreamInputUnionParam) GetSessionIDs

func (u BetaDreamInputUnionParam) GetSessionIDs() []string

Returns a pointer to the underlying variant's property, if present.

func (BetaDreamInputUnionParam) GetType

func (u BetaDreamInputUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaDreamInputUnionParam) MarshalJSON

func (u BetaDreamInputUnionParam) MarshalJSON() ([]byte, error)

func (*BetaDreamInputUnionParam) UnmarshalJSON

func (u *BetaDreamInputUnionParam) UnmarshalJSON(data []byte) error

type BetaDreamListParams

type BetaDreamListParams struct {
	// Return dreams with `created_at` strictly after this timestamp (exclusive lower
	// bound, RFC 3339). Unset applies no lower bound.
	CreatedAtGt param.Opt[time.Time] `query:"created_at[gt],omitzero" format:"date-time" json:"-"`
	// Return dreams with `created_at` strictly before this timestamp (exclusive upper
	// bound, RFC 3339). Unset applies no upper bound.
	CreatedAtLt param.Opt[time.Time] `query:"created_at[lt],omitzero" format:"date-time" json:"-"`
	// Query parameter for include_archived
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Query parameter for limit
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Query parameter for page
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Filter by lifecycle status. Repeat the parameter to match any of multiple
	// statuses. Empty applies no status filter.
	Statuses []BetaDreamStatus `query:"statuses,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaDreamListParams) URLQuery

func (r BetaDreamListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaDreamListParams's query parameters as `url.Values`.

type BetaDreamMemoryStoreInput

type BetaDreamMemoryStoreInput struct {
	MemoryStoreID string `json:"memory_store_id" api:"required"`
	// Any of "memory_store".
	Type BetaDreamMemoryStoreInputType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MemoryStoreID respjson.Field
		Type          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An input memory store the dream reads from. The dream never mutates this store.

func (BetaDreamMemoryStoreInput) RawJSON

func (r BetaDreamMemoryStoreInput) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaDreamMemoryStoreInput) ToParam

ToParam converts this BetaDreamMemoryStoreInput to a BetaDreamMemoryStoreInputParam.

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 BetaDreamMemoryStoreInputParam.Overrides()

func (*BetaDreamMemoryStoreInput) UnmarshalJSON

func (r *BetaDreamMemoryStoreInput) UnmarshalJSON(data []byte) error

type BetaDreamMemoryStoreInputParam

type BetaDreamMemoryStoreInputParam struct {
	MemoryStoreID string `json:"memory_store_id" api:"required"`
	// Any of "memory_store".
	Type BetaDreamMemoryStoreInputType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

An input memory store the dream reads from. The dream never mutates this store.

The properties MemoryStoreID, Type are required.

func (BetaDreamMemoryStoreInputParam) MarshalJSON

func (r BetaDreamMemoryStoreInputParam) MarshalJSON() (data []byte, err error)

func (*BetaDreamMemoryStoreInputParam) UnmarshalJSON

func (r *BetaDreamMemoryStoreInputParam) UnmarshalJSON(data []byte) error

type BetaDreamMemoryStoreInputType

type BetaDreamMemoryStoreInputType string
const (
	BetaDreamMemoryStoreInputTypeMemoryStore BetaDreamMemoryStoreInputType = "memory_store"
)

type BetaDreamModelConfig

type BetaDreamModelConfig struct {
	// Model identifier, e.g. "haijun-opus-4-7". 1-256 characters.
	ID string `json:"id" api:"required"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed BetaDreamModelConfigSpeed `json:"speed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Speed       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Model identifier and configuration applied to every pipeline stage. Same wire shape as the Agents API ModelConfig.

func (BetaDreamModelConfig) RawJSON

func (r BetaDreamModelConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaDreamModelConfig) UnmarshalJSON

func (r *BetaDreamModelConfig) UnmarshalJSON(data []byte) error

type BetaDreamModelConfigParam

type BetaDreamModelConfigParam struct {
	// Model identifier, e.g. "haijun-opus-4-7". 1-256 characters.
	ID string `json:"id" api:"required"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed BetaDreamModelConfigParamSpeed `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Model identifier and configuration applied to every pipeline stage.

The property ID is required.

func (BetaDreamModelConfigParam) MarshalJSON

func (r BetaDreamModelConfigParam) MarshalJSON() (data []byte, err error)

func (*BetaDreamModelConfigParam) UnmarshalJSON

func (r *BetaDreamModelConfigParam) UnmarshalJSON(data []byte) error

type BetaDreamModelConfigParamSpeed

type BetaDreamModelConfigParamSpeed string

Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

const (
	BetaDreamModelConfigParamSpeedStandard BetaDreamModelConfigParamSpeed = "standard"
	BetaDreamModelConfigParamSpeedFast     BetaDreamModelConfigParamSpeed = "fast"
)

type BetaDreamModelConfigSpeed

type BetaDreamModelConfigSpeed string

Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

const (
	BetaDreamModelConfigSpeedStandard BetaDreamModelConfigSpeed = "standard"
	BetaDreamModelConfigSpeedFast     BetaDreamModelConfigSpeed = "fast"
)

type BetaDreamNewParams

type BetaDreamNewParams struct {
	Inputs []BetaDreamInputUnionParam `json:"inputs,omitzero" api:"required"`
	// Model identifier and configuration applied to every pipeline stage.
	Model        BetaDreamNewParamsModelUnion `json:"model,omitzero" api:"required"`
	Instructions param.Opt[string]            `json:"instructions,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaDreamNewParams) MarshalJSON

func (r BetaDreamNewParams) MarshalJSON() (data []byte, err error)

func (*BetaDreamNewParams) UnmarshalJSON

func (r *BetaDreamNewParams) UnmarshalJSON(data []byte) error

type BetaDreamNewParamsModelUnion

type BetaDreamNewParamsModelUnion struct {
	OfString               param.Opt[string]          `json:",omitzero,inline"`
	OfBetaDreamModelConfig *BetaDreamModelConfigParam `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 (BetaDreamNewParamsModelUnion) MarshalJSON

func (u BetaDreamNewParamsModelUnion) MarshalJSON() ([]byte, error)

func (*BetaDreamNewParamsModelUnion) UnmarshalJSON

func (u *BetaDreamNewParamsModelUnion) UnmarshalJSON(data []byte) error

type BetaDreamOutput

type BetaDreamOutput struct {
	MemoryStoreID string `json:"memory_store_id" api:"required"`
	// Any of "memory_store".
	Type BetaDreamOutputType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MemoryStoreID respjson.Field
		Type          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An output memory store the dream writes consolidated memories into.

func (BetaDreamOutput) RawJSON

func (r BetaDreamOutput) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaDreamOutput) UnmarshalJSON

func (r *BetaDreamOutput) UnmarshalJSON(data []byte) error

type BetaDreamOutputType

type BetaDreamOutputType string
const (
	BetaDreamOutputTypeMemoryStore BetaDreamOutputType = "memory_store"
)

type BetaDreamService

type BetaDreamService struct {
	Options []option.RequestOption
}

BetaDreamService contains methods and other services that help with interacting with the Juglow 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 NewBetaDreamService method instead.

func NewBetaDreamService

func NewBetaDreamService(opts ...option.RequestOption) (r BetaDreamService)

NewBetaDreamService 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 (*BetaDreamService) Archive

func (r *BetaDreamService) Archive(ctx context.Context, dreamID string, body BetaDreamArchiveParams, opts ...option.RequestOption) (res *BetaDream, err error)

Archive a Dream

func (*BetaDreamService) Cancel

func (r *BetaDreamService) Cancel(ctx context.Context, dreamID string, body BetaDreamCancelParams, opts ...option.RequestOption) (res *BetaDream, err error)

Cancel a Dream

func (*BetaDreamService) Get

func (r *BetaDreamService) Get(ctx context.Context, dreamID string, query BetaDreamGetParams, opts ...option.RequestOption) (res *BetaDream, err error)

Get a Dream

func (*BetaDreamService) List

List Dreams

func (*BetaDreamService) ListAutoPaging

List Dreams

func (*BetaDreamService) New

func (r *BetaDreamService) New(ctx context.Context, params BetaDreamNewParams, opts ...option.RequestOption) (res *BetaDream, err error)

Create a Dream

type BetaDreamSessionsInput

type BetaDreamSessionsInput struct {
	SessionIDs []string `json:"session_ids" api:"required"`
	// Any of "sessions".
	Type BetaDreamSessionsInputType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SessionIDs  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Input session transcripts the dream reads.

func (BetaDreamSessionsInput) RawJSON

func (r BetaDreamSessionsInput) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaDreamSessionsInput) ToParam

ToParam converts this BetaDreamSessionsInput to a BetaDreamSessionsInputParam.

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 BetaDreamSessionsInputParam.Overrides()

func (*BetaDreamSessionsInput) UnmarshalJSON

func (r *BetaDreamSessionsInput) UnmarshalJSON(data []byte) error

type BetaDreamSessionsInputParam

type BetaDreamSessionsInputParam struct {
	SessionIDs []string `json:"session_ids,omitzero" api:"required"`
	// Any of "sessions".
	Type BetaDreamSessionsInputType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Input session transcripts the dream reads.

The properties SessionIDs, Type are required.

func (BetaDreamSessionsInputParam) MarshalJSON

func (r BetaDreamSessionsInputParam) MarshalJSON() (data []byte, err error)

func (*BetaDreamSessionsInputParam) UnmarshalJSON

func (r *BetaDreamSessionsInputParam) UnmarshalJSON(data []byte) error

type BetaDreamSessionsInputType

type BetaDreamSessionsInputType string
const (
	BetaDreamSessionsInputTypeSessions BetaDreamSessionsInputType = "sessions"
)

type BetaDreamStatus

type BetaDreamStatus string

Lifecycle status of a Dream.

const (
	BetaDreamStatusPending   BetaDreamStatus = "pending"
	BetaDreamStatusRunning   BetaDreamStatus = "running"
	BetaDreamStatusCompleted BetaDreamStatus = "completed"
	BetaDreamStatusFailed    BetaDreamStatus = "failed"
	BetaDreamStatusCanceled  BetaDreamStatus = "canceled"
)

type BetaDreamType

type BetaDreamType string
const (
	BetaDreamTypeDream BetaDreamType = "dream"
)

type BetaDreamUsage

type BetaDreamUsage struct {
	// Total tokens used to create prompt-cache entries (sum of all TTL tiers).
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// Total tokens read from prompt cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// Total uncached input tokens consumed across every pipeline stage.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// Total output tokens generated across every pipeline stage.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		OutputTokens             respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cumulative token usage for the dream across every pipeline stage.

func (BetaDreamUsage) RawJSON

func (r BetaDreamUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaDreamUsage) UnmarshalJSON

func (r *BetaDreamUsage) UnmarshalJSON(data []byte) error

type BetaEffortCapability

type BetaEffortCapability struct {
	// Whether the model supports high effort level.
	High BetaCapabilitySupport `json:"high" api:"required"`
	// Whether the model supports low effort level.
	Low BetaCapabilitySupport `json:"low" api:"required"`
	// Whether the model supports max effort level.
	Max BetaCapabilitySupport `json:"max" api:"required"`
	// Whether the model supports medium effort level.
	Medium BetaCapabilitySupport `json:"medium" api:"required"`
	// Whether this capability is supported by the model.
	Supported bool `json:"supported" api:"required"`
	// Indicates whether a capability is supported.
	Xhigh BetaCapabilitySupport `json:"xhigh" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		High        respjson.Field
		Low         respjson.Field
		Max         respjson.Field
		Medium      respjson.Field
		Supported   respjson.Field
		Xhigh       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Effort (reasoning_effort) capability details.

func (BetaEffortCapability) RawJSON

func (r BetaEffortCapability) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaEffortCapability) UnmarshalJSON

func (r *BetaEffortCapability) UnmarshalJSON(data []byte) error

type BetaEncryptedCodeExecutionResultBlock

type BetaEncryptedCodeExecutionResultBlock struct {
	Content         []BetaCodeExecutionOutputBlock        `json:"content" api:"required"`
	EncryptedStdout string                                `json:"encrypted_stdout" api:"required"`
	ReturnCode      int64                                 `json:"return_code" api:"required"`
	Stderr          string                                `json:"stderr" api:"required"`
	Type            constant.EncryptedCodeExecutionResult `json:"type" default:"encrypted_code_execution_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content         respjson.Field
		EncryptedStdout respjson.Field
		ReturnCode      respjson.Field
		Stderr          respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Code execution result with encrypted stdout for PFC + web_search results.

func (BetaEncryptedCodeExecutionResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BetaEncryptedCodeExecutionResultBlock) UnmarshalJSON

func (r *BetaEncryptedCodeExecutionResultBlock) UnmarshalJSON(data []byte) error

type BetaEncryptedCodeExecutionResultBlockParam

type BetaEncryptedCodeExecutionResultBlockParam struct {
	Content         []BetaCodeExecutionOutputBlockParam `json:"content,omitzero" api:"required"`
	EncryptedStdout string                              `json:"encrypted_stdout" api:"required"`
	ReturnCode      int64                               `json:"return_code" api:"required"`
	Stderr          string                              `json:"stderr" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "encrypted_code_execution_result".
	Type constant.EncryptedCodeExecutionResult `json:"type" default:"encrypted_code_execution_result"`
	// contains filtered or unexported fields
}

Code execution result with encrypted stdout for PFC + web_search results.

The properties Content, EncryptedStdout, ReturnCode, Stderr, Type are required.

func (BetaEncryptedCodeExecutionResultBlockParam) MarshalJSON

func (r BetaEncryptedCodeExecutionResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaEncryptedCodeExecutionResultBlockParam) UnmarshalJSON

func (r *BetaEncryptedCodeExecutionResultBlockParam) UnmarshalJSON(data []byte) error

type BetaEnvironment

type BetaEnvironment struct {
	// Environment identifier (e.g., 'env\_...')
	ID string `json:"id" api:"required"`
	// RFC 3339 timestamp when environment was archived, or null if not archived
	ArchivedAt string `json:"archived_at" api:"required"`
	// Environment configuration (either Juglow Cloud or self-hosted)
	Config BetaEnvironmentConfigUnion `json:"config" api:"required"`
	// RFC 3339 timestamp when environment was created
	CreatedAt string `json:"created_at" api:"required"`
	// User-provided description for the environment
	Description string `json:"description" api:"required"`
	// User-provided metadata key-value pairs
	Metadata map[string]string `json:"metadata" api:"required"`
	// Human-readable name for the environment
	Name string `json:"name" api:"required"`
	// The type of object (always 'environment')
	Type constant.Environment `json:"type" default:"environment"`
	// RFC 3339 timestamp when environment was last updated
	UpdatedAt string `json:"updated_at" api:"required"`
	// The visibility scope for this environment. 'organization' means visible to all
	// accounts. 'account' means visible only to the owning account.
	//
	// Any of "organization", "account".
	Scope BetaEnvironmentScope `json:"scope"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ArchivedAt  respjson.Field
		Config      respjson.Field
		CreatedAt   respjson.Field
		Description respjson.Field
		Metadata    respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		Scope       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Unified Environment resource for both cloud and self-hosted environments.

func (BetaEnvironment) RawJSON

func (r BetaEnvironment) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaEnvironment) UnmarshalJSON

func (r *BetaEnvironment) UnmarshalJSON(data []byte) error

type BetaEnvironmentArchiveParams

type BetaEnvironmentArchiveParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaEnvironmentConfigUnion

type BetaEnvironmentConfigUnion struct {
	// This field is from variant [BetaCloudConfig].
	Networking BetaCloudConfigNetworkingUnion `json:"networking"`
	// This field is from variant [BetaCloudConfig].
	Packages BetaPackages `json:"packages"`
	// Any of "cloud", "self_hosted".
	Type string `json:"type"`
	JSON struct {
		Networking respjson.Field
		Packages   respjson.Field
		Type       respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaEnvironmentConfigUnion contains all possible properties and values from BetaCloudConfig, BetaSelfHostedConfig.

Use the BetaEnvironmentConfigUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaEnvironmentConfigUnion) AsAny

func (u BetaEnvironmentConfigUnion) AsAny() anyBetaEnvironmentConfig

Use the following switch statement to find the correct variant

switch variant := BetaEnvironmentConfigUnion.AsAny().(type) {
case Juglow.BetaCloudConfig:
case Juglow.BetaSelfHostedConfig:
default:
  fmt.Errorf("no variant present")
}

func (BetaEnvironmentConfigUnion) AsCloud

func (BetaEnvironmentConfigUnion) AsSelfHosted

func (u BetaEnvironmentConfigUnion) AsSelfHosted() (v BetaSelfHostedConfig)

func (BetaEnvironmentConfigUnion) RawJSON

func (u BetaEnvironmentConfigUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaEnvironmentConfigUnion) UnmarshalJSON

func (r *BetaEnvironmentConfigUnion) UnmarshalJSON(data []byte) error

type BetaEnvironmentDeleteParams

type BetaEnvironmentDeleteParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaEnvironmentDeleteResponse

type BetaEnvironmentDeleteResponse struct {
	// Environment identifier
	ID string `json:"id" api:"required"`
	// The type of response
	//
	// Any of "environment_deleted".
	Type BetaEnvironmentDeleteResponseType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response after deleting an environment.

func (BetaEnvironmentDeleteResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaEnvironmentDeleteResponse) UnmarshalJSON

func (r *BetaEnvironmentDeleteResponse) UnmarshalJSON(data []byte) error

type BetaEnvironmentDeleteResponseType

type BetaEnvironmentDeleteResponseType string

The type of response

const (
	BetaEnvironmentDeleteResponseTypeEnvironmentDeleted BetaEnvironmentDeleteResponseType = "environment_deleted"
)

type BetaEnvironmentGetParams

type BetaEnvironmentGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaEnvironmentListParams

type BetaEnvironmentListParams struct {
	// Opaque cursor from previous response for pagination. Pass the `next_page` value
	// from the previous response.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Include archived environments in the response
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Maximum number of environments to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaEnvironmentListParams) URLQuery

func (r BetaEnvironmentListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaEnvironmentListParams's query parameters as `url.Values`.

type BetaEnvironmentNewParams

type BetaEnvironmentNewParams struct {
	// Human-readable name for the environment
	Name string `json:"name" api:"required"`
	// Optional description of the environment
	Description param.Opt[string] `json:"description,omitzero"`
	// Environment configuration
	Config BetaEnvironmentNewParamsConfigUnion `json:"config,omitzero"`
	// The visibility scope for this environment. 'organization' makes the environment
	// visible to all accounts. 'account' restricts visibility to the owning account
	// only. Only applicable for self-hosted environments. If not specified, defaults
	// based on organization type.
	//
	// Any of "organization", "account".
	Scope BetaEnvironmentNewParamsScope `json:"scope,omitzero"`
	// User-provided metadata key-value pairs
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaEnvironmentNewParams) MarshalJSON

func (r BetaEnvironmentNewParams) MarshalJSON() (data []byte, err error)

func (*BetaEnvironmentNewParams) UnmarshalJSON

func (r *BetaEnvironmentNewParams) UnmarshalJSON(data []byte) error

type BetaEnvironmentNewParamsConfigUnion

type BetaEnvironmentNewParamsConfigUnion struct {
	OfCloud      *BetaCloudConfigParams      `json:",omitzero,inline"`
	OfSelfHosted *BetaSelfHostedConfigParams `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 (BetaEnvironmentNewParamsConfigUnion) GetNetworking

Returns a pointer to the underlying variant's property, if present.

func (BetaEnvironmentNewParamsConfigUnion) GetPackages

Returns a pointer to the underlying variant's property, if present.

func (BetaEnvironmentNewParamsConfigUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaEnvironmentNewParamsConfigUnion) MarshalJSON

func (u BetaEnvironmentNewParamsConfigUnion) MarshalJSON() ([]byte, error)

func (*BetaEnvironmentNewParamsConfigUnion) UnmarshalJSON

func (u *BetaEnvironmentNewParamsConfigUnion) UnmarshalJSON(data []byte) error

type BetaEnvironmentNewParamsScope

type BetaEnvironmentNewParamsScope string

The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only. Only applicable for self-hosted environments. If not specified, defaults based on organization type.

const (
	BetaEnvironmentNewParamsScopeOrganization BetaEnvironmentNewParamsScope = "organization"
	BetaEnvironmentNewParamsScopeAccount      BetaEnvironmentNewParamsScope = "account"
)

type BetaEnvironmentScope

type BetaEnvironmentScope string

The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

const (
	BetaEnvironmentScopeOrganization BetaEnvironmentScope = "organization"
	BetaEnvironmentScopeAccount      BetaEnvironmentScope = "account"
)

type BetaEnvironmentService

type BetaEnvironmentService struct {
	Options []option.RequestOption
	Work    BetaEnvironmentWorkService
}

BetaEnvironmentService contains methods and other services that help with interacting with the Juglow 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 NewBetaEnvironmentService method instead.

func NewBetaEnvironmentService

func NewBetaEnvironmentService(opts ...option.RequestOption) (r BetaEnvironmentService)

NewBetaEnvironmentService 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 (*BetaEnvironmentService) Archive

func (r *BetaEnvironmentService) Archive(ctx context.Context, environmentID string, body BetaEnvironmentArchiveParams, opts ...option.RequestOption) (res *BetaEnvironment, err error)

Archive an environment by ID. Archived environments cannot be used to create new sessions.

func (*BetaEnvironmentService) Delete

Delete an environment by ID. Returns a confirmation of the deletion.

func (*BetaEnvironmentService) Get

func (r *BetaEnvironmentService) Get(ctx context.Context, environmentID string, query BetaEnvironmentGetParams, opts ...option.RequestOption) (res *BetaEnvironment, err error)

Retrieve a specific environment by ID.

func (*BetaEnvironmentService) List

List environments with pagination support.

func (*BetaEnvironmentService) ListAutoPaging

List environments with pagination support.

func (*BetaEnvironmentService) New

Create a new environment with the specified configuration.

func (*BetaEnvironmentService) Update

func (r *BetaEnvironmentService) Update(ctx context.Context, environmentID string, params BetaEnvironmentUpdateParams, opts ...option.RequestOption) (res *BetaEnvironment, err error)

Update an existing environment's configuration.

type BetaEnvironmentUpdateParams

type BetaEnvironmentUpdateParams struct {
	// Updated description of the environment
	Description param.Opt[string] `json:"description,omitzero"`
	// Updated name for the environment
	Name param.Opt[string] `json:"name,omitzero"`
	// Updated environment configuration
	Config BetaEnvironmentUpdateParamsConfigUnion `json:"config,omitzero"`
	// The visibility scope for this environment. 'organization' makes the environment
	// visible to all accounts. 'account' restricts visibility to the owning account
	// only.
	//
	// Any of "organization", "account".
	Scope BetaEnvironmentUpdateParamsScope `json:"scope,omitzero"`
	// User-provided metadata key-value pairs. Set a value to null or empty string to
	// delete the key.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaEnvironmentUpdateParams) MarshalJSON

func (r BetaEnvironmentUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaEnvironmentUpdateParams) UnmarshalJSON

func (r *BetaEnvironmentUpdateParams) UnmarshalJSON(data []byte) error

type BetaEnvironmentUpdateParamsConfigUnion

type BetaEnvironmentUpdateParamsConfigUnion struct {
	OfCloud      *BetaCloudConfigParams      `json:",omitzero,inline"`
	OfSelfHosted *BetaSelfHostedConfigParams `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 (BetaEnvironmentUpdateParamsConfigUnion) GetNetworking

Returns a pointer to the underlying variant's property, if present.

func (BetaEnvironmentUpdateParamsConfigUnion) GetPackages

Returns a pointer to the underlying variant's property, if present.

func (BetaEnvironmentUpdateParamsConfigUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaEnvironmentUpdateParamsConfigUnion) MarshalJSON

func (u BetaEnvironmentUpdateParamsConfigUnion) MarshalJSON() ([]byte, error)

func (*BetaEnvironmentUpdateParamsConfigUnion) UnmarshalJSON

func (u *BetaEnvironmentUpdateParamsConfigUnion) UnmarshalJSON(data []byte) error

type BetaEnvironmentUpdateParamsScope

type BetaEnvironmentUpdateParamsScope string

The visibility scope for this environment. 'organization' makes the environment visible to all accounts. 'account' restricts visibility to the owning account only.

const (
	BetaEnvironmentUpdateParamsScopeOrganization BetaEnvironmentUpdateParamsScope = "organization"
	BetaEnvironmentUpdateParamsScopeAccount      BetaEnvironmentUpdateParamsScope = "account"
)

type BetaEnvironmentWorkAckParams

type BetaEnvironmentWorkAckParams struct {
	EnvironmentID string `path:"environment_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaEnvironmentWorkGetParams

type BetaEnvironmentWorkGetParams struct {
	EnvironmentID string `path:"environment_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaEnvironmentWorkHeartbeatParams

type BetaEnvironmentWorkHeartbeatParams struct {
	EnvironmentID string `path:"environment_id" api:"required" json:"-"`
	// Desired TTL in seconds
	DesiredTTLSeconds param.Opt[int64] `query:"desired_ttl_seconds,omitzero" json:"-"`
	// Expected last_heartbeat for conditional update (optimistic concurrency). Use
	// literal 'NO_HEARTBEAT' to claim an unclaimed lease (first heartbeat). For
	// subsequent heartbeats, echo the server's previous last_heartbeat value exactly.
	// Returns 412 Precondition Failed if the actual value doesn't match.
	ExpectedLastHeartbeat param.Opt[string] `query:"expected_last_heartbeat,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaEnvironmentWorkHeartbeatParams) URLQuery

func (r BetaEnvironmentWorkHeartbeatParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaEnvironmentWorkHeartbeatParams's query parameters as `url.Values`.

type BetaEnvironmentWorkListParams

type BetaEnvironmentWorkListParams struct {
	// Opaque cursor from previous response for pagination
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Maximum number of work items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaEnvironmentWorkListParams) URLQuery

func (r BetaEnvironmentWorkListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaEnvironmentWorkListParams's query parameters as `url.Values`.

type BetaEnvironmentWorkPollParams

type BetaEnvironmentWorkPollParams struct {
	// How long to wait for work to arrive before returning. Must be 1-999 in
	// milliseconds. Defaults to non-blocking (returns immediately if no work is
	// available).
	BlockMs param.Opt[int64] `query:"block_ms,omitzero" json:"-"`
	// Reclaim unacknowledged work items older than this many milliseconds. If omitted,
	// uses the default (5000ms).
	ReclaimOlderThanMs param.Opt[int64] `query:"reclaim_older_than_ms,omitzero" json:"-"`
	// Unique identifier for the specific worker polling, used to track aggregated
	// environment-level work metrics in Console
	JuglowWorkerID param.Opt[string] `header:"Juglow-Worker-ID,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaEnvironmentWorkPollParams) URLQuery

func (r BetaEnvironmentWorkPollParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaEnvironmentWorkPollParams's query parameters as `url.Values`.

type BetaEnvironmentWorkService

type BetaEnvironmentWorkService struct {
	Options []option.RequestOption
}

BetaEnvironmentWorkService contains methods and other services that help with interacting with the Juglow 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 NewBetaEnvironmentWorkService method instead.

func NewBetaEnvironmentWorkService

func NewBetaEnvironmentWorkService(opts ...option.RequestOption) (r BetaEnvironmentWorkService)

NewBetaEnvironmentWorkService 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 (*BetaEnvironmentWorkService) Ack

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Acknowledge receipt of a work item, transitioning it from 'queued' to 'starting' and removing it from the queue.

func (*BetaEnvironmentWorkService) Get

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Retrieve detailed information about a specific work item.

func (*BetaEnvironmentWorkService) Heartbeat

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Record a heartbeat for a work item to maintain the lease.

func (*BetaEnvironmentWorkService) List

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

List work items in an environment.

func (*BetaEnvironmentWorkService) ListAutoPaging

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

List work items in an environment.

func (*BetaEnvironmentWorkService) Poll

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Long poll for work items in the queue.

func (*BetaEnvironmentWorkService) Stats

Get statistics about the work queue for an environment.

func (*BetaEnvironmentWorkService) Stop

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Stop a work item, initiating graceful or forced shutdown.

func (*BetaEnvironmentWorkService) Update

Note: these endpoints are called automatically by the pre-built environment worker provided in the SDKs and CLI, for orchestrating sessions with self-hosted sandbox environments. They are included here as a reference; you do not need to invoke them directly.

Update work item metadata with merge semantics.

type BetaEnvironmentWorkStatsParams

type BetaEnvironmentWorkStatsParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaEnvironmentWorkStopParams

type BetaEnvironmentWorkStopParams struct {
	EnvironmentID string `path:"environment_id" api:"required" json:"-"`
	// Request to stop a work item.
	BetaSelfHostedWorkStopRequest BetaSelfHostedWorkStopRequestParam
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaEnvironmentWorkStopParams) MarshalJSON

func (r BetaEnvironmentWorkStopParams) MarshalJSON() (data []byte, err error)

func (*BetaEnvironmentWorkStopParams) UnmarshalJSON

func (r *BetaEnvironmentWorkStopParams) UnmarshalJSON(data []byte) error

type BetaEnvironmentWorkUpdateParams

type BetaEnvironmentWorkUpdateParams struct {
	EnvironmentID string `path:"environment_id" api:"required" json:"-"`
	// Request to update work item metadata.
	BetaSelfHostedWorkUpdateRequest BetaSelfHostedWorkUpdateRequestParam
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaEnvironmentWorkUpdateParams) MarshalJSON

func (r BetaEnvironmentWorkUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaEnvironmentWorkUpdateParams) UnmarshalJSON

func (r *BetaEnvironmentWorkUpdateParams) UnmarshalJSON(data []byte) error

type BetaErrorResponse

type BetaErrorResponse struct {
	Error     BetaErrorUnion `json:"error" api:"required"`
	RequestID string         `json:"request_id" api:"required"`
	Type      constant.Error `json:"type" default:"error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Error       respjson.Field
		RequestID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaErrorResponse) RawJSON

func (r BetaErrorResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaErrorResponse) UnmarshalJSON

func (r *BetaErrorResponse) UnmarshalJSON(data []byte) error

type BetaErrorUnion

type BetaErrorUnion struct {
	Message string `json:"message"`
	// Any of "invalid_request_error", "authentication_error", "billing_error",
	// "permission_error", "not_found_error", "rate_limit_error", "timeout_error",
	// "api_error", "overloaded_error".
	Type string `json:"type"`
	JSON struct {
		Message respjson.Field
		Type    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaErrorUnion contains all possible properties and values from BetaInvalidRequestError, BetaAuthenticationError, BetaBillingError, BetaPermissionError, BetaNotFoundError, BetaRateLimitError, BetaGatewayTimeoutError, BetaAPIError, BetaOverloadedError.

Use the BetaErrorUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaErrorUnion) AsAPIError

func (u BetaErrorUnion) AsAPIError() (v BetaAPIError)

func (BetaErrorUnion) AsAny

func (u BetaErrorUnion) AsAny() anyBetaError

Use the following switch statement to find the correct variant

switch variant := BetaErrorUnion.AsAny().(type) {
case Juglow.BetaInvalidRequestError:
case Juglow.BetaAuthenticationError:
case Juglow.BetaBillingError:
case Juglow.BetaPermissionError:
case Juglow.BetaNotFoundError:
case Juglow.BetaRateLimitError:
case Juglow.BetaGatewayTimeoutError:
case Juglow.BetaAPIError:
case Juglow.BetaOverloadedError:
default:
  fmt.Errorf("no variant present")
}

func (BetaErrorUnion) AsAuthenticationError

func (u BetaErrorUnion) AsAuthenticationError() (v BetaAuthenticationError)

func (BetaErrorUnion) AsBillingError

func (u BetaErrorUnion) AsBillingError() (v BetaBillingError)

func (BetaErrorUnion) AsInvalidRequestError

func (u BetaErrorUnion) AsInvalidRequestError() (v BetaInvalidRequestError)

func (BetaErrorUnion) AsNotFoundError

func (u BetaErrorUnion) AsNotFoundError() (v BetaNotFoundError)

func (BetaErrorUnion) AsOverloadedError

func (u BetaErrorUnion) AsOverloadedError() (v BetaOverloadedError)

func (BetaErrorUnion) AsPermissionError

func (u BetaErrorUnion) AsPermissionError() (v BetaPermissionError)

func (BetaErrorUnion) AsRateLimitError

func (u BetaErrorUnion) AsRateLimitError() (v BetaRateLimitError)

func (BetaErrorUnion) AsTimeoutError

func (u BetaErrorUnion) AsTimeoutError() (v BetaGatewayTimeoutError)

func (BetaErrorUnion) RawJSON

func (u BetaErrorUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaErrorUnion) UnmarshalJSON

func (r *BetaErrorUnion) UnmarshalJSON(data []byte) error

type BetaFallbackBlock

type BetaFallbackBlock struct {
	// The model whose output ends at this point — the model that declined at this hop.
	// When the declining hop is the requested model, its `model` echoes the top-level
	// `model` string the caller sent (alias or canonical); when the declining hop is a
	// fallback model, its `model` is that model's canonical id.
	From BetaFallbackInfo `json:"from" api:"required"`
	// The fallback model producing the content that follows this block. Its `model` is
	// always the canonical id.
	To BetaFallbackInfo `json:"to" api:"required"`
	// What caused the `from` model to hand over at this hop.
	Trigger BetaFallbackRefusalTrigger `json:"trigger" api:"required"`
	Type    constant.Fallback          `json:"type" default:"fallback"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		From        respjson.Field
		To          respjson.Field
		Trigger     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Marks the point in `content` where one model's output gives way to the next.

One block appears per hop where a preceding model actually ran this turn and declined. A turn where no preceding model ran and declined has no such boundary and carries no block — the signal for whether a fallback model served the response is the presence of a `fallback_message` entry in `usage.iterations`, not this block.

The block is treated like a server-tool content block for streaming: it arrives via the standard `content_block_start` / `content_block_stop` pair and carries no deltas.

func (BetaFallbackBlock) RawJSON

func (r BetaFallbackBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaFallbackBlock) ToParam

func (*BetaFallbackBlock) UnmarshalJSON

func (r *BetaFallbackBlock) UnmarshalJSON(data []byte) error

type BetaFallbackBlockParam

type BetaFallbackBlockParam struct {
	// Identifies one hop of a fallback transition.
	From BetaFallbackInfoParam `json:"from,omitzero" api:"required"`
	// Identifies one hop of a fallback transition.
	To BetaFallbackInfoParam `json:"to,omitzero" api:"required"`
	// The response block's `trigger`, echoed verbatim. Accepted and ignored by the
	// server; any object or `null` is allowed.
	Trigger any `json:"trigger,omitzero"`
	// This field can be elided, and will marshal its zero value as "fallback".
	Type constant.Fallback `json:"type" default:"fallback"`
	// contains filtered or unexported fields
}

A `fallback` block echoed back from a prior response.

Accepted in `messages[].content` and not rendered into the prompt; not validated against the request's `fallbacks` chain or top-level `model`.

Echo the assistant turn back verbatim, including this block in its original position. The block marks the boundary between content produced before and after a fallback hop, and the server relies on that boundary to validate the turn: when thinking runs flank the boundary, omitting the block merges them into one span the server cannot validate (the request is rejected), and moving it into the middle of a single run is likewise rejected; between non-thinking blocks the block's placement has no validation effect.

The properties From, To, Type are required.

func (BetaFallbackBlockParam) MarshalJSON

func (r BetaFallbackBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaFallbackBlockParam) UnmarshalJSON

func (r *BetaFallbackBlockParam) UnmarshalJSON(data []byte) error

type BetaFallbackCreditNotApplied

type BetaFallbackCreditNotApplied struct {
	// Why the reprice was not applied.
	//
	// A closed enum; additions to the redemption-check vocabulary arrive as deliberate
	// schema updates.
	//
	// Any of "body_mismatch", "continuation_excluded", "continuation_only", "expired",
	// "invalid_target_model", "not_enabled", "reprice_unavailable",
	// "temporarily_unavailable", "variant_fields_present", "wrong_organization",
	// "wrong_platform", "wrong_workspace".
	Reason BetaFallbackCreditNotAppliedReason `json:"reason" api:"required"`
	Type   constant.NotApplied                `json:"type" default:"not_applied"`
	// Request fields to remove before retrying, so the retry can redeem this token.
	//
	// Present exactly when `reason` is `variant_fields_present` — never null, never an
	// empty array; absent otherwise. Fields are named only from your own request, and
	// only after the sealed variant hash matched. A served best-effort retry has
	// already been billed at normal price; nothing redeems retroactively, but a
	// corrected re-send inside the token's five-minute window can still redeem.
	RemoveToRedeem []string `json:"remove_to_redeem" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Reason         respjson.Field
		Type           respjson.Field
		RemoveToRedeem respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

No reprice was applied; `reason` says why.

func (BetaFallbackCreditNotApplied) RawJSON

Returns the unmodified JSON received from the API

func (*BetaFallbackCreditNotApplied) UnmarshalJSON

func (r *BetaFallbackCreditNotApplied) UnmarshalJSON(data []byte) error

type BetaFallbackCreditNotAppliedReason

type BetaFallbackCreditNotAppliedReason string

Why the reprice was not applied.

A closed enum; additions to the redemption-check vocabulary arrive as deliberate schema updates.

const (
	BetaFallbackCreditNotAppliedReasonBodyMismatch           BetaFallbackCreditNotAppliedReason = "body_mismatch"
	BetaFallbackCreditNotAppliedReasonContinuationExcluded   BetaFallbackCreditNotAppliedReason = "continuation_excluded"
	BetaFallbackCreditNotAppliedReasonContinuationOnly       BetaFallbackCreditNotAppliedReason = "continuation_only"
	BetaFallbackCreditNotAppliedReasonExpired                BetaFallbackCreditNotAppliedReason = "expired"
	BetaFallbackCreditNotAppliedReasonInvalidTargetModel     BetaFallbackCreditNotAppliedReason = "invalid_target_model"
	BetaFallbackCreditNotAppliedReasonNotEnabled             BetaFallbackCreditNotAppliedReason = "not_enabled"
	BetaFallbackCreditNotAppliedReasonRepriceUnavailable     BetaFallbackCreditNotAppliedReason = "reprice_unavailable"
	BetaFallbackCreditNotAppliedReasonTemporarilyUnavailable BetaFallbackCreditNotAppliedReason = "temporarily_unavailable"
	BetaFallbackCreditNotAppliedReasonVariantFieldsPresent   BetaFallbackCreditNotAppliedReason = "variant_fields_present"
	BetaFallbackCreditNotAppliedReasonWrongOrganization      BetaFallbackCreditNotAppliedReason = "wrong_organization"
	BetaFallbackCreditNotAppliedReasonWrongPlatform          BetaFallbackCreditNotAppliedReason = "wrong_platform"
	BetaFallbackCreditNotAppliedReasonWrongWorkspace         BetaFallbackCreditNotAppliedReason = "wrong_workspace"
)

type BetaFallbackCreditRedeemed

type BetaFallbackCreditRedeemed struct {
	Type constant.Redeemed `json:"type" default:"redeemed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The reprice was applied: the retry is billed as if the conversation had been on the retry model all along.

func (BetaFallbackCreditRedeemed) RawJSON

func (r BetaFallbackCreditRedeemed) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaFallbackCreditRedeemed) UnmarshalJSON

func (r *BetaFallbackCreditRedeemed) UnmarshalJSON(data []byte) error

type BetaFallbackCreditTokenParam

type BetaFallbackCreditTokenParam struct {
	// The opaque `fallback_credit_token` from a prior refusal's `stop_details` — the
	// same string the bare-string form carries.
	Token string `json:"token" api:"required"`
	// How a failing token affects the retry. `strict` (the default, and the
	// bare-string behavior): a failing redemption is a 400 and the retry is not
	// served. `best_effort`: the retry is served either way — a token-layer failure no
	// longer rejects the request; the retry proceeds at normal price and the outcome
	// is reported on the response's `usage.fallback_credit`. Two failures stay hard in
	// both modes: a malformed token, and combining `fallback_credit_token` with
	// `fallbacks`.
	//
	// Any of "strict", "best_effort".
	Mode BetaFallbackCreditTokenParamMode `json:"mode,omitzero"`
	// contains filtered or unexported fields
}

Object form of `fallback_credit_token`: the token plus a redemption mode.

Requires `Juglow-beta: fallback-credit-2026-07-01`; without that header the field accepts the bare string only. The bare string and the mode-less object are equivalent (both select `strict`), so wrapping an existing token changes nothing by itself.

The property Token is required.

func (BetaFallbackCreditTokenParam) MarshalJSON

func (r BetaFallbackCreditTokenParam) MarshalJSON() (data []byte, err error)

func (*BetaFallbackCreditTokenParam) UnmarshalJSON

func (r *BetaFallbackCreditTokenParam) UnmarshalJSON(data []byte) error

type BetaFallbackCreditTokenParamMode

type BetaFallbackCreditTokenParamMode string

How a failing token affects the retry. `strict` (the default, and the bare-string behavior): a failing redemption is a 400 and the retry is not served. `best_effort`: the retry is served either way — a token-layer failure no longer rejects the request; the retry proceeds at normal price and the outcome is reported on the response's `usage.fallback_credit`. Two failures stay hard in both modes: a malformed token, and combining `fallback_credit_token` with `fallbacks`.

const (
	BetaFallbackCreditTokenParamModeStrict     BetaFallbackCreditTokenParamMode = "strict"
	BetaFallbackCreditTokenParamModeBestEffort BetaFallbackCreditTokenParamMode = "best_effort"
)

type BetaFallbackCreditUsage

type BetaFallbackCreditUsage struct {
	// Whether the fallback-credit reprice was applied to this response's billing.
	//
	// A union discriminated on `type`. `redeemed`: the retry is billed as if the
	// conversation had been on the retry model all along — including when the
	// resulting shift is zero because there was nothing to move. `not_applied`: no
	// reprice was applied; the arm's `reason` says why.
	Status BetaFallbackCreditUsageStatusUnion `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Outcome of the `fallback_credit_token` presented on this request.

func (BetaFallbackCreditUsage) RawJSON

func (r BetaFallbackCreditUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaFallbackCreditUsage) UnmarshalJSON

func (r *BetaFallbackCreditUsage) UnmarshalJSON(data []byte) error

type BetaFallbackCreditUsageStatusUnion

type BetaFallbackCreditUsageStatusUnion struct {
	// Any of "redeemed", "not_applied".
	Type string `json:"type"`
	// This field is from variant [BetaFallbackCreditNotApplied].
	Reason BetaFallbackCreditNotAppliedReason `json:"reason"`
	// This field is from variant [BetaFallbackCreditNotApplied].
	RemoveToRedeem []string `json:"remove_to_redeem"`
	JSON           struct {
		Type           respjson.Field
		Reason         respjson.Field
		RemoveToRedeem respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaFallbackCreditUsageStatusUnion contains all possible properties and values from BetaFallbackCreditRedeemed, BetaFallbackCreditNotApplied.

Use the BetaFallbackCreditUsageStatusUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaFallbackCreditUsageStatusUnion) AsAny

func (u BetaFallbackCreditUsageStatusUnion) AsAny() anyBetaFallbackCreditUsageStatus

Use the following switch statement to find the correct variant

switch variant := BetaFallbackCreditUsageStatusUnion.AsAny().(type) {
case Juglow.BetaFallbackCreditRedeemed:
case Juglow.BetaFallbackCreditNotApplied:
default:
  fmt.Errorf("no variant present")
}

func (BetaFallbackCreditUsageStatusUnion) AsNotApplied

func (BetaFallbackCreditUsageStatusUnion) AsRedeemed

func (BetaFallbackCreditUsageStatusUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaFallbackCreditUsageStatusUnion) UnmarshalJSON

func (r *BetaFallbackCreditUsageStatusUnion) UnmarshalJSON(data []byte) error

type BetaFallbackInfo

type BetaFallbackInfo struct {
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Model       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Identifies one hop of a fallback transition.

func (BetaFallbackInfo) RawJSON

func (r BetaFallbackInfo) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaFallbackInfo) UnmarshalJSON

func (r *BetaFallbackInfo) UnmarshalJSON(data []byte) error

type BetaFallbackInfoParam

type BetaFallbackInfoParam struct {
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Identifies one hop of a fallback transition.

The property Model is required.

func (BetaFallbackInfoParam) MarshalJSON

func (r BetaFallbackInfoParam) MarshalJSON() (data []byte, err error)

func (*BetaFallbackInfoParam) UnmarshalJSON

func (r *BetaFallbackInfoParam) UnmarshalJSON(data []byte) error

type BetaFallbackMessageIterationUsage

type BetaFallbackMessageIterationUsage struct {
	// Breakdown of cached tokens by TTL
	CacheCreation BetaCacheCreation `json:"cache_creation" api:"required"`
	// The number of input tokens used to create the cache entry.
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// The number of input tokens read from the cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// The number of input tokens which were used.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model" api:"required"`
	// The number of output tokens which were used.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// Usage for the fallback-model attempt that served the response
	Type constant.FallbackMessage `json:"type" default:"fallback_message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreation            respjson.Field
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		Model                    respjson.Field
		OutputTokens             respjson.Field
		Type                     respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token usage for the fallback-model attempt of a server-side fallback request.

Produced in place of a `message` entry for whichever hop served the response. A declined hop produces the existing `message` entry. Whether a fallback model served the response is signalled by the presence of this entry in `usage.iterations`.

func (BetaFallbackMessageIterationUsage) RawJSON

Returns the unmodified JSON received from the API

func (*BetaFallbackMessageIterationUsage) UnmarshalJSON

func (r *BetaFallbackMessageIterationUsage) UnmarshalJSON(data []byte) error

type BetaFallbackParam

type BetaFallbackParam struct {
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model     Model            `json:"model,omitzero" api:"required"`
	MaxTokens param.Opt[int64] `json:"max_tokens,omitzero"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed        BetaFallbackParamSpeed         `json:"speed,omitzero"`
	Thinking     BetaFallbackParamThinkingUnion `json:"thinking,omitzero"`
	OutputConfig BetaOutputConfigParam          `json:"output_config,omitzero"`
	ExtraFields  map[string]any                 `json:"-"`
	// contains filtered or unexported fields
}

One entry in the `fallbacks` chain on a `/v1/messages` request.

`model` is required. The override fields (`max_tokens`, `thinking`, `output_config`, and `speed`) set the corresponding parameter for this attempt only and are validated as if the request were made to `model`. Any other key is rejected at parse time.

The property Model is required.

func (BetaFallbackParam) MarshalJSON

func (r BetaFallbackParam) MarshalJSON() (data []byte, err error)

func (*BetaFallbackParam) UnmarshalJSON

func (r *BetaFallbackParam) UnmarshalJSON(data []byte) error

type BetaFallbackParamSpeed

type BetaFallbackParamSpeed string

Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

const (
	BetaFallbackParamSpeedStandard BetaFallbackParamSpeed = "standard"
	BetaFallbackParamSpeedFast     BetaFallbackParamSpeed = "fast"
)

type BetaFallbackParamThinkingUnion

type BetaFallbackParamThinkingUnion struct {
	OfEnabled  *BetaThinkingConfigEnabledParam  `json:",omitzero,inline"`
	OfDisabled *BetaThinkingConfigDisabledParam `json:",omitzero,inline"`
	OfAdaptive *BetaThinkingConfigAdaptiveParam `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 (BetaFallbackParamThinkingUnion) GetBudgetTokens

func (u BetaFallbackParamThinkingUnion) GetBudgetTokens() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaFallbackParamThinkingUnion) GetDisplay

func (u BetaFallbackParamThinkingUnion) GetDisplay() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaFallbackParamThinkingUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaFallbackParamThinkingUnion) MarshalJSON

func (u BetaFallbackParamThinkingUnion) MarshalJSON() ([]byte, error)

func (*BetaFallbackParamThinkingUnion) UnmarshalJSON

func (u *BetaFallbackParamThinkingUnion) UnmarshalJSON(data []byte) error

type BetaFallbackRefusalTrigger

type BetaFallbackRefusalTrigger struct {
	// The policy category that triggered a refusal.
	//
	// Any of "cyber", "bio", "frontier_llm", "reasoning_extraction", "general_harms".
	Category BetaFallbackRefusalTriggerCategory `json:"category" api:"required"`
	Type     constant.Refusal                   `json:"type" default:"refusal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Category    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The `from` model declined for policy reasons.

func (BetaFallbackRefusalTrigger) RawJSON

func (r BetaFallbackRefusalTrigger) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaFallbackRefusalTrigger) UnmarshalJSON

func (r *BetaFallbackRefusalTrigger) UnmarshalJSON(data []byte) error

type BetaFallbackRefusalTriggerCategory

type BetaFallbackRefusalTriggerCategory string

The policy category that triggered a refusal.

const (
	BetaFallbackRefusalTriggerCategoryCyber               BetaFallbackRefusalTriggerCategory = "cyber"
	BetaFallbackRefusalTriggerCategoryBio                 BetaFallbackRefusalTriggerCategory = "bio"
	BetaFallbackRefusalTriggerCategoryFrontierLLM         BetaFallbackRefusalTriggerCategory = "frontier_llm"
	BetaFallbackRefusalTriggerCategoryReasoningExtraction BetaFallbackRefusalTriggerCategory = "reasoning_extraction"
	BetaFallbackRefusalTriggerCategoryGeneralHarms        BetaFallbackRefusalTriggerCategory = "general_harms"
)

type BetaFallbacksParamUnion

type BetaFallbacksParamUnion struct {
	OfBetaFallbackArray []BetaFallbackParam `json:",omitzero,inline"`
	// Construct this variant with constant.ValueOf[constant.Default]()
	OfDefault constant.Default `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 BetaFallbacksParamOfDefault

func BetaFallbacksParamOfDefault() BetaFallbacksParamUnion

func (BetaFallbacksParamUnion) MarshalJSON

func (u BetaFallbacksParamUnion) MarshalJSON() ([]byte, error)

func (*BetaFallbacksParamUnion) UnmarshalJSON

func (u *BetaFallbacksParamUnion) UnmarshalJSON(data []byte) error

type BetaFileDeleteParams

type BetaFileDeleteParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaFileDocumentSourceParam

type BetaFileDocumentSourceParam struct {
	FileID string `json:"file_id" api:"required"`
	// This field can be elided, and will marshal its zero value as "file".
	Type constant.File `json:"type" default:"file"`
	// contains filtered or unexported fields
}

The properties FileID, Type are required.

func (BetaFileDocumentSourceParam) MarshalJSON

func (r BetaFileDocumentSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaFileDocumentSourceParam) UnmarshalJSON

func (r *BetaFileDocumentSourceParam) UnmarshalJSON(data []byte) error

type BetaFileDownloadParams

type BetaFileDownloadParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaFileGetMetadataParams

type BetaFileGetMetadataParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaFileImageSourceParam

type BetaFileImageSourceParam struct {
	FileID string `json:"file_id" api:"required"`
	// This field can be elided, and will marshal its zero value as "file".
	Type constant.File `json:"type" default:"file"`
	// contains filtered or unexported fields
}

The properties FileID, Type are required.

func (BetaFileImageSourceParam) MarshalJSON

func (r BetaFileImageSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaFileImageSourceParam) UnmarshalJSON

func (r *BetaFileImageSourceParam) UnmarshalJSON(data []byte) error

type BetaFileListParams

type BetaFileListParams struct {
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately after this object.
	AfterID param.Opt[string] `query:"after_id,omitzero" json:"-"`
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately before this object.
	BeforeID param.Opt[string] `query:"before_id,omitzero" json:"-"`
	// Number of items to return per page.
	//
	// Defaults to `20`. Ranges from `1` to `1000`.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter by scope ID. Only returns files associated with the specified scope
	// (e.g., a session ID).
	ScopeID param.Opt[string] `query:"scope_id,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaFileListParams) URLQuery

func (r BetaFileListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaFileListParams's query parameters as `url.Values`.

type BetaFileScope

type BetaFileScope struct {
	// The ID of the scoping resource (e.g., the session ID).
	ID string `json:"id" api:"required"`
	// The type of scope (e.g., `"session"`).
	Type constant.Session `json:"type" default:"session"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaFileScope) RawJSON

func (r BetaFileScope) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaFileScope) UnmarshalJSON

func (r *BetaFileScope) UnmarshalJSON(data []byte) error

type BetaFileService

type BetaFileService struct {
	Options []option.RequestOption
}

BetaFileService contains methods and other services that help with interacting with the Juglow 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 NewBetaFileService method instead.

func NewBetaFileService

func NewBetaFileService(opts ...option.RequestOption) (r BetaFileService)

NewBetaFileService 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 (*BetaFileService) Delete

func (r *BetaFileService) Delete(ctx context.Context, fileID string, body BetaFileDeleteParams, opts ...option.RequestOption) (res *DeletedFile, err error)

Delete File

func (*BetaFileService) Download

func (r *BetaFileService) Download(ctx context.Context, fileID string, query BetaFileDownloadParams, opts ...option.RequestOption) (res *http.Response, err error)

Download File

func (*BetaFileService) GetMetadata

func (r *BetaFileService) GetMetadata(ctx context.Context, fileID string, query BetaFileGetMetadataParams, opts ...option.RequestOption) (res *FileMetadata, err error)

Get File Metadata

func (*BetaFileService) List

List Files

func (*BetaFileService) ListAutoPaging

List Files

func (*BetaFileService) Upload

func (r *BetaFileService) Upload(ctx context.Context, params BetaFileUploadParams, opts ...option.RequestOption) (res *FileMetadata, err error)

Upload File

type BetaFileUploadParams

type BetaFileUploadParams struct {
	// The file to upload
	File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaFileUploadParams) MarshalMultipart

func (r BetaFileUploadParams) MarshalMultipart() (data []byte, contentType string, err error)

type BetaGatewayTimeoutError

type BetaGatewayTimeoutError struct {
	Message string                `json:"message" api:"required"`
	Type    constant.TimeoutError `json:"type" default:"timeout_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaGatewayTimeoutError) RawJSON

func (r BetaGatewayTimeoutError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaGatewayTimeoutError) UnmarshalJSON

func (r *BetaGatewayTimeoutError) UnmarshalJSON(data []byte) error

type BetaHealthCheckWorkData

type BetaHealthCheckWorkData struct {
	// Health check identifier
	ID string `json:"id" api:"required"`
	// Type of work data
	//
	// Any of "healthcheck".
	Type BetaHealthCheckWorkDataType `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Work data for environment health checks.

This resource type is used for assessing the health of containers where work occurs. The data is opaque to users; the runner handles the health check by probing connectivity to required services.

func (BetaHealthCheckWorkData) RawJSON

func (r BetaHealthCheckWorkData) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaHealthCheckWorkData) UnmarshalJSON

func (r *BetaHealthCheckWorkData) UnmarshalJSON(data []byte) error

type BetaHealthCheckWorkDataType

type BetaHealthCheckWorkDataType string

Type of work data

const (
	BetaHealthCheckWorkDataTypeHealthcheck BetaHealthCheckWorkDataType = "healthcheck"
)

type BetaImageBlockParam

type BetaImageBlockParam struct {
	Source BetaImageBlockParamSourceUnion `json:"source,omitzero" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "image".
	Type constant.Image `json:"type" default:"image"`
	// contains filtered or unexported fields
}

The properties Source, Type are required.

func (BetaImageBlockParam) MarshalJSON

func (r BetaImageBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaImageBlockParam) UnmarshalJSON

func (r *BetaImageBlockParam) UnmarshalJSON(data []byte) error

type BetaImageBlockParamSourceUnion

type BetaImageBlockParamSourceUnion struct {
	OfBase64 *BetaBase64ImageSourceParam `json:",omitzero,inline"`
	OfURL    *BetaURLImageSourceParam    `json:",omitzero,inline"`
	OfFile   *BetaFileImageSourceParam   `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 (BetaImageBlockParamSourceUnion) GetData

Returns a pointer to the underlying variant's property, if present.

func (BetaImageBlockParamSourceUnion) GetFileID

func (u BetaImageBlockParamSourceUnion) GetFileID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaImageBlockParamSourceUnion) GetMediaType

func (u BetaImageBlockParamSourceUnion) GetMediaType() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaImageBlockParamSourceUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaImageBlockParamSourceUnion) GetURL

Returns a pointer to the underlying variant's property, if present.

func (BetaImageBlockParamSourceUnion) MarshalJSON

func (u BetaImageBlockParamSourceUnion) MarshalJSON() ([]byte, error)

func (*BetaImageBlockParamSourceUnion) UnmarshalJSON

func (u *BetaImageBlockParamSourceUnion) UnmarshalJSON(data []byte) error

type BetaInputJSONDelta

type BetaInputJSONDelta struct {
	PartialJSON string                  `json:"partial_json" api:"required"`
	Type        constant.InputJSONDelta `json:"type" default:"input_json_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PartialJSON respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaInputJSONDelta) RawJSON

func (r BetaInputJSONDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaInputJSONDelta) UnmarshalJSON

func (r *BetaInputJSONDelta) UnmarshalJSON(data []byte) error

type BetaInputTokensClearAtLeastParam

type BetaInputTokensClearAtLeastParam struct {
	Value int64 `json:"value" api:"required"`
	// This field can be elided, and will marshal its zero value as "input_tokens".
	Type constant.InputTokens `json:"type" default:"input_tokens"`
	// contains filtered or unexported fields
}

The properties Type, Value are required.

func (BetaInputTokensClearAtLeastParam) MarshalJSON

func (r BetaInputTokensClearAtLeastParam) MarshalJSON() (data []byte, err error)

func (*BetaInputTokensClearAtLeastParam) UnmarshalJSON

func (r *BetaInputTokensClearAtLeastParam) UnmarshalJSON(data []byte) error

type BetaInputTokensTriggerParam

type BetaInputTokensTriggerParam struct {
	Value int64 `json:"value" api:"required"`
	// This field can be elided, and will marshal its zero value as "input_tokens".
	Type constant.InputTokens `json:"type" default:"input_tokens"`
	// contains filtered or unexported fields
}

The properties Type, Value are required.

func (BetaInputTokensTriggerParam) MarshalJSON

func (r BetaInputTokensTriggerParam) MarshalJSON() (data []byte, err error)

func (*BetaInputTokensTriggerParam) UnmarshalJSON

func (r *BetaInputTokensTriggerParam) UnmarshalJSON(data []byte) error

type BetaInvalidRequestError

type BetaInvalidRequestError struct {
	Message string                       `json:"message" api:"required"`
	Type    constant.InvalidRequestError `json:"type" default:"invalid_request_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaInvalidRequestError) RawJSON

func (r BetaInvalidRequestError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaInvalidRequestError) UnmarshalJSON

func (r *BetaInvalidRequestError) UnmarshalJSON(data []byte) error

type BetaIterationsUsage

type BetaIterationsUsage []BetaIterationsUsageItemUnion

type BetaIterationsUsageItemUnion

type BetaIterationsUsageItemUnion struct {
	// This field is from variant [BetaMessageIterationUsage].
	CacheCreation            BetaCacheCreation `json:"cache_creation"`
	CacheCreationInputTokens int64             `json:"cache_creation_input_tokens"`
	CacheReadInputTokens     int64             `json:"cache_read_input_tokens"`
	InputTokens              int64             `json:"input_tokens"`
	// This field is from variant [BetaMessageIterationUsage].
	Model        Model `json:"model"`
	OutputTokens int64 `json:"output_tokens"`
	// Any of "message", "compaction", "advisor_message", "fallback_message".
	Type string `json:"type"`
	JSON struct {
		CacheCreation            respjson.Field
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		Model                    respjson.Field
		OutputTokens             respjson.Field
		Type                     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaIterationsUsageItemUnion contains all possible properties and values from BetaMessageIterationUsage, BetaCompactionIterationUsage, BetaAdvisorMessageIterationUsage, BetaFallbackMessageIterationUsage.

Use the BetaIterationsUsageItemUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaIterationsUsageItemUnion) AsAdvisorMessage

func (BetaIterationsUsageItemUnion) AsAny

func (u BetaIterationsUsageItemUnion) AsAny() anyBetaIterationsUsageItem

Use the following switch statement to find the correct variant

switch variant := BetaIterationsUsageItemUnion.AsAny().(type) {
case Juglow.BetaMessageIterationUsage:
case Juglow.BetaCompactionIterationUsage:
case Juglow.BetaAdvisorMessageIterationUsage:
case Juglow.BetaFallbackMessageIterationUsage:
default:
  fmt.Errorf("no variant present")
}

func (BetaIterationsUsageItemUnion) AsCompaction

func (BetaIterationsUsageItemUnion) AsFallbackMessage

func (BetaIterationsUsageItemUnion) AsMessage

func (BetaIterationsUsageItemUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaIterationsUsageItemUnion) UnmarshalJSON

func (r *BetaIterationsUsageItemUnion) UnmarshalJSON(data []byte) error

type BetaJSONOutputFormatParam

type BetaJSONOutputFormatParam struct {
	// The JSON schema of the format.
	//
	// This can be a map[string]any, json.RawMessage, or a pointer to a Go struct.
	// When a struct pointer is provided, the SDK automatically generates the JSON
	// schema on the wire and can auto-parse the response back into the struct.
	// A struct pointer is preferred over map[string]any because it provides
	// auto-parsing and type safety. If you already have a JSON schema as bytes,
	// use json.RawMessage to avoid unnecessary marshaling overhead.
	//
	// Set the schema on either BetaMessageNewParams.OutputFormat or
	// BetaMessageNewParams.OutputConfig.Format, not both. If both carry a struct
	// pointer, OutputFormat wins for auto-parse.
	Schema any `json:"schema,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "json_schema".
	Type constant.JSONSchema `json:"type" default:"json_schema"`
	// contains filtered or unexported fields
}

BetaJSONOutputFormatParam configures JSON structured output for a message request. The preferred usage is to pass a pointer to a Go struct as Schema. The SDK will auto-generate the JSON schema on the wire and auto-parse the response back into the struct after the request completes:

var result MyStruct
msg, _ := client.Beta.Messages.New(ctx, Juglow.BetaMessageNewParams{
    OutputFormat: Juglow.BetaJSONOutputFormatParam{Schema: &result},
    ...
})

For streaming, call ParseOutput after accumulating the message:

msg.ParseOutput(&result)

The properties Schema, Type are required.

func BetaJSONSchemaOutputFormat

func BetaJSONSchemaOutputFormat(jsonSchema map[string]any) BetaJSONOutputFormatParam

BetaJSONSchemaOutputFormat creates a BetaJSONOutputFormatParam from a JSON schema map. It transforms the schema to ensure compatibility with Juglow's JSON schema requirements.

Example:

schema := map[string]any{
    "type": "object",
    "properties": map[string]any{
        "name": map[string]any{"type": "string"},
        "age": map[string]any{"type": "integer", "minimum": 0},
    },
    "required": []string{"name"},
}
outputFormat := BetaJSONSchemaOutputFormat(schema)

msg, _ := client.Beta.Messages.New(ctx, Juglow.BetaMessageNewParams{
    Model: Juglow.Model("haijun-sonnet-4-5"),
    Messages: Juglow.F([]Juglow.BetaMessageParam{...}),
    MaxTokens: 1024,
    OutputFormat: outputFormat,
})

func (BetaJSONOutputFormatParam) MarshalJSON

func (r BetaJSONOutputFormatParam) MarshalJSON() (data []byte, err error)

func (*BetaJSONOutputFormatParam) UnmarshalJSON

func (r *BetaJSONOutputFormatParam) UnmarshalJSON(data []byte) error

type BetaLimitedNetwork

type BetaLimitedNetwork struct {
	// Permits outbound access to MCP server endpoints configured on the agent, beyond
	// those listed in the `allowed_hosts` array.
	AllowMCPServers bool `json:"allow_mcp_servers" api:"required"`
	// Permits outbound access to public package registries (PyPI, npm, etc.) beyond
	// those listed in the `allowed_hosts` array.
	AllowPackageManagers bool `json:"allow_package_managers" api:"required"`
	// Specifies domains the container can reach.
	AllowedHosts []string `json:"allowed_hosts" api:"required"`
	// Network policy type
	Type constant.Limited `json:"type" default:"limited"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowMCPServers      respjson.Field
		AllowPackageManagers respjson.Field
		AllowedHosts         respjson.Field
		Type                 respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Limited network access.

func (BetaLimitedNetwork) RawJSON

func (r BetaLimitedNetwork) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaLimitedNetwork) UnmarshalJSON

func (r *BetaLimitedNetwork) UnmarshalJSON(data []byte) error

type BetaLimitedNetworkParams

type BetaLimitedNetworkParams struct {
	// Permits outbound access to MCP server endpoints configured on the agent, beyond
	// those listed in the `allowed_hosts` array. Defaults to `false`.
	AllowMCPServers param.Opt[bool] `json:"allow_mcp_servers,omitzero"`
	// Permits outbound access to public package registries (PyPI, npm, etc.) beyond
	// those listed in the `allowed_hosts` array. Defaults to `false`.
	AllowPackageManagers param.Opt[bool] `json:"allow_package_managers,omitzero"`
	// Specifies domains the container can reach.
	AllowedHosts []string `json:"allowed_hosts,omitzero"`
	// Network policy type
	//
	// This field can be elided, and will marshal its zero value as "limited".
	Type constant.Limited `json:"type" default:"limited"`
	// contains filtered or unexported fields
}

Limited network request params.

Fields default to null; on update, omitted fields preserve the existing value.

The property Type is required.

func (BetaLimitedNetworkParams) MarshalJSON

func (r BetaLimitedNetworkParams) MarshalJSON() (data []byte, err error)

func (*BetaLimitedNetworkParams) UnmarshalJSON

func (r *BetaLimitedNetworkParams) UnmarshalJSON(data []byte) error

type BetaMCPToolConfigParam

type BetaMCPToolConfigParam struct {
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	Enabled      param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Configuration for a specific tool in an MCP toolset.

func (BetaMCPToolConfigParam) MarshalJSON

func (r BetaMCPToolConfigParam) MarshalJSON() (data []byte, err error)

func (*BetaMCPToolConfigParam) UnmarshalJSON

func (r *BetaMCPToolConfigParam) UnmarshalJSON(data []byte) error

type BetaMCPToolDefaultConfigParam

type BetaMCPToolDefaultConfigParam struct {
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	Enabled      param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Default configuration for tools in an MCP toolset.

func (BetaMCPToolDefaultConfigParam) MarshalJSON

func (r BetaMCPToolDefaultConfigParam) MarshalJSON() (data []byte, err error)

func (*BetaMCPToolDefaultConfigParam) UnmarshalJSON

func (r *BetaMCPToolDefaultConfigParam) UnmarshalJSON(data []byte) error

type BetaMCPToolResultBlock

type BetaMCPToolResultBlock struct {
	Content   BetaMCPToolResultBlockContentUnion `json:"content" api:"required"`
	IsError   bool                               `json:"is_error" api:"required"`
	ToolUseID string                             `json:"tool_use_id" api:"required"`
	Type      constant.MCPToolResult             `json:"type" default:"mcp_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		IsError     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMCPToolResultBlock) RawJSON

func (r BetaMCPToolResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaMCPToolResultBlock) ToParam

func (*BetaMCPToolResultBlock) UnmarshalJSON

func (r *BetaMCPToolResultBlock) UnmarshalJSON(data []byte) error

type BetaMCPToolResultBlockContentUnion

type BetaMCPToolResultBlockContentUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]BetaTextBlock] instead of an
	// object.
	OfBetaMCPToolResultBlockContent []BetaTextBlock `json:",inline"`
	JSON                            struct {
		OfString                        respjson.Field
		OfBetaMCPToolResultBlockContent respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaMCPToolResultBlockContentUnion contains all possible properties and values from [string], [[]BetaTextBlock].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfBetaMCPToolResultBlockContent]

func (BetaMCPToolResultBlockContentUnion) AsBetaMCPToolResultBlockContent

func (u BetaMCPToolResultBlockContentUnion) AsBetaMCPToolResultBlockContent() (v []BetaTextBlock)

func (BetaMCPToolResultBlockContentUnion) AsString

func (u BetaMCPToolResultBlockContentUnion) AsString() (v string)

func (BetaMCPToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMCPToolResultBlockContentUnion) UnmarshalJSON

func (r *BetaMCPToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type BetaMCPToolUseBlock

type BetaMCPToolUseBlock struct {
	ID    string `json:"id" api:"required"`
	Input any    `json:"input" api:"required"`
	// The name of the MCP tool
	Name string `json:"name" api:"required"`
	// The name of the MCP server
	ServerName string              `json:"server_name" api:"required"`
	Type       constant.MCPToolUse `json:"type" default:"mcp_tool_use"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Input       respjson.Field
		Name        respjson.Field
		ServerName  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMCPToolUseBlock) RawJSON

func (r BetaMCPToolUseBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaMCPToolUseBlock) ToParam

func (*BetaMCPToolUseBlock) UnmarshalJSON

func (r *BetaMCPToolUseBlock) UnmarshalJSON(data []byte) error

type BetaMCPToolUseBlockParam

type BetaMCPToolUseBlockParam struct {
	ID    string `json:"id" api:"required"`
	Input any    `json:"input,omitzero" api:"required"`
	Name  string `json:"name" api:"required"`
	// The name of the MCP server
	ServerName string `json:"server_name" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "mcp_tool_use".
	Type constant.MCPToolUse `json:"type" default:"mcp_tool_use"`
	// contains filtered or unexported fields
}

The properties ID, Input, Name, ServerName, Type are required.

func (BetaMCPToolUseBlockParam) MarshalJSON

func (r BetaMCPToolUseBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaMCPToolUseBlockParam) UnmarshalJSON

func (r *BetaMCPToolUseBlockParam) UnmarshalJSON(data []byte) error

type BetaMCPToolsetParam

type BetaMCPToolsetParam struct {
	// Name of the MCP server to configure tools for
	MCPServerName string `json:"mcp_server_name" api:"required"`
	// Configuration overrides for specific tools, keyed by tool name
	Configs map[string]BetaMCPToolConfigParam `json:"configs,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Default configuration applied to all tools from this server
	DefaultConfig BetaMCPToolDefaultConfigParam `json:"default_config,omitzero"`
	// This field can be elided, and will marshal its zero value as "mcp_toolset".
	Type constant.MCPToolset `json:"type" default:"mcp_toolset"`
	// contains filtered or unexported fields
}

Configuration for a group of tools from an MCP server.

Allows configuring enabled status and defer_loading for all tools from an MCP server, with optional per-tool overrides.

The properties MCPServerName, Type are required.

func (BetaMCPToolsetParam) MarshalJSON

func (r BetaMCPToolsetParam) MarshalJSON() (data []byte, err error)

func (*BetaMCPToolsetParam) UnmarshalJSON

func (r *BetaMCPToolsetParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAPIActor

type BetaManagedAgentsAPIActor struct {
	// ID of the API key that performed the write. This identifies the key, not the
	// secret.
	APIKeyID string `json:"api_key_id" api:"required"`
	// Any of "api_actor".
	Type BetaManagedAgentsAPIActorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		APIKeyID    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Attribution for a write made directly via the public API (outside of any session).

func (BetaManagedAgentsAPIActor) RawJSON

func (r BetaManagedAgentsAPIActor) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAPIActor) UnmarshalJSON

func (r *BetaManagedAgentsAPIActor) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAPIActorType

type BetaManagedAgentsAPIActorType string
const (
	BetaManagedAgentsAPIActorTypeAPIActor BetaManagedAgentsAPIActorType = "api_actor"
)

type BetaManagedAgentsActorUnion

type BetaManagedAgentsActorUnion struct {
	// This field is from variant [BetaManagedAgentsSessionActor].
	SessionID string `json:"session_id"`
	// Any of "session_actor", "api_actor", "user_actor".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsAPIActor].
	APIKeyID string `json:"api_key_id"`
	// This field is from variant [BetaManagedAgentsUserActor].
	UserID string `json:"user_id"`
	JSON   struct {
		SessionID respjson.Field
		Type      respjson.Field
		APIKeyID  respjson.Field
		UserID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsActorUnion contains all possible properties and values from BetaManagedAgentsSessionActor, BetaManagedAgentsAPIActor, BetaManagedAgentsUserActor.

Use the BetaManagedAgentsActorUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsActorUnion) AsAPIActor

func (BetaManagedAgentsActorUnion) AsAny

func (u BetaManagedAgentsActorUnion) AsAny() anyBetaManagedAgentsActor

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsActorUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsSessionActor:
case Juglow.BetaManagedAgentsAPIActor:
case Juglow.BetaManagedAgentsUserActor:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsActorUnion) AsSessionActor

func (BetaManagedAgentsActorUnion) AsUserActor

func (BetaManagedAgentsActorUnion) RawJSON

func (u BetaManagedAgentsActorUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsActorUnion) UnmarshalJSON

func (r *BetaManagedAgentsActorUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAdvisor

type BetaManagedAgentsAdvisor struct {
	// The advisor model id.
	Model string `json:"model" api:"required"`
	// Any of "advisor".
	Type BetaManagedAgentsAdvisorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Model       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Platform advisor roster entry: a model the session's primary thread may consult mid-turn.

func (BetaManagedAgentsAdvisor) RawJSON

func (r BetaManagedAgentsAdvisor) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAdvisor) UnmarshalJSON

func (r *BetaManagedAgentsAdvisor) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAdvisorParams

type BetaManagedAgentsAdvisorParams struct {
	// A haijun model id. The model must be permitted as an advisor for this agent's
	// model — see the sessions/threads/advisor spec.
	Model string `json:"model" api:"required"`
	// Any of "advisor".
	Type BetaManagedAgentsAdvisorParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Platform advisor roster entry: a model the session's primary thread may consult mid-turn. At most one per roster; the entry occupies the roster name `Juglow.advisor`.

The properties Model, Type are required.

func (BetaManagedAgentsAdvisorParams) MarshalJSON

func (r BetaManagedAgentsAdvisorParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsAdvisorParams) UnmarshalJSON

func (r *BetaManagedAgentsAdvisorParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAdvisorParamsType

type BetaManagedAgentsAdvisorParamsType string
const (
	BetaManagedAgentsAdvisorParamsTypeAdvisor BetaManagedAgentsAdvisorParamsType = "advisor"
)

type BetaManagedAgentsAdvisorType

type BetaManagedAgentsAdvisorType string
const (
	BetaManagedAgentsAdvisorTypeAdvisor BetaManagedAgentsAdvisorType = "advisor"
)

type BetaManagedAgentsAgent

type BetaManagedAgentsAgent struct {
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	CreatedAt   time.Time                                 `json:"created_at" api:"required" format:"date-time"`
	Description string                                    `json:"description" api:"required"`
	MCPServers  []BetaManagedAgentsMCPServerURLDefinition `json:"mcp_servers" api:"required"`
	Metadata    map[string]string                         `json:"metadata" api:"required"`
	// Model identifier and configuration.
	Model BetaManagedAgentsModelConfig `json:"model" api:"required"`
	// Resolved coordinator topology with a concrete agent roster.
	Multiagent BetaManagedAgentsMultiagent        `json:"multiagent" api:"required"`
	Name       string                             `json:"name" api:"required"`
	Tracks     []BetaManagedAgentsAgentTrackUnion `json:"tracks" api:"required"`
	System     string                             `json:"system" api:"required"`
	Tools      []BetaManagedAgentsAgentToolUnion  `json:"tools" api:"required"`
	// Any of "agent".
	Type BetaManagedAgentsAgentType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The agent's current version. Starts at 1 and increments when the agent is
	// modified.
	Version int64 `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ArchivedAt  respjson.Field
		CreatedAt   respjson.Field
		Description respjson.Field
		MCPServers  respjson.Field
		Metadata    respjson.Field
		Model       respjson.Field
		Multiagent  respjson.Field
		Name        respjson.Field
		Tracks      respjson.Field
		System      respjson.Field
		Tools       respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Managed Agents `agent`.

func (BetaManagedAgentsAgent) RawJSON

func (r BetaManagedAgentsAgent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgent) UnmarshalJSON

func (r *BetaManagedAgentsAgent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentArchivedDeploymentPausedReasonError

type BetaManagedAgentsAgentArchivedDeploymentPausedReasonError struct {
	// Any of "agent_archived_error".
	Type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's agent was archived.

func (BetaManagedAgentsAgentArchivedDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentArchivedDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType

type BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorTypeAgentArchivedError BetaManagedAgentsAgentArchivedDeploymentPausedReasonErrorType = "agent_archived_error"
)

type BetaManagedAgentsAgentArchivedRunError

type BetaManagedAgentsAgentArchivedRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "agent_archived_error".
	Type BetaManagedAgentsAgentArchivedRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's agent was archived.

func (BetaManagedAgentsAgentArchivedRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentArchivedRunError) UnmarshalJSON

func (r *BetaManagedAgentsAgentArchivedRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentArchivedRunErrorType

type BetaManagedAgentsAgentArchivedRunErrorType string
const (
	BetaManagedAgentsAgentArchivedRunErrorTypeAgentArchivedError BetaManagedAgentsAgentArchivedRunErrorType = "agent_archived_error"
)

type BetaManagedAgentsAgentCustomToolUseEvent

type BetaManagedAgentsAgentCustomToolUseEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Input parameters for the tool call.
	Input map[string]any `json:"input" api:"required"`
	// Name of the custom tool being called.
	Name string `json:"name" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "agent.custom_tool_use".
	Type BetaManagedAgentsAgentCustomToolUseEventType `json:"type" api:"required"`
	// When set, this event was cross-posted from a subagent's thread to surface its
	// custom tool use on the primary thread's stream. Empty on the thread's own
	// events. Echo this on a `user.custom_tool_result` event to route the result back.
	SessionThreadID string `json:"session_thread_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Input           respjson.Field
		Name            respjson.Field
		ProcessedAt     respjson.Field
		Type            respjson.Field
		SessionThreadID respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event emitted when the agent calls a custom tool. The session goes idle until the client sends a `user.custom_tool_result` event with the result.

func (BetaManagedAgentsAgentCustomToolUseEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentCustomToolUseEvent) UnmarshalJSON

func (r *BetaManagedAgentsAgentCustomToolUseEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentCustomToolUseEventType

type BetaManagedAgentsAgentCustomToolUseEventType string
const (
	BetaManagedAgentsAgentCustomToolUseEventTypeAgentCustomToolUse BetaManagedAgentsAgentCustomToolUseEventType = "agent.custom_tool_use"
)

type BetaManagedAgentsAgentMCPToolResultEvent

type BetaManagedAgentsAgentMCPToolResultEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// The id of the `agent.mcp_tool_use` event this result corresponds to.
	MCPToolUseID string `json:"mcp_tool_use_id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "agent.mcp_tool_result".
	Type BetaManagedAgentsAgentMCPToolResultEventType `json:"type" api:"required"`
	// The result content returned by the tool.
	Content []BetaManagedAgentsAgentMCPToolResultEventContentUnion `json:"content"`
	// Whether the tool execution resulted in an error.
	IsError bool `json:"is_error" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		MCPToolUseID respjson.Field
		ProcessedAt  respjson.Field
		Type         respjson.Field
		Content      respjson.Field
		IsError      respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event representing the result of an MCP tool execution.

func (BetaManagedAgentsAgentMCPToolResultEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentMCPToolResultEvent) UnmarshalJSON

func (r *BetaManagedAgentsAgentMCPToolResultEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentMCPToolResultEventContentUnion

type BetaManagedAgentsAgentMCPToolResultEventContentUnion struct {
	// This field is from variant [BetaManagedAgentsTextBlock].
	Text string `json:"text"`
	// Any of "text", "image", "document", "search_result".
	Type string `json:"type"`
	// This field is a union of [BetaManagedAgentsImageBlockSourceUnion],
	// [BetaManagedAgentsDocumentBlockSourceUnion], [string]
	Source BetaManagedAgentsAgentMCPToolResultEventContentUnionSource `json:"source"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Context string `json:"context"`
	Title   string `json:"title"`
	// This field is from variant [BetaManagedAgentsSearchResultBlock].
	Citations BetaManagedAgentsSearchResultCitations `json:"citations"`
	// This field is from variant [BetaManagedAgentsSearchResultBlock].
	Content []BetaManagedAgentsSearchResultContent `json:"content"`
	JSON    struct {
		Text      respjson.Field
		Type      respjson.Field
		Source    respjson.Field
		Context   respjson.Field
		Title     respjson.Field
		Citations respjson.Field
		Content   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentMCPToolResultEventContentUnion contains all possible properties and values from BetaManagedAgentsTextBlock, BetaManagedAgentsImageBlock, BetaManagedAgentsDocumentBlock, BetaManagedAgentsSearchResultBlock.

Use the BetaManagedAgentsAgentMCPToolResultEventContentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsAgentMCPToolResultEventContentUnion) AsAny

func (u BetaManagedAgentsAgentMCPToolResultEventContentUnion) AsAny() anyBetaManagedAgentsAgentMCPToolResultEventContent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsAgentMCPToolResultEventContentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTextBlock:
case Juglow.BetaManagedAgentsImageBlock:
case Juglow.BetaManagedAgentsDocumentBlock:
case Juglow.BetaManagedAgentsSearchResultBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsAgentMCPToolResultEventContentUnion) AsDocument

func (BetaManagedAgentsAgentMCPToolResultEventContentUnion) AsImage

func (BetaManagedAgentsAgentMCPToolResultEventContentUnion) AsSearchResult

func (BetaManagedAgentsAgentMCPToolResultEventContentUnion) AsText

func (BetaManagedAgentsAgentMCPToolResultEventContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentMCPToolResultEventContentUnion) UnmarshalJSON

type BetaManagedAgentsAgentMCPToolResultEventContentUnionSource

type BetaManagedAgentsAgentMCPToolResultEventContentUnionSource struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString  string `json:",inline"`
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	FileID    string `json:"file_id"`
	JSON      struct {
		OfString  respjson.Field
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentMCPToolResultEventContentUnionSource is an implicit subunion of BetaManagedAgentsAgentMCPToolResultEventContentUnion. BetaManagedAgentsAgentMCPToolResultEventContentUnionSource provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsAgentMCPToolResultEventContentUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString]

func (*BetaManagedAgentsAgentMCPToolResultEventContentUnionSource) UnmarshalJSON

type BetaManagedAgentsAgentMCPToolResultEventType

type BetaManagedAgentsAgentMCPToolResultEventType string
const (
	BetaManagedAgentsAgentMCPToolResultEventTypeAgentMCPToolResult BetaManagedAgentsAgentMCPToolResultEventType = "agent.mcp_tool_result"
)

type BetaManagedAgentsAgentMCPToolUseEvent

type BetaManagedAgentsAgentMCPToolUseEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Input parameters for the tool call.
	Input map[string]any `json:"input" api:"required"`
	// Name of the MCP server providing the tool.
	MCPServerName string `json:"mcp_server_name" api:"required"`
	// Name of the MCP tool being used.
	Name string `json:"name" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "agent.mcp_tool_use".
	Type BetaManagedAgentsAgentMCPToolUseEventType `json:"type" api:"required"`
	// AgentEvaluatedPermission enum
	//
	// Any of "allow", "ask", "deny".
	EvaluatedPermission BetaManagedAgentsAgentMCPToolUseEventEvaluatedPermission `json:"evaluated_permission"`
	// When set, this event was cross-posted from a subagent's thread to surface its
	// permission request on the primary thread's stream. Empty on the thread's own
	// events. Echo this on a `user.tool_confirmation` event to route the approval
	// back.
	SessionThreadID string `json:"session_thread_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		Input               respjson.Field
		MCPServerName       respjson.Field
		Name                respjson.Field
		ProcessedAt         respjson.Field
		Type                respjson.Field
		EvaluatedPermission respjson.Field
		SessionThreadID     respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event emitted when the agent invokes a tool provided by an MCP server.

func (BetaManagedAgentsAgentMCPToolUseEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentMCPToolUseEvent) UnmarshalJSON

func (r *BetaManagedAgentsAgentMCPToolUseEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentMCPToolUseEventEvaluatedPermission

type BetaManagedAgentsAgentMCPToolUseEventEvaluatedPermission string

AgentEvaluatedPermission enum

const (
	BetaManagedAgentsAgentMCPToolUseEventEvaluatedPermissionAllow BetaManagedAgentsAgentMCPToolUseEventEvaluatedPermission = "allow"
	BetaManagedAgentsAgentMCPToolUseEventEvaluatedPermissionAsk   BetaManagedAgentsAgentMCPToolUseEventEvaluatedPermission = "ask"
	BetaManagedAgentsAgentMCPToolUseEventEvaluatedPermissionDeny  BetaManagedAgentsAgentMCPToolUseEventEvaluatedPermission = "deny"
)

type BetaManagedAgentsAgentMCPToolUseEventType

type BetaManagedAgentsAgentMCPToolUseEventType string
const (
	BetaManagedAgentsAgentMCPToolUseEventTypeAgentMCPToolUse BetaManagedAgentsAgentMCPToolUseEventType = "agent.mcp_tool_use"
)

type BetaManagedAgentsAgentMessageEvent

type BetaManagedAgentsAgentMessageEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Array of text blocks comprising the agent response.
	Content []BetaManagedAgentsAgentMessageEventContentUnion `json:"content" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "agent.message".
	Type BetaManagedAgentsAgentMessageEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Content     respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An agent response event in the session conversation.

func (BetaManagedAgentsAgentMessageEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentMessageEvent) UnmarshalJSON

func (r *BetaManagedAgentsAgentMessageEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentMessageEventContentUnion

type BetaManagedAgentsAgentMessageEventContentUnion struct {
	// This field is from variant [BetaManagedAgentsTextBlock].
	Text string `json:"text"`
	// Any of "text", "redacted".
	Type string `json:"type"`
	JSON struct {
		Text respjson.Field
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentMessageEventContentUnion contains all possible properties and values from BetaManagedAgentsTextBlock, BetaManagedAgentsRedactedBlock.

Use the BetaManagedAgentsAgentMessageEventContentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsAgentMessageEventContentUnion) AsAny

func (u BetaManagedAgentsAgentMessageEventContentUnion) AsAny() anyBetaManagedAgentsAgentMessageEventContent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsAgentMessageEventContentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTextBlock:
case Juglow.BetaManagedAgentsRedactedBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsAgentMessageEventContentUnion) AsRedacted

func (BetaManagedAgentsAgentMessageEventContentUnion) AsText

func (BetaManagedAgentsAgentMessageEventContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentMessageEventContentUnion) UnmarshalJSON

type BetaManagedAgentsAgentMessageEventType

type BetaManagedAgentsAgentMessageEventType string
const (
	BetaManagedAgentsAgentMessageEventTypeAgentMessage BetaManagedAgentsAgentMessageEventType = "agent.message"
)

type BetaManagedAgentsAgentMessagePreview

type BetaManagedAgentsAgentMessagePreview struct {
	// The id the buffered agent.message will carry if it is emitted. Matches the
	// event_id on this preview's event_delta events.
	ID string `json:"id" api:"required"`
	// Any of "agent.message".
	Type BetaManagedAgentsAgentMessagePreviewType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaManagedAgentsAgentMessagePreview) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentMessagePreview) UnmarshalJSON

func (r *BetaManagedAgentsAgentMessagePreview) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentMessagePreviewType

type BetaManagedAgentsAgentMessagePreviewType string
const (
	BetaManagedAgentsAgentMessagePreviewTypeAgentMessage BetaManagedAgentsAgentMessagePreviewType = "agent.message"
)

type BetaManagedAgentsAgentParams

type BetaManagedAgentsAgentParams struct {
	// The `agent` ID.
	ID string `json:"id" api:"required"`
	// Any of "agent".
	Type BetaManagedAgentsAgentParamsType `json:"type,omitzero" api:"required"`
	// The specific `agent` version to use. Omit to use the latest version. Must be at
	// least 1 if specified.
	Version param.Opt[int64] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

Specification for an Agent. Provide a specific `version` or use the short-form `agent="agent_id"` for the most recent version

The properties ID, Type are required.

func (BetaManagedAgentsAgentParams) MarshalJSON

func (r BetaManagedAgentsAgentParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsAgentParams) UnmarshalJSON

func (r *BetaManagedAgentsAgentParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentParamsType

type BetaManagedAgentsAgentParamsType string
const (
	BetaManagedAgentsAgentParamsTypeAgent BetaManagedAgentsAgentParamsType = "agent"
)

type BetaManagedAgentsAgentReference

type BetaManagedAgentsAgentReference struct {
	ID string `json:"id" api:"required"`
	// Any of "agent".
	Type    BetaManagedAgentsAgentReferenceType `json:"type" api:"required"`
	Version int64                               `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A resolved agent reference with a concrete version.

func (BetaManagedAgentsAgentReference) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentReference) UnmarshalJSON

func (r *BetaManagedAgentsAgentReference) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentReferenceType

type BetaManagedAgentsAgentReferenceType string
const (
	BetaManagedAgentsAgentReferenceTypeAgent BetaManagedAgentsAgentReferenceType = "agent"
)

type BetaManagedAgentsAgentThinkingEvent

type BetaManagedAgentsAgentThinkingEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "agent.thinking".
	Type BetaManagedAgentsAgentThinkingEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates the agent is making forward progress via extended thinking. A progress signal, not a content carrier.

func (BetaManagedAgentsAgentThinkingEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentThinkingEvent) UnmarshalJSON

func (r *BetaManagedAgentsAgentThinkingEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentThinkingEventType

type BetaManagedAgentsAgentThinkingEventType string
const (
	BetaManagedAgentsAgentThinkingEventTypeAgentThinking BetaManagedAgentsAgentThinkingEventType = "agent.thinking"
)

type BetaManagedAgentsAgentThinkingPreview

type BetaManagedAgentsAgentThinkingPreview struct {
	// The id the buffered agent.thinking will carry if it is emitted. Start-only — no
	// event_delta events follow.
	ID string `json:"id" api:"required"`
	// Any of "agent.thinking".
	Type BetaManagedAgentsAgentThinkingPreviewType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaManagedAgentsAgentThinkingPreview) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentThinkingPreview) UnmarshalJSON

func (r *BetaManagedAgentsAgentThinkingPreview) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentThinkingPreviewType

type BetaManagedAgentsAgentThinkingPreviewType string
const (
	BetaManagedAgentsAgentThinkingPreviewTypeAgentThinking BetaManagedAgentsAgentThinkingPreviewType = "agent.thinking"
)

type BetaManagedAgentsAgentThreadContextCompactedEvent

type BetaManagedAgentsAgentThreadContextCompactedEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "agent.thread_context_compacted".
	Type BetaManagedAgentsAgentThreadContextCompactedEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates that context compaction (summarization) occurred during the session.

func (BetaManagedAgentsAgentThreadContextCompactedEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentThreadContextCompactedEvent) UnmarshalJSON

type BetaManagedAgentsAgentThreadContextCompactedEventType

type BetaManagedAgentsAgentThreadContextCompactedEventType string
const (
	BetaManagedAgentsAgentThreadContextCompactedEventTypeAgentThreadContextCompacted BetaManagedAgentsAgentThreadContextCompactedEventType = "agent.thread_context_compacted"
)

type BetaManagedAgentsAgentThreadMessageReceivedEvent

type BetaManagedAgentsAgentThreadMessageReceivedEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Message content blocks.
	Content []BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion `json:"content" api:"required"`
	// Public `sthr_` ID of the thread that sent the message.
	FromSessionThreadID string `json:"from_session_thread_id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "agent.thread_message_received".
	Type BetaManagedAgentsAgentThreadMessageReceivedEventType `json:"type" api:"required"`
	// Name of the callable agent this message came from. Absent when received from the
	// primary agent.
	FromAgentName string `json:"from_agent_name" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		Content             respjson.Field
		FromSessionThreadID respjson.Field
		ProcessedAt         respjson.Field
		Type                respjson.Field
		FromAgentName       respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Delivery event written to the target thread's input stream when an agent-to-agent message arrives.

func (BetaManagedAgentsAgentThreadMessageReceivedEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentThreadMessageReceivedEvent) UnmarshalJSON

type BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion

type BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion struct {
	// This field is from variant [BetaManagedAgentsTextBlock].
	Text string `json:"text"`
	// Any of "text", "image", "document", "redacted".
	Type string `json:"type"`
	// This field is a union of [BetaManagedAgentsImageBlockSourceUnion],
	// [BetaManagedAgentsDocumentBlockSourceUnion]
	Source BetaManagedAgentsAgentThreadMessageReceivedEventContentUnionSource `json:"source"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Context string `json:"context"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Title string `json:"title"`
	JSON  struct {
		Text    respjson.Field
		Type    respjson.Field
		Source  respjson.Field
		Context respjson.Field
		Title   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion contains all possible properties and values from BetaManagedAgentsTextBlock, BetaManagedAgentsImageBlock, BetaManagedAgentsDocumentBlock, BetaManagedAgentsRedactedBlock.

Use the BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion) AsAny

func (u BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion) AsAny() anyBetaManagedAgentsAgentThreadMessageReceivedEventContent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTextBlock:
case Juglow.BetaManagedAgentsImageBlock:
case Juglow.BetaManagedAgentsDocumentBlock:
case Juglow.BetaManagedAgentsRedactedBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion) AsDocument

func (BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion) AsImage

func (BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion) AsRedacted

func (BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion) AsText

func (BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion) UnmarshalJSON

type BetaManagedAgentsAgentThreadMessageReceivedEventContentUnionSource

type BetaManagedAgentsAgentThreadMessageReceivedEventContentUnionSource struct {
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	FileID    string `json:"file_id"`
	JSON      struct {
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentThreadMessageReceivedEventContentUnionSource is an implicit subunion of BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion. BetaManagedAgentsAgentThreadMessageReceivedEventContentUnionSource provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion.

func (*BetaManagedAgentsAgentThreadMessageReceivedEventContentUnionSource) UnmarshalJSON

type BetaManagedAgentsAgentThreadMessageReceivedEventType

type BetaManagedAgentsAgentThreadMessageReceivedEventType string
const (
	BetaManagedAgentsAgentThreadMessageReceivedEventTypeAgentThreadMessageReceived BetaManagedAgentsAgentThreadMessageReceivedEventType = "agent.thread_message_received"
)

type BetaManagedAgentsAgentThreadMessageSentEvent

type BetaManagedAgentsAgentThreadMessageSentEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Message content blocks.
	Content []BetaManagedAgentsAgentThreadMessageSentEventContentUnion `json:"content" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Public `sthr_` ID of the thread the message was sent to.
	ToSessionThreadID string `json:"to_session_thread_id" api:"required"`
	// Any of "agent.thread_message_sent".
	Type BetaManagedAgentsAgentThreadMessageSentEventType `json:"type" api:"required"`
	// Name of the callable agent this message was sent to. Absent when sent to the
	// primary agent.
	ToAgentName string `json:"to_agent_name" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		Content           respjson.Field
		ProcessedAt       respjson.Field
		ToSessionThreadID respjson.Field
		Type              respjson.Field
		ToAgentName       respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Observability event emitted to the sender's output stream when an agent-to-agent message is sent.

func (BetaManagedAgentsAgentThreadMessageSentEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentThreadMessageSentEvent) UnmarshalJSON

func (r *BetaManagedAgentsAgentThreadMessageSentEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentThreadMessageSentEventContentUnion

type BetaManagedAgentsAgentThreadMessageSentEventContentUnion struct {
	// This field is from variant [BetaManagedAgentsTextBlock].
	Text string `json:"text"`
	// Any of "text", "image", "document", "redacted".
	Type string `json:"type"`
	// This field is a union of [BetaManagedAgentsImageBlockSourceUnion],
	// [BetaManagedAgentsDocumentBlockSourceUnion]
	Source BetaManagedAgentsAgentThreadMessageSentEventContentUnionSource `json:"source"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Context string `json:"context"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Title string `json:"title"`
	JSON  struct {
		Text    respjson.Field
		Type    respjson.Field
		Source  respjson.Field
		Context respjson.Field
		Title   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentThreadMessageSentEventContentUnion contains all possible properties and values from BetaManagedAgentsTextBlock, BetaManagedAgentsImageBlock, BetaManagedAgentsDocumentBlock, BetaManagedAgentsRedactedBlock.

Use the BetaManagedAgentsAgentThreadMessageSentEventContentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsAgentThreadMessageSentEventContentUnion) AsAny

func (u BetaManagedAgentsAgentThreadMessageSentEventContentUnion) AsAny() anyBetaManagedAgentsAgentThreadMessageSentEventContent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsAgentThreadMessageSentEventContentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTextBlock:
case Juglow.BetaManagedAgentsImageBlock:
case Juglow.BetaManagedAgentsDocumentBlock:
case Juglow.BetaManagedAgentsRedactedBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsAgentThreadMessageSentEventContentUnion) AsDocument

func (BetaManagedAgentsAgentThreadMessageSentEventContentUnion) AsImage

func (BetaManagedAgentsAgentThreadMessageSentEventContentUnion) AsRedacted

func (BetaManagedAgentsAgentThreadMessageSentEventContentUnion) AsText

func (BetaManagedAgentsAgentThreadMessageSentEventContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentThreadMessageSentEventContentUnion) UnmarshalJSON

type BetaManagedAgentsAgentThreadMessageSentEventContentUnionSource

type BetaManagedAgentsAgentThreadMessageSentEventContentUnionSource struct {
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	FileID    string `json:"file_id"`
	JSON      struct {
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentThreadMessageSentEventContentUnionSource is an implicit subunion of BetaManagedAgentsAgentThreadMessageSentEventContentUnion. BetaManagedAgentsAgentThreadMessageSentEventContentUnionSource provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsAgentThreadMessageSentEventContentUnion.

func (*BetaManagedAgentsAgentThreadMessageSentEventContentUnionSource) UnmarshalJSON

type BetaManagedAgentsAgentThreadMessageSentEventType

type BetaManagedAgentsAgentThreadMessageSentEventType string
const (
	BetaManagedAgentsAgentThreadMessageSentEventTypeAgentThreadMessageSent BetaManagedAgentsAgentThreadMessageSentEventType = "agent.thread_message_sent"
)

type BetaManagedAgentsAgentToolConfig

type BetaManagedAgentsAgentToolConfig struct {
	Enabled bool `json:"enabled" api:"required"`
	// Built-in agent tool identifier.
	//
	// Any of "bash", "edit", "read", "write", "glob", "grep", "web_fetch",
	// "web_search".
	Name BetaManagedAgentsAgentToolConfigName `json:"name" api:"required"`
	// Permission policy for tool execution.
	PermissionPolicy BetaManagedAgentsAgentToolConfigPermissionPolicyUnion `json:"permission_policy" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled          respjson.Field
		Name             respjson.Field
		PermissionPolicy respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for a specific agent tool.

func (BetaManagedAgentsAgentToolConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolConfig) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolConfig) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolConfigName

type BetaManagedAgentsAgentToolConfigName string

Built-in agent tool identifier.

const (
	BetaManagedAgentsAgentToolConfigNameBash      BetaManagedAgentsAgentToolConfigName = "bash"
	BetaManagedAgentsAgentToolConfigNameEdit      BetaManagedAgentsAgentToolConfigName = "edit"
	BetaManagedAgentsAgentToolConfigNameRead      BetaManagedAgentsAgentToolConfigName = "read"
	BetaManagedAgentsAgentToolConfigNameWrite     BetaManagedAgentsAgentToolConfigName = "write"
	BetaManagedAgentsAgentToolConfigNameGlob      BetaManagedAgentsAgentToolConfigName = "glob"
	BetaManagedAgentsAgentToolConfigNameGrep      BetaManagedAgentsAgentToolConfigName = "grep"
	BetaManagedAgentsAgentToolConfigNameWebFetch  BetaManagedAgentsAgentToolConfigName = "web_fetch"
	BetaManagedAgentsAgentToolConfigNameWebSearch BetaManagedAgentsAgentToolConfigName = "web_search"
)

type BetaManagedAgentsAgentToolConfigParams

type BetaManagedAgentsAgentToolConfigParams struct {
	// Built-in agent tool identifier.
	//
	// Any of "bash", "edit", "read", "write", "glob", "grep", "web_fetch",
	// "web_search".
	Name BetaManagedAgentsAgentToolConfigParamsName `json:"name,omitzero" api:"required"`
	// Whether this tool is enabled and available to haijun. Overrides the
	// default_config setting.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Permission policy for tool execution.
	PermissionPolicy BetaManagedAgentsAgentToolConfigParamsPermissionPolicyUnion `json:"permission_policy,omitzero"`
	// contains filtered or unexported fields
}

Configuration override for a specific tool within a toolset.

The property Name is required.

func (BetaManagedAgentsAgentToolConfigParams) MarshalJSON

func (r BetaManagedAgentsAgentToolConfigParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsAgentToolConfigParams) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolConfigParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolConfigParamsName

type BetaManagedAgentsAgentToolConfigParamsName string

Built-in agent tool identifier.

const (
	BetaManagedAgentsAgentToolConfigParamsNameBash      BetaManagedAgentsAgentToolConfigParamsName = "bash"
	BetaManagedAgentsAgentToolConfigParamsNameEdit      BetaManagedAgentsAgentToolConfigParamsName = "edit"
	BetaManagedAgentsAgentToolConfigParamsNameRead      BetaManagedAgentsAgentToolConfigParamsName = "read"
	BetaManagedAgentsAgentToolConfigParamsNameWrite     BetaManagedAgentsAgentToolConfigParamsName = "write"
	BetaManagedAgentsAgentToolConfigParamsNameGlob      BetaManagedAgentsAgentToolConfigParamsName = "glob"
	BetaManagedAgentsAgentToolConfigParamsNameGrep      BetaManagedAgentsAgentToolConfigParamsName = "grep"
	BetaManagedAgentsAgentToolConfigParamsNameWebFetch  BetaManagedAgentsAgentToolConfigParamsName = "web_fetch"
	BetaManagedAgentsAgentToolConfigParamsNameWebSearch BetaManagedAgentsAgentToolConfigParamsName = "web_search"
)

type BetaManagedAgentsAgentToolConfigParamsPermissionPolicyUnion

type BetaManagedAgentsAgentToolConfigParamsPermissionPolicyUnion struct {
	OfAlwaysAllow *BetaManagedAgentsAlwaysAllowPolicyParam `json:",omitzero,inline"`
	OfAlwaysAsk   *BetaManagedAgentsAlwaysAskPolicyParam   `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 (BetaManagedAgentsAgentToolConfigParamsPermissionPolicyUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsAgentToolConfigParamsPermissionPolicyUnion) MarshalJSON

func (*BetaManagedAgentsAgentToolConfigParamsPermissionPolicyUnion) UnmarshalJSON

type BetaManagedAgentsAgentToolConfigPermissionPolicyUnion

type BetaManagedAgentsAgentToolConfigPermissionPolicyUnion struct {
	// Any of "always_allow", "always_ask".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentToolConfigPermissionPolicyUnion contains all possible properties and values from BetaManagedAgentsAlwaysAllowPolicy, BetaManagedAgentsAlwaysAskPolicy.

Use the BetaManagedAgentsAgentToolConfigPermissionPolicyUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsAgentToolConfigPermissionPolicyUnion) AsAlwaysAllow

func (BetaManagedAgentsAgentToolConfigPermissionPolicyUnion) AsAlwaysAsk

func (BetaManagedAgentsAgentToolConfigPermissionPolicyUnion) AsAny

func (u BetaManagedAgentsAgentToolConfigPermissionPolicyUnion) AsAny() anyBetaManagedAgentsAgentToolConfigPermissionPolicy

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsAgentToolConfigPermissionPolicyUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsAlwaysAllowPolicy:
case Juglow.BetaManagedAgentsAlwaysAskPolicy:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsAgentToolConfigPermissionPolicyUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolConfigPermissionPolicyUnion) UnmarshalJSON

type BetaManagedAgentsAgentToolResultEvent

type BetaManagedAgentsAgentToolResultEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// The id of the `agent.tool_use` event this result corresponds to.
	ToolUseID string `json:"tool_use_id" api:"required"`
	// Any of "agent.tool_result".
	Type BetaManagedAgentsAgentToolResultEventType `json:"type" api:"required"`
	// The result content returned by the tool.
	Content []BetaManagedAgentsAgentToolResultEventContentUnion `json:"content"`
	// Whether the tool execution resulted in an error.
	IsError bool `json:"is_error" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		Content     respjson.Field
		IsError     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event representing the result of an agent tool execution.

func (BetaManagedAgentsAgentToolResultEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolResultEvent) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolResultEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolResultEventContentUnion

type BetaManagedAgentsAgentToolResultEventContentUnion struct {
	// This field is from variant [BetaManagedAgentsTextBlock].
	Text string `json:"text"`
	// Any of "text", "image", "document", "search_result".
	Type string `json:"type"`
	// This field is a union of [BetaManagedAgentsImageBlockSourceUnion],
	// [BetaManagedAgentsDocumentBlockSourceUnion], [string]
	Source BetaManagedAgentsAgentToolResultEventContentUnionSource `json:"source"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Context string `json:"context"`
	Title   string `json:"title"`
	// This field is from variant [BetaManagedAgentsSearchResultBlock].
	Citations BetaManagedAgentsSearchResultCitations `json:"citations"`
	// This field is from variant [BetaManagedAgentsSearchResultBlock].
	Content []BetaManagedAgentsSearchResultContent `json:"content"`
	JSON    struct {
		Text      respjson.Field
		Type      respjson.Field
		Source    respjson.Field
		Context   respjson.Field
		Title     respjson.Field
		Citations respjson.Field
		Content   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentToolResultEventContentUnion contains all possible properties and values from BetaManagedAgentsTextBlock, BetaManagedAgentsImageBlock, BetaManagedAgentsDocumentBlock, BetaManagedAgentsSearchResultBlock.

Use the BetaManagedAgentsAgentToolResultEventContentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsAgentToolResultEventContentUnion) AsAny

func (u BetaManagedAgentsAgentToolResultEventContentUnion) AsAny() anyBetaManagedAgentsAgentToolResultEventContent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsAgentToolResultEventContentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTextBlock:
case Juglow.BetaManagedAgentsImageBlock:
case Juglow.BetaManagedAgentsDocumentBlock:
case Juglow.BetaManagedAgentsSearchResultBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsAgentToolResultEventContentUnion) AsDocument

func (BetaManagedAgentsAgentToolResultEventContentUnion) AsImage

func (BetaManagedAgentsAgentToolResultEventContentUnion) AsSearchResult

func (BetaManagedAgentsAgentToolResultEventContentUnion) AsText

func (BetaManagedAgentsAgentToolResultEventContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolResultEventContentUnion) UnmarshalJSON

type BetaManagedAgentsAgentToolResultEventContentUnionSource

type BetaManagedAgentsAgentToolResultEventContentUnionSource struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString  string `json:",inline"`
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	FileID    string `json:"file_id"`
	JSON      struct {
		OfString  respjson.Field
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentToolResultEventContentUnionSource is an implicit subunion of BetaManagedAgentsAgentToolResultEventContentUnion. BetaManagedAgentsAgentToolResultEventContentUnionSource provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsAgentToolResultEventContentUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString]

func (*BetaManagedAgentsAgentToolResultEventContentUnionSource) UnmarshalJSON

type BetaManagedAgentsAgentToolResultEventType

type BetaManagedAgentsAgentToolResultEventType string
const (
	BetaManagedAgentsAgentToolResultEventTypeAgentToolResult BetaManagedAgentsAgentToolResultEventType = "agent.tool_result"
)

type BetaManagedAgentsAgentToolUnion

type BetaManagedAgentsAgentToolUnion struct {
	// This field is a union of [[]BetaManagedAgentsAgentToolConfig],
	// [[]BetaManagedAgentsMCPToolConfig]
	Configs BetaManagedAgentsAgentToolUnionConfigs `json:"configs"`
	// This field is a union of [BetaManagedAgentsAgentToolsetDefaultConfig],
	// [BetaManagedAgentsMCPToolsetDefaultConfig]
	DefaultConfig BetaManagedAgentsAgentToolUnionDefaultConfig `json:"default_config"`
	// Any of "agent_toolset_20260401", "mcp_toolset", "custom".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsMCPToolset].
	MCPServerName string `json:"mcp_server_name"`
	// This field is from variant [BetaManagedAgentsCustomTool].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsCustomTool].
	InputSchema BetaManagedAgentsCustomToolInputSchema `json:"input_schema"`
	// This field is from variant [BetaManagedAgentsCustomTool].
	Name string `json:"name"`
	JSON struct {
		Configs       respjson.Field
		DefaultConfig respjson.Field
		Type          respjson.Field
		MCPServerName respjson.Field
		Description   respjson.Field
		InputSchema   respjson.Field
		Name          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentToolUnion contains all possible properties and values from BetaManagedAgentsAgentToolset20260401, BetaManagedAgentsMCPToolset, BetaManagedAgentsCustomTool.

Use the BetaManagedAgentsAgentToolUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsAgentToolUnion) AsAgentToolset20260401

func (BetaManagedAgentsAgentToolUnion) AsAny

func (u BetaManagedAgentsAgentToolUnion) AsAny() anyBetaManagedAgentsAgentTool

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsAgentToolUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsAgentToolset20260401:
case Juglow.BetaManagedAgentsMCPToolset:
case Juglow.BetaManagedAgentsCustomTool:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsAgentToolUnion) AsCustom

func (BetaManagedAgentsAgentToolUnion) AsMCPToolset

func (BetaManagedAgentsAgentToolUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolUnion) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolUnionConfigs

type BetaManagedAgentsAgentToolUnionConfigs struct {
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentToolConfig] instead of an object.
	OfBetaManagedAgentsAgentToolConfigArray []BetaManagedAgentsAgentToolConfig `json:",inline"`
	// This field will be present if the value is a [[]BetaManagedAgentsMCPToolConfig]
	// instead of an object.
	OfBetaManagedAgentsMCPToolConfigArray []BetaManagedAgentsMCPToolConfig `json:",inline"`
	JSON                                  struct {
		OfBetaManagedAgentsAgentToolConfigArray respjson.Field
		OfBetaManagedAgentsMCPToolConfigArray   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentToolUnionConfigs is an implicit subunion of BetaManagedAgentsAgentToolUnion. BetaManagedAgentsAgentToolUnionConfigs provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsAgentToolUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaManagedAgentsAgentToolConfigArray OfBetaManagedAgentsMCPToolConfigArray]

func (*BetaManagedAgentsAgentToolUnionConfigs) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolUnionConfigs) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolUnionDefaultConfig

type BetaManagedAgentsAgentToolUnionDefaultConfig struct {
	Enabled bool `json:"enabled"`
	// This field is a union of
	// [BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion],
	// [BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion]
	PermissionPolicy BetaManagedAgentsAgentToolUnionDefaultConfigPermissionPolicy `json:"permission_policy"`
	JSON             struct {
		Enabled          respjson.Field
		PermissionPolicy respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentToolUnionDefaultConfig is an implicit subunion of BetaManagedAgentsAgentToolUnion. BetaManagedAgentsAgentToolUnionDefaultConfig provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsAgentToolUnion.

func (*BetaManagedAgentsAgentToolUnionDefaultConfig) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolUnionDefaultConfig) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolUnionDefaultConfigPermissionPolicy

type BetaManagedAgentsAgentToolUnionDefaultConfigPermissionPolicy struct {
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentToolUnionDefaultConfigPermissionPolicy is an implicit subunion of BetaManagedAgentsAgentToolUnion. BetaManagedAgentsAgentToolUnionDefaultConfigPermissionPolicy provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsAgentToolUnion.

func (*BetaManagedAgentsAgentToolUnionDefaultConfigPermissionPolicy) UnmarshalJSON

type BetaManagedAgentsAgentToolUseEvent

type BetaManagedAgentsAgentToolUseEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Input parameters for the tool call.
	Input map[string]any `json:"input" api:"required"`
	// Name of the agent tool being used.
	Name string `json:"name" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "agent.tool_use".
	Type BetaManagedAgentsAgentToolUseEventType `json:"type" api:"required"`
	// AgentEvaluatedPermission enum
	//
	// Any of "allow", "ask", "deny".
	EvaluatedPermission BetaManagedAgentsAgentToolUseEventEvaluatedPermission `json:"evaluated_permission"`
	// When set, this event was cross-posted from a subagent's thread to surface its
	// permission request on the primary thread's stream. Empty on the thread's own
	// events. Echo this on a `user.tool_confirmation` event to route the approval
	// back.
	SessionThreadID string `json:"session_thread_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		Input               respjson.Field
		Name                respjson.Field
		ProcessedAt         respjson.Field
		Type                respjson.Field
		EvaluatedPermission respjson.Field
		SessionThreadID     respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event emitted when the agent invokes a built-in agent tool.

func (BetaManagedAgentsAgentToolUseEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolUseEvent) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolUseEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolUseEventEvaluatedPermission

type BetaManagedAgentsAgentToolUseEventEvaluatedPermission string

AgentEvaluatedPermission enum

const (
	BetaManagedAgentsAgentToolUseEventEvaluatedPermissionAllow BetaManagedAgentsAgentToolUseEventEvaluatedPermission = "allow"
	BetaManagedAgentsAgentToolUseEventEvaluatedPermissionAsk   BetaManagedAgentsAgentToolUseEventEvaluatedPermission = "ask"
	BetaManagedAgentsAgentToolUseEventEvaluatedPermissionDeny  BetaManagedAgentsAgentToolUseEventEvaluatedPermission = "deny"
)

type BetaManagedAgentsAgentToolUseEventType

type BetaManagedAgentsAgentToolUseEventType string
const (
	BetaManagedAgentsAgentToolUseEventTypeAgentToolUse BetaManagedAgentsAgentToolUseEventType = "agent.tool_use"
)

type BetaManagedAgentsAgentToolset20260401

type BetaManagedAgentsAgentToolset20260401 struct {
	Configs []BetaManagedAgentsAgentToolConfig `json:"configs" api:"required"`
	// Resolved default configuration for agent tools.
	DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfig `json:"default_config" api:"required"`
	// Any of "agent_toolset_20260401".
	Type BetaManagedAgentsAgentToolset20260401Type `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Configs       respjson.Field
		DefaultConfig respjson.Field
		Type          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaManagedAgentsAgentToolset20260401) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolset20260401) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolset20260401) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolset20260401BashInput

type BetaManagedAgentsAgentToolset20260401BashInput struct {
	// Shell command to execute. Omit only when `restart` is true.
	Command string `json:"command"`
	// When true, restart the persistent bash session instead of running a command.
	// Subsequent calls without `restart` will run against the fresh session.
	Restart bool `json:"restart"`
	// Per-call timeout in milliseconds. Defaults to the runner-wide tool timeout when
	// omitted or zero.
	TimeoutMs int64 `json:"timeout_ms"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Command     respjson.Field
		Restart     respjson.Field
		TimeoutMs   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Input payload for the `bash` tool of the `agent_toolset_20260401` toolset. All fields are optional; a normal invocation supplies `command`, while `restart=true` (with no `command`) reboots the runner-side bash session.

func (BetaManagedAgentsAgentToolset20260401BashInput) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolset20260401BashInput) UnmarshalJSON

type BetaManagedAgentsAgentToolset20260401EditInput

type BetaManagedAgentsAgentToolset20260401EditInput struct {
	// Path of the file to edit.
	FilePath string `json:"file_path" api:"required"`
	// Replacement text.
	NewString string `json:"new_string" api:"required"`
	// Substring to find and replace.
	OldString string `json:"old_string" api:"required"`
	// When true, replace every occurrence of `old_string` instead of requiring a
	// unique match.
	ReplaceAll bool `json:"replace_all"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FilePath    respjson.Field
		NewString   respjson.Field
		OldString   respjson.Field
		ReplaceAll  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Input payload for the `edit` tool. Performs a string replacement in the named file; by default `old_string` must occur exactly once.

func (BetaManagedAgentsAgentToolset20260401EditInput) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolset20260401EditInput) UnmarshalJSON

type BetaManagedAgentsAgentToolset20260401GlobInput

type BetaManagedAgentsAgentToolset20260401GlobInput struct {
	// Doublestar glob pattern (e.g. `**/*.go`). Absolute patterns are only permitted
	// when the runner is configured to allow them.
	Pattern string `json:"pattern" api:"required"`
	// Optional directory root to search under. Defaults to the runner's working
	// directory.
	Path string `json:"path"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Pattern     respjson.Field
		Path        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Input payload for the `glob` tool. Returns paths matching a doublestar glob pattern, newest first.

func (BetaManagedAgentsAgentToolset20260401GlobInput) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolset20260401GlobInput) UnmarshalJSON

type BetaManagedAgentsAgentToolset20260401GrepInput

type BetaManagedAgentsAgentToolset20260401GrepInput struct {
	// Regular expression to search for.
	Pattern string `json:"pattern" api:"required"`
	// Optional directory root to search under. Defaults to the runner's working
	// directory.
	Path string `json:"path"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Pattern     respjson.Field
		Path        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Input payload for the `grep` tool. Searches file contents for a regular expression, returning matching lines.

func (BetaManagedAgentsAgentToolset20260401GrepInput) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolset20260401GrepInput) UnmarshalJSON

type BetaManagedAgentsAgentToolset20260401Params

type BetaManagedAgentsAgentToolset20260401Params struct {
	// Any of "agent_toolset_20260401".
	Type BetaManagedAgentsAgentToolset20260401ParamsType `json:"type,omitzero" api:"required"`
	// Per-tool configuration overrides.
	Configs []BetaManagedAgentsAgentToolConfigParams `json:"configs,omitzero"`
	// Default configuration for all tools in a toolset.
	DefaultConfig BetaManagedAgentsAgentToolsetDefaultConfigParams `json:"default_config,omitzero"`
	// contains filtered or unexported fields
}

Configuration for built-in agent tools. Use this to enable or disable groups of tools available to the agent.

The property Type is required.

func (BetaManagedAgentsAgentToolset20260401Params) MarshalJSON

func (r BetaManagedAgentsAgentToolset20260401Params) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsAgentToolset20260401Params) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolset20260401Params) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolset20260401ParamsType

type BetaManagedAgentsAgentToolset20260401ParamsType string
const (
	BetaManagedAgentsAgentToolset20260401ParamsTypeAgentToolset20260401 BetaManagedAgentsAgentToolset20260401ParamsType = "agent_toolset_20260401"
)

type BetaManagedAgentsAgentToolset20260401ReadInput

type BetaManagedAgentsAgentToolset20260401ReadInput struct {
	// Path of the file to read.
	FilePath string `json:"file_path" api:"required"`
	// Optional `[start_line, end_line]` 1-indexed inclusive range. When omitted the
	// entire file is returned. `end_line` of 0 or negative means "to end of file".
	ViewRange []int64 `json:"view_range"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FilePath    respjson.Field
		ViewRange   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Input payload for the `read` tool. Reads file contents relative to the runner's working directory (or absolute when the runner permits).

func (BetaManagedAgentsAgentToolset20260401ReadInput) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolset20260401ReadInput) UnmarshalJSON

type BetaManagedAgentsAgentToolset20260401Type

type BetaManagedAgentsAgentToolset20260401Type string
const (
	BetaManagedAgentsAgentToolset20260401TypeAgentToolset20260401 BetaManagedAgentsAgentToolset20260401Type = "agent_toolset_20260401"
)

type BetaManagedAgentsAgentToolset20260401WriteInput

type BetaManagedAgentsAgentToolset20260401WriteInput struct {
	// Full file contents to write.
	Content string `json:"content" api:"required"`
	// Path of the file to write.
	FilePath string `json:"file_path" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		FilePath    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Input payload for the `write` tool. Writes (overwriting) the entire file contents.

func (BetaManagedAgentsAgentToolset20260401WriteInput) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolset20260401WriteInput) UnmarshalJSON

type BetaManagedAgentsAgentToolsetDefaultConfig

type BetaManagedAgentsAgentToolsetDefaultConfig struct {
	Enabled bool `json:"enabled" api:"required"`
	// Permission policy for tool execution.
	PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion `json:"permission_policy" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled          respjson.Field
		PermissionPolicy respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolved default configuration for agent tools.

func (BetaManagedAgentsAgentToolsetDefaultConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolsetDefaultConfig) UnmarshalJSON

func (r *BetaManagedAgentsAgentToolsetDefaultConfig) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentToolsetDefaultConfigParams

type BetaManagedAgentsAgentToolsetDefaultConfigParams struct {
	// Whether tools are enabled and available to haijun by default. Defaults to true
	// if not specified.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Permission policy for tool execution.
	PermissionPolicy BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion `json:"permission_policy,omitzero"`
	// contains filtered or unexported fields
}

Default configuration for all tools in a toolset.

func (BetaManagedAgentsAgentToolsetDefaultConfigParams) MarshalJSON

func (r BetaManagedAgentsAgentToolsetDefaultConfigParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsAgentToolsetDefaultConfigParams) UnmarshalJSON

type BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion

type BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion struct {
	OfAlwaysAllow *BetaManagedAgentsAlwaysAllowPolicyParam `json:",omitzero,inline"`
	OfAlwaysAsk   *BetaManagedAgentsAlwaysAskPolicyParam   `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 (BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion) MarshalJSON

func (*BetaManagedAgentsAgentToolsetDefaultConfigParamsPermissionPolicyUnion) UnmarshalJSON

type BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion

type BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion struct {
	// Any of "always_allow", "always_ask".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion contains all possible properties and values from BetaManagedAgentsAlwaysAllowPolicy, BetaManagedAgentsAlwaysAskPolicy.

Use the BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion) AsAlwaysAllow

func (BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion) AsAlwaysAsk

func (BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion) AsAny

func (u BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion) AsAny() anyBetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicy

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsAlwaysAllowPolicy:
case Juglow.BetaManagedAgentsAlwaysAskPolicy:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion) UnmarshalJSON

type BetaManagedAgentsAgentTrackUnion added in v1.71.2

type BetaManagedAgentsAgentTrackUnion struct {
	TrackID string `json:"track_id"`
	// Any of "Juglow", "custom".
	Type    string `json:"type"`
	Version string `json:"version"`
	JSON    struct {
		TrackID respjson.Field
		Type    respjson.Field
		Version respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsAgentTrackUnion contains all possible properties and values from BetaManagedAgentsJuglowTrack, BetaManagedAgentsCustomTrack.

Use the BetaManagedAgentsAgentTrackUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsAgentTrackUnion) AsAny added in v1.71.2

func (u BetaManagedAgentsAgentTrackUnion) AsAny() anyBetaManagedAgentsAgentTrack

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsAgentTrackUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsJuglowTrack:
case Juglow.BetaManagedAgentsCustomTrack:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsAgentTrackUnion) AsCustom added in v1.71.2

func (BetaManagedAgentsAgentTrackUnion) AsJuglow added in v1.71.2

func (BetaManagedAgentsAgentTrackUnion) RawJSON added in v1.71.2

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsAgentTrackUnion) UnmarshalJSON added in v1.71.2

func (r *BetaManagedAgentsAgentTrackUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentType

type BetaManagedAgentsAgentType string
const (
	BetaManagedAgentsAgentTypeAgent BetaManagedAgentsAgentType = "agent"
)

type BetaManagedAgentsAgentWithOverridesParams

type BetaManagedAgentsAgentWithOverridesParams struct {
	// The `agent` ID.
	ID string `json:"id" api:"required"`
	// Any of "agent_with_overrides".
	Type BetaManagedAgentsAgentWithOverridesParamsType `json:"type,omitzero" api:"required"`
	// Replacement system prompt. Up to 100,000 characters. Set to null to clear the
	// agent's system prompt; omit to preserve it.
	System param.Opt[string] `json:"system,omitzero"`
	// The specific `agent` version to use. Omit to use the latest version.
	Version param.Opt[int64] `json:"version,omitzero"`
	// Replacement MCP server list. Full replacement: the provided array becomes the
	// MCP servers. Send an empty array to clear; omit to preserve the agent's servers.
	MCPServers []BetaManagedAgentsURLMCPServerParams `json:"mcp_servers,omitzero"`
	// Replacement model. Accepts the model string, e.g. `haijun-opus-4-6`, or a
	// `model_config` object. Omit to use the agent's model.
	Model BetaManagedAgentsModelConfigParams `json:"model,omitzero"`
	// Replacement track list. Full replacement: the provided array becomes the tracks.
	// Send an empty array to clear; omit to preserve the agent's tracks.
	Tracks []BetaManagedAgentsTrackParamsUnion `json:"tracks,omitzero"`
	// Replacement tool list. Full replacement: the provided array becomes the tool
	// configuration. Send an empty array to clear; omit to preserve the agent's tools.
	Tools []BetaManagedAgentsAgentWithOverridesParamsToolUnion `json:"tools,omitzero"`
	// contains filtered or unexported fields
}

Reference to an `agent` plus optional configuration overrides. Each provided field replaces the agent's value for the caller's use; the agent resource is unchanged.

The properties ID, Type are required.

func (BetaManagedAgentsAgentWithOverridesParams) MarshalJSON

func (r BetaManagedAgentsAgentWithOverridesParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsAgentWithOverridesParams) UnmarshalJSON

func (r *BetaManagedAgentsAgentWithOverridesParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAgentWithOverridesParamsToolUnion

type BetaManagedAgentsAgentWithOverridesParamsToolUnion struct {
	OfAgentToolset20260401 *BetaManagedAgentsAgentToolset20260401Params `json:",omitzero,inline"`
	OfMCPToolset           *BetaManagedAgentsMCPToolsetParams           `json:",omitzero,inline"`
	OfCustom               *BetaManagedAgentsCustomToolParams           `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 (BetaManagedAgentsAgentWithOverridesParamsToolUnion) GetConfigs

func (u BetaManagedAgentsAgentWithOverridesParamsToolUnion) GetConfigs() (res betaManagedAgentsAgentWithOverridesParamsToolUnionConfigs)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaManagedAgentsAgentWithOverridesParamsToolUnion) GetDefaultConfig

func (u BetaManagedAgentsAgentWithOverridesParamsToolUnion) GetDefaultConfig() (res betaManagedAgentsAgentWithOverridesParamsToolUnionDefaultConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaManagedAgentsAgentWithOverridesParamsToolUnion) GetDescription

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsAgentWithOverridesParamsToolUnion) GetInputSchema

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsAgentWithOverridesParamsToolUnion) GetMCPServerName

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsAgentWithOverridesParamsToolUnion) GetName

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsAgentWithOverridesParamsToolUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsAgentWithOverridesParamsToolUnion) MarshalJSON

func (*BetaManagedAgentsAgentWithOverridesParamsToolUnion) UnmarshalJSON

type BetaManagedAgentsAgentWithOverridesParamsType

type BetaManagedAgentsAgentWithOverridesParamsType string
const (
	BetaManagedAgentsAgentWithOverridesParamsTypeAgentWithOverrides BetaManagedAgentsAgentWithOverridesParamsType = "agent_with_overrides"
)

type BetaManagedAgentsAlwaysAllowPolicy

type BetaManagedAgentsAlwaysAllowPolicy struct {
	// Any of "always_allow".
	Type BetaManagedAgentsAlwaysAllowPolicyType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tool calls are automatically approved without user confirmation.

func (BetaManagedAgentsAlwaysAllowPolicy) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsAlwaysAllowPolicy) ToParam

ToParam converts this BetaManagedAgentsAlwaysAllowPolicy to a BetaManagedAgentsAlwaysAllowPolicyParam.

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 BetaManagedAgentsAlwaysAllowPolicyParam.Overrides()

func (*BetaManagedAgentsAlwaysAllowPolicy) UnmarshalJSON

func (r *BetaManagedAgentsAlwaysAllowPolicy) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAlwaysAllowPolicyParam

type BetaManagedAgentsAlwaysAllowPolicyParam struct {
	// Any of "always_allow".
	Type BetaManagedAgentsAlwaysAllowPolicyType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Tool calls are automatically approved without user confirmation.

The property Type is required.

func (BetaManagedAgentsAlwaysAllowPolicyParam) MarshalJSON

func (r BetaManagedAgentsAlwaysAllowPolicyParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsAlwaysAllowPolicyParam) UnmarshalJSON

func (r *BetaManagedAgentsAlwaysAllowPolicyParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAlwaysAllowPolicyType

type BetaManagedAgentsAlwaysAllowPolicyType string
const (
	BetaManagedAgentsAlwaysAllowPolicyTypeAlwaysAllow BetaManagedAgentsAlwaysAllowPolicyType = "always_allow"
)

type BetaManagedAgentsAlwaysAskPolicy

type BetaManagedAgentsAlwaysAskPolicy struct {
	// Any of "always_ask".
	Type BetaManagedAgentsAlwaysAskPolicyType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tool calls require user confirmation before execution.

func (BetaManagedAgentsAlwaysAskPolicy) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsAlwaysAskPolicy) ToParam

ToParam converts this BetaManagedAgentsAlwaysAskPolicy to a BetaManagedAgentsAlwaysAskPolicyParam.

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 BetaManagedAgentsAlwaysAskPolicyParam.Overrides()

func (*BetaManagedAgentsAlwaysAskPolicy) UnmarshalJSON

func (r *BetaManagedAgentsAlwaysAskPolicy) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAlwaysAskPolicyParam

type BetaManagedAgentsAlwaysAskPolicyParam struct {
	// Any of "always_ask".
	Type BetaManagedAgentsAlwaysAskPolicyType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Tool calls require user confirmation before execution.

The property Type is required.

func (BetaManagedAgentsAlwaysAskPolicyParam) MarshalJSON

func (r BetaManagedAgentsAlwaysAskPolicyParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsAlwaysAskPolicyParam) UnmarshalJSON

func (r *BetaManagedAgentsAlwaysAskPolicyParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsAlwaysAskPolicyType

type BetaManagedAgentsAlwaysAskPolicyType string
const (
	BetaManagedAgentsAlwaysAskPolicyTypeAlwaysAsk BetaManagedAgentsAlwaysAskPolicyType = "always_ask"
)

type BetaManagedAgentsBase64DocumentSource

type BetaManagedAgentsBase64DocumentSource struct {
	// Base64-encoded document data.
	Data string `json:"data" api:"required"`
	// MIME type of the document (e.g., "application/pdf").
	MediaType string `json:"media_type" api:"required"`
	// Any of "base64".
	Type BetaManagedAgentsBase64DocumentSourceType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		MediaType   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Base64-encoded document data.

func (BetaManagedAgentsBase64DocumentSource) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsBase64DocumentSource) ToParam

ToParam converts this BetaManagedAgentsBase64DocumentSource to a BetaManagedAgentsBase64DocumentSourceParam.

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 BetaManagedAgentsBase64DocumentSourceParam.Overrides()

func (*BetaManagedAgentsBase64DocumentSource) UnmarshalJSON

func (r *BetaManagedAgentsBase64DocumentSource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBase64DocumentSourceParam

type BetaManagedAgentsBase64DocumentSourceParam struct {
	// Base64-encoded document data.
	Data string `json:"data" api:"required"`
	// MIME type of the document (e.g., "application/pdf").
	MediaType string `json:"media_type" api:"required"`
	// Any of "base64".
	Type BetaManagedAgentsBase64DocumentSourceType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Base64-encoded document data.

The properties Data, MediaType, Type are required.

func (BetaManagedAgentsBase64DocumentSourceParam) MarshalJSON

func (r BetaManagedAgentsBase64DocumentSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsBase64DocumentSourceParam) UnmarshalJSON

func (r *BetaManagedAgentsBase64DocumentSourceParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBase64DocumentSourceType

type BetaManagedAgentsBase64DocumentSourceType string
const (
	BetaManagedAgentsBase64DocumentSourceTypeBase64 BetaManagedAgentsBase64DocumentSourceType = "base64"
)

type BetaManagedAgentsBase64ImageSource

type BetaManagedAgentsBase64ImageSource struct {
	// Base64-encoded image data.
	Data string `json:"data" api:"required"`
	// MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif",
	// "image/webp").
	MediaType string `json:"media_type" api:"required"`
	// Any of "base64".
	Type BetaManagedAgentsBase64ImageSourceType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		MediaType   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Base64-encoded image data.

func (BetaManagedAgentsBase64ImageSource) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsBase64ImageSource) ToParam

ToParam converts this BetaManagedAgentsBase64ImageSource to a BetaManagedAgentsBase64ImageSourceParam.

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 BetaManagedAgentsBase64ImageSourceParam.Overrides()

func (*BetaManagedAgentsBase64ImageSource) UnmarshalJSON

func (r *BetaManagedAgentsBase64ImageSource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBase64ImageSourceParam

type BetaManagedAgentsBase64ImageSourceParam struct {
	// Base64-encoded image data.
	Data string `json:"data" api:"required"`
	// MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif",
	// "image/webp").
	MediaType string `json:"media_type" api:"required"`
	// Any of "base64".
	Type BetaManagedAgentsBase64ImageSourceType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Base64-encoded image data.

The properties Data, MediaType, Type are required.

func (BetaManagedAgentsBase64ImageSourceParam) MarshalJSON

func (r BetaManagedAgentsBase64ImageSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsBase64ImageSourceParam) UnmarshalJSON

func (r *BetaManagedAgentsBase64ImageSourceParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBase64ImageSourceType

type BetaManagedAgentsBase64ImageSourceType string
const (
	BetaManagedAgentsBase64ImageSourceTypeBase64 BetaManagedAgentsBase64ImageSourceType = "base64"
)

type BetaManagedAgentsBillingError

type BetaManagedAgentsBillingError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// What the client should do next in response to this error.
	RetryStatus BetaManagedAgentsBillingErrorRetryStatusUnion `json:"retry_status" api:"required"`
	// Any of "billing_error".
	Type BetaManagedAgentsBillingErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		RetryStatus respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The caller's organization or workspace cannot make model requests — out of credits or spend limit reached. Retrying with the same credentials will not succeed; the caller must resolve the billing state.

func (BetaManagedAgentsBillingError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsBillingError) UnmarshalJSON

func (r *BetaManagedAgentsBillingError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBillingErrorRetryStatusUnion

type BetaManagedAgentsBillingErrorRetryStatusUnion struct {
	// Any of "retrying", "exhausted", "terminal".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsBillingErrorRetryStatusUnion contains all possible properties and values from BetaManagedAgentsRetryStatusRetrying, BetaManagedAgentsRetryStatusExhausted, BetaManagedAgentsRetryStatusTerminal.

Use the BetaManagedAgentsBillingErrorRetryStatusUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsBillingErrorRetryStatusUnion) AsAny

func (u BetaManagedAgentsBillingErrorRetryStatusUnion) AsAny() anyBetaManagedAgentsBillingErrorRetryStatus

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsBillingErrorRetryStatusUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsRetryStatusRetrying:
case Juglow.BetaManagedAgentsRetryStatusExhausted:
case Juglow.BetaManagedAgentsRetryStatusTerminal:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsBillingErrorRetryStatusUnion) AsExhausted

func (BetaManagedAgentsBillingErrorRetryStatusUnion) AsRetrying

func (BetaManagedAgentsBillingErrorRetryStatusUnion) AsTerminal

func (BetaManagedAgentsBillingErrorRetryStatusUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsBillingErrorRetryStatusUnion) UnmarshalJSON

func (r *BetaManagedAgentsBillingErrorRetryStatusUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBillingErrorType

type BetaManagedAgentsBillingErrorType string
const (
	BetaManagedAgentsBillingErrorTypeBillingError BetaManagedAgentsBillingErrorType = "billing_error"
)

type BetaManagedAgentsBranchCheckout

type BetaManagedAgentsBranchCheckout struct {
	// Branch name to check out.
	Name string `json:"name" api:"required"`
	// Any of "branch".
	Type BetaManagedAgentsBranchCheckoutType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaManagedAgentsBranchCheckout) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsBranchCheckout) ToParam

ToParam converts this BetaManagedAgentsBranchCheckout to a BetaManagedAgentsBranchCheckoutParam.

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 BetaManagedAgentsBranchCheckoutParam.Overrides()

func (*BetaManagedAgentsBranchCheckout) UnmarshalJSON

func (r *BetaManagedAgentsBranchCheckout) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBranchCheckoutParam

type BetaManagedAgentsBranchCheckoutParam struct {
	// Branch name to check out.
	Name string `json:"name" api:"required"`
	// Any of "branch".
	Type BetaManagedAgentsBranchCheckoutType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaManagedAgentsBranchCheckoutParam) MarshalJSON

func (r BetaManagedAgentsBranchCheckoutParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsBranchCheckoutParam) UnmarshalJSON

func (r *BetaManagedAgentsBranchCheckoutParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBranchCheckoutType

type BetaManagedAgentsBranchCheckoutType string
const (
	BetaManagedAgentsBranchCheckoutTypeBranch BetaManagedAgentsBranchCheckoutType = "branch"
)

type BetaManagedAgentsBudgetLimit

type BetaManagedAgentsBudgetLimit struct {
	// A monetary amount in a specific currency.
	MaxListCost BetaMonetaryAmount `json:"max_list_cost" api:"required"`
	// Any of "limit".
	Type BetaManagedAgentsBudgetLimitType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MaxListCost respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.

func (BetaManagedAgentsBudgetLimit) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsBudgetLimit) ToParam

ToParam converts this BetaManagedAgentsBudgetLimit to a BetaManagedAgentsBudgetLimitParam.

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 BetaManagedAgentsBudgetLimitParam.Overrides()

func (*BetaManagedAgentsBudgetLimit) UnmarshalJSON

func (r *BetaManagedAgentsBudgetLimit) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBudgetLimitParam

type BetaManagedAgentsBudgetLimitParam struct {
	// A monetary amount in a specific currency.
	MaxListCost BetaMonetaryAmountParam `json:"max_list_cost,omitzero" api:"required"`
	// Any of "limit".
	Type BetaManagedAgentsBudgetLimitType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

A hard spend ceiling. The session stops issuing new model requests once the tracked list cost reaches `max_list_cost`.

The properties MaxListCost, Type are required.

func (BetaManagedAgentsBudgetLimitParam) MarshalJSON

func (r BetaManagedAgentsBudgetLimitParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsBudgetLimitParam) UnmarshalJSON

func (r *BetaManagedAgentsBudgetLimitParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsBudgetLimitType

type BetaManagedAgentsBudgetLimitType string
const (
	BetaManagedAgentsBudgetLimitTypeLimit BetaManagedAgentsBudgetLimitType = "limit"
)

type BetaManagedAgentsCacheCreationUsage

type BetaManagedAgentsCacheCreationUsage struct {
	// Tokens used to create 1-hour ephemeral cache entries.
	Ephemeral1hInputTokens int64 `json:"ephemeral_1h_input_tokens"`
	// Tokens used to create 5-minute ephemeral cache entries.
	Ephemeral5mInputTokens int64 `json:"ephemeral_5m_input_tokens"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Ephemeral1hInputTokens respjson.Field
		Ephemeral5mInputTokens respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Prompt-cache creation token usage broken down by cache lifetime.

func (BetaManagedAgentsCacheCreationUsage) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsCacheCreationUsage) UnmarshalJSON

func (r *BetaManagedAgentsCacheCreationUsage) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCommitCheckout

type BetaManagedAgentsCommitCheckout struct {
	// Full commit SHA to check out.
	Sha string `json:"sha" api:"required"`
	// Any of "commit".
	Type BetaManagedAgentsCommitCheckoutType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Sha         respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaManagedAgentsCommitCheckout) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsCommitCheckout) ToParam

ToParam converts this BetaManagedAgentsCommitCheckout to a BetaManagedAgentsCommitCheckoutParam.

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 BetaManagedAgentsCommitCheckoutParam.Overrides()

func (*BetaManagedAgentsCommitCheckout) UnmarshalJSON

func (r *BetaManagedAgentsCommitCheckout) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCommitCheckoutParam

type BetaManagedAgentsCommitCheckoutParam struct {
	// Full commit SHA to check out.
	Sha string `json:"sha" api:"required"`
	// Any of "commit".
	Type BetaManagedAgentsCommitCheckoutType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Sha, Type are required.

func (BetaManagedAgentsCommitCheckoutParam) MarshalJSON

func (r BetaManagedAgentsCommitCheckoutParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsCommitCheckoutParam) UnmarshalJSON

func (r *BetaManagedAgentsCommitCheckoutParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCommitCheckoutType

type BetaManagedAgentsCommitCheckoutType string
const (
	BetaManagedAgentsCommitCheckoutTypeCommit BetaManagedAgentsCommitCheckoutType = "commit"
)

type BetaManagedAgentsCredential

type BetaManagedAgentsCredential struct {
	// Unique identifier for the credential.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// Authentication details for a credential.
	Auth BetaManagedAgentsCredentialAuthUnion `json:"auth" api:"required"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Arbitrary key-value metadata attached to the credential.
	Metadata map[string]string `json:"metadata" api:"required"`
	// Any of "vault_credential".
	Type BetaManagedAgentsCredentialType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Identifier of the vault this credential belongs to.
	VaultID string `json:"vault_id" api:"required"`
	// Human-readable name for the credential.
	DisplayName string `json:"display_name" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ArchivedAt  respjson.Field
		Auth        respjson.Field
		CreatedAt   respjson.Field
		Metadata    respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		VaultID     respjson.Field
		DisplayName respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A credential stored in a vault. Sensitive fields are never returned in responses.

func (BetaManagedAgentsCredential) RawJSON

func (r BetaManagedAgentsCredential) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsCredential) UnmarshalJSON

func (r *BetaManagedAgentsCredential) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCredentialAuthUnion

type BetaManagedAgentsCredentialAuthUnion struct {
	MCPServerURL string `json:"mcp_server_url"`
	// Any of "mcp_oauth", "static_bearer", "environment_variable".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsMCPOAuthAuthResponse].
	ExpiresAt time.Time `json:"expires_at"`
	// This field is from variant [BetaManagedAgentsMCPOAuthAuthResponse].
	Refresh BetaManagedAgentsMCPOAuthRefreshResponse `json:"refresh"`
	// This field is from variant [BetaManagedAgentsEnvironmentVariableAuthResponse].
	InjectionLocation BetaManagedAgentsInjectionLocationResponse `json:"injection_location"`
	// This field is from variant [BetaManagedAgentsEnvironmentVariableAuthResponse].
	Networking BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion `json:"networking"`
	// This field is from variant [BetaManagedAgentsEnvironmentVariableAuthResponse].
	SecretName string `json:"secret_name"`
	JSON       struct {
		MCPServerURL      respjson.Field
		Type              respjson.Field
		ExpiresAt         respjson.Field
		Refresh           respjson.Field
		InjectionLocation respjson.Field
		Networking        respjson.Field
		SecretName        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsCredentialAuthUnion contains all possible properties and values from BetaManagedAgentsMCPOAuthAuthResponse, BetaManagedAgentsStaticBearerAuthResponse, BetaManagedAgentsEnvironmentVariableAuthResponse.

Use the BetaManagedAgentsCredentialAuthUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsCredentialAuthUnion) AsAny

func (u BetaManagedAgentsCredentialAuthUnion) AsAny() anyBetaManagedAgentsCredentialAuth

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsCredentialAuthUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsMCPOAuthAuthResponse:
case Juglow.BetaManagedAgentsStaticBearerAuthResponse:
case Juglow.BetaManagedAgentsEnvironmentVariableAuthResponse:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsCredentialAuthUnion) AsEnvironmentVariable

func (BetaManagedAgentsCredentialAuthUnion) AsMCPOAuth

func (BetaManagedAgentsCredentialAuthUnion) AsStaticBearer

func (BetaManagedAgentsCredentialAuthUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsCredentialAuthUnion) UnmarshalJSON

func (r *BetaManagedAgentsCredentialAuthUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCredentialHostUnreachableError

type BetaManagedAgentsCredentialHostUnreachableError struct {
	// ID of the affected credential.
	CredentialID string `json:"credential_id" api:"required"`
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// What the client should do next in response to this error.
	RetryStatus BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion `json:"retry_status" api:"required"`
	// Any of "credential_host_unreachable_error".
	Type BetaManagedAgentsCredentialHostUnreachableErrorType `json:"type" api:"required"`
	// ID of the vault containing the affected credential.
	VaultID string `json:"vault_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CredentialID respjson.Field
		Message      respjson.Field
		RetryStatus  respjson.Field
		Type         respjson.Field
		VaultID      respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An `environment_variable` credential's `auth.networking.allowed_hosts` includes a host the environment's network policy does not permit.

func (BetaManagedAgentsCredentialHostUnreachableError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsCredentialHostUnreachableError) UnmarshalJSON

type BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion

type BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion struct {
	// Any of "retrying", "exhausted", "terminal".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion contains all possible properties and values from BetaManagedAgentsRetryStatusRetrying, BetaManagedAgentsRetryStatusExhausted, BetaManagedAgentsRetryStatusTerminal.

Use the BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion) AsAny

func (u BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion) AsAny() anyBetaManagedAgentsCredentialHostUnreachableErrorRetryStatus

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsRetryStatusRetrying:
case Juglow.BetaManagedAgentsRetryStatusExhausted:
case Juglow.BetaManagedAgentsRetryStatusTerminal:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion) AsExhausted

func (BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion) AsRetrying

func (BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion) AsTerminal

func (BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion) UnmarshalJSON

type BetaManagedAgentsCredentialHostUnreachableErrorType

type BetaManagedAgentsCredentialHostUnreachableErrorType string
const (
	BetaManagedAgentsCredentialHostUnreachableErrorTypeCredentialHostUnreachableError BetaManagedAgentsCredentialHostUnreachableErrorType = "credential_host_unreachable_error"
)

type BetaManagedAgentsCredentialNetworkingParamsUnion

type BetaManagedAgentsCredentialNetworkingParamsUnion struct {
	OfUnrestricted *BetaManagedAgentsUnrestrictedCredentialNetworkingParams `json:",omitzero,inline"`
	OfLimited      *BetaManagedAgentsLimitedCredentialNetworkingParams      `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 BetaManagedAgentsCredentialNetworkingParamsOfLimited

func BetaManagedAgentsCredentialNetworkingParamsOfLimited(allowedHosts []string) BetaManagedAgentsCredentialNetworkingParamsUnion

func (BetaManagedAgentsCredentialNetworkingParamsUnion) GetAllowedHosts

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsCredentialNetworkingParamsUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsCredentialNetworkingParamsUnion) MarshalJSON

func (*BetaManagedAgentsCredentialNetworkingParamsUnion) UnmarshalJSON

type BetaManagedAgentsCredentialType

type BetaManagedAgentsCredentialType string
const (
	BetaManagedAgentsCredentialTypeVaultCredential BetaManagedAgentsCredentialType = "vault_credential"
)

type BetaManagedAgentsCredentialValidation

type BetaManagedAgentsCredentialValidation struct {
	// Unique identifier of the credential that was validated.
	CredentialID string `json:"credential_id" api:"required"`
	// Whether the credential has a refresh token configured.
	HasRefreshToken bool `json:"has_refresh_token" api:"required"`
	// The failing step of an MCP validation probe.
	MCPProbe BetaManagedAgentsMCPProbe `json:"mcp_probe" api:"required"`
	// Outcome of a refresh-token exchange attempted during credential validation.
	Refresh BetaManagedAgentsRefreshObject `json:"refresh" api:"required"`
	// Overall verdict of a credential validation probe.
	//
	// Any of "valid", "invalid", "unknown".
	Status BetaManagedAgentsCredentialValidationStatus `json:"status" api:"required"`
	// Any of "vault_credential_validation".
	Type BetaManagedAgentsCredentialValidationType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	ValidatedAt time.Time `json:"validated_at" api:"required" format:"date-time"`
	// Identifier of the vault containing the credential.
	VaultID string `json:"vault_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CredentialID    respjson.Field
		HasRefreshToken respjson.Field
		MCPProbe        respjson.Field
		Refresh         respjson.Field
		Status          respjson.Field
		Type            respjson.Field
		ValidatedAt     respjson.Field
		VaultID         respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Result of live-probing a credential against its configured MCP server.

func (BetaManagedAgentsCredentialValidation) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsCredentialValidation) UnmarshalJSON

func (r *BetaManagedAgentsCredentialValidation) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCredentialValidationStatus

type BetaManagedAgentsCredentialValidationStatus string

Overall verdict of a credential validation probe.

const (
	BetaManagedAgentsCredentialValidationStatusValid   BetaManagedAgentsCredentialValidationStatus = "valid"
	BetaManagedAgentsCredentialValidationStatusInvalid BetaManagedAgentsCredentialValidationStatus = "invalid"
	BetaManagedAgentsCredentialValidationStatusUnknown BetaManagedAgentsCredentialValidationStatus = "unknown"
)

type BetaManagedAgentsCredentialValidationType

type BetaManagedAgentsCredentialValidationType string
const (
	BetaManagedAgentsCredentialValidationTypeVaultCredentialValidation BetaManagedAgentsCredentialValidationType = "vault_credential_validation"
)

type BetaManagedAgentsCustomTool

type BetaManagedAgentsCustomTool struct {
	Description string `json:"description" api:"required"`
	// JSON Schema for custom tool input parameters.
	InputSchema BetaManagedAgentsCustomToolInputSchema `json:"input_schema" api:"required"`
	Name        string                                 `json:"name" api:"required"`
	// Any of "custom".
	Type BetaManagedAgentsCustomToolType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description respjson.Field
		InputSchema respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A custom tool as returned in API responses.

func (BetaManagedAgentsCustomTool) RawJSON

func (r BetaManagedAgentsCustomTool) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsCustomTool) UnmarshalJSON

func (r *BetaManagedAgentsCustomTool) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCustomToolInputSchema

type BetaManagedAgentsCustomToolInputSchema struct {
	Type        constant.Object `json:"type" default:"object"`
	Properties  map[string]any  `json:"properties" api:"nullable"`
	Required    []string        `json:"required" api:"nullable"`
	ExtraFields map[string]any  `json:"" api:"extrafields"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		Properties  respjson.Field
		Required    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

JSON Schema for custom tool input parameters.

func (BetaManagedAgentsCustomToolInputSchema) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsCustomToolInputSchema) ToParam

ToParam converts this BetaManagedAgentsCustomToolInputSchema to a BetaManagedAgentsCustomToolInputSchemaParam.

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 BetaManagedAgentsCustomToolInputSchemaParam.Overrides()

func (*BetaManagedAgentsCustomToolInputSchema) UnmarshalJSON

func (r *BetaManagedAgentsCustomToolInputSchema) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCustomToolInputSchemaParam

type BetaManagedAgentsCustomToolInputSchemaParam struct {
	Properties map[string]any `json:"properties,omitzero"`
	Required   []string       `json:"required,omitzero"`
	// This field can be elided, and will marshal its zero value as "object".
	Type        constant.Object `json:"type" default:"object"`
	ExtraFields map[string]any  `json:"-"`
	// contains filtered or unexported fields
}

JSON Schema for custom tool input parameters.

The property Type is required.

func (BetaManagedAgentsCustomToolInputSchemaParam) MarshalJSON

func (r BetaManagedAgentsCustomToolInputSchemaParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsCustomToolInputSchemaParam) UnmarshalJSON

func (r *BetaManagedAgentsCustomToolInputSchemaParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCustomToolParams

type BetaManagedAgentsCustomToolParams struct {
	// Description of what the tool does, shown to the agent to help it decide when to
	// use the tool.
	Description string `json:"description" api:"required"`
	// JSON Schema for custom tool input parameters.
	InputSchema BetaManagedAgentsCustomToolInputSchemaParam `json:"input_schema,omitzero" api:"required"`
	// Unique name for the tool. 1-128 characters; letters, digits, underscores, and
	// hyphens.
	Name string `json:"name" api:"required"`
	// Any of "custom".
	Type BetaManagedAgentsCustomToolParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

A custom tool that is executed by the API client rather than the agent. When the agent calls this tool, an `agent.custom_tool_use` event is emitted and the session goes idle, waiting for the client to provide the result via a `user.custom_tool_result` event.

The properties Description, InputSchema, Name, Type are required.

func (BetaManagedAgentsCustomToolParams) MarshalJSON

func (r BetaManagedAgentsCustomToolParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsCustomToolParams) UnmarshalJSON

func (r *BetaManagedAgentsCustomToolParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCustomToolParamsType

type BetaManagedAgentsCustomToolParamsType string
const (
	BetaManagedAgentsCustomToolParamsTypeCustom BetaManagedAgentsCustomToolParamsType = "custom"
)

type BetaManagedAgentsCustomToolType

type BetaManagedAgentsCustomToolType string
const (
	BetaManagedAgentsCustomToolTypeCustom BetaManagedAgentsCustomToolType = "custom"
)

type BetaManagedAgentsCustomTrack added in v1.71.2

type BetaManagedAgentsCustomTrack struct {
	TrackID string `json:"track_id" api:"required"`
	// Any of "custom".
	Type    BetaManagedAgentsCustomTrackType `json:"type" api:"required"`
	Version string                           `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TrackID     respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A resolved user-created custom track.

func (BetaManagedAgentsCustomTrack) RawJSON added in v1.71.2

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsCustomTrack) UnmarshalJSON added in v1.71.2

func (r *BetaManagedAgentsCustomTrack) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCustomTrackParams added in v1.71.2

type BetaManagedAgentsCustomTrackParams struct {
	// Tagged ID of the custom track (e.g., "track_01XJ5...").
	TrackID string `json:"track_id" api:"required"`
	// Any of "custom".
	Type BetaManagedAgentsCustomTrackParamsType `json:"type,omitzero" api:"required"`
	// Version to pin. Defaults to latest if omitted.
	Version param.Opt[string] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

A user-created custom track.

The properties TrackID, Type are required.

func (BetaManagedAgentsCustomTrackParams) MarshalJSON added in v1.71.2

func (r BetaManagedAgentsCustomTrackParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsCustomTrackParams) UnmarshalJSON added in v1.71.2

func (r *BetaManagedAgentsCustomTrackParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsCustomTrackParamsType added in v1.71.2

type BetaManagedAgentsCustomTrackParamsType string
const (
	BetaManagedAgentsCustomTrackParamsTypeCustom BetaManagedAgentsCustomTrackParamsType = "custom"
)

type BetaManagedAgentsCustomTrackType added in v1.71.2

type BetaManagedAgentsCustomTrackType string
const (
	BetaManagedAgentsCustomTrackTypeCustom BetaManagedAgentsCustomTrackType = "custom"
)

type BetaManagedAgentsDeleteSessionResource

type BetaManagedAgentsDeleteSessionResource struct {
	ID string `json:"id" api:"required"`
	// Any of "session_resource_deleted".
	Type BetaManagedAgentsDeleteSessionResourceType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Confirmation of resource deletion.

func (BetaManagedAgentsDeleteSessionResource) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeleteSessionResource) UnmarshalJSON

func (r *BetaManagedAgentsDeleteSessionResource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeleteSessionResourceType

type BetaManagedAgentsDeleteSessionResourceType string
const (
	BetaManagedAgentsDeleteSessionResourceTypeSessionResourceDeleted BetaManagedAgentsDeleteSessionResourceType = "session_resource_deleted"
)

type BetaManagedAgentsDeletedCredential

type BetaManagedAgentsDeletedCredential struct {
	// Unique identifier of the deleted credential.
	ID string `json:"id" api:"required"`
	// Any of "vault_credential_deleted".
	Type BetaManagedAgentsDeletedCredentialType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Confirmation of a deleted credential.

func (BetaManagedAgentsDeletedCredential) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeletedCredential) UnmarshalJSON

func (r *BetaManagedAgentsDeletedCredential) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeletedCredentialType

type BetaManagedAgentsDeletedCredentialType string
const (
	BetaManagedAgentsDeletedCredentialTypeVaultCredentialDeleted BetaManagedAgentsDeletedCredentialType = "vault_credential_deleted"
)

type BetaManagedAgentsDeletedMemory

type BetaManagedAgentsDeletedMemory struct {
	// ID of the deleted memory (a `mem_...` value).
	ID string `json:"id" api:"required"`
	// Any of "memory_deleted".
	Type BetaManagedAgentsDeletedMemoryType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tombstone returned by [Delete a memory](/en/api/beta/memory_stores/memories/delete). The memory's version history persists and remains listable via [List memory versions](/en/api/beta/memory_stores/memory_versions/list) until the store itself is deleted.

func (BetaManagedAgentsDeletedMemory) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeletedMemory) UnmarshalJSON

func (r *BetaManagedAgentsDeletedMemory) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeletedMemoryStore

type BetaManagedAgentsDeletedMemoryStore struct {
	// ID of the deleted memory store (a `memstore_...` identifier). The store and all
	// its memories and versions are no longer retrievable.
	ID string `json:"id" api:"required"`
	// Any of "memory_store_deleted".
	Type BetaManagedAgentsDeletedMemoryStoreType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Confirmation that a `memory_store` was deleted.

func (BetaManagedAgentsDeletedMemoryStore) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeletedMemoryStore) UnmarshalJSON

func (r *BetaManagedAgentsDeletedMemoryStore) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeletedMemoryStoreType

type BetaManagedAgentsDeletedMemoryStoreType string
const (
	BetaManagedAgentsDeletedMemoryStoreTypeMemoryStoreDeleted BetaManagedAgentsDeletedMemoryStoreType = "memory_store_deleted"
)

type BetaManagedAgentsDeletedMemoryType

type BetaManagedAgentsDeletedMemoryType string
const (
	BetaManagedAgentsDeletedMemoryTypeMemoryDeleted BetaManagedAgentsDeletedMemoryType = "memory_deleted"
)

type BetaManagedAgentsDeletedSession

type BetaManagedAgentsDeletedSession struct {
	ID string `json:"id" api:"required"`
	// Any of "session_deleted".
	Type BetaManagedAgentsDeletedSessionType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Confirmation that a `session` has been permanently deleted.

func (BetaManagedAgentsDeletedSession) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeletedSession) UnmarshalJSON

func (r *BetaManagedAgentsDeletedSession) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeletedSessionType

type BetaManagedAgentsDeletedSessionType string
const (
	BetaManagedAgentsDeletedSessionTypeSessionDeleted BetaManagedAgentsDeletedSessionType = "session_deleted"
)

type BetaManagedAgentsDeletedVault

type BetaManagedAgentsDeletedVault struct {
	// Unique identifier of the deleted vault.
	ID string `json:"id" api:"required"`
	// Any of "vault_deleted".
	Type BetaManagedAgentsDeletedVaultType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Confirmation of a deleted vault.

func (BetaManagedAgentsDeletedVault) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeletedVault) UnmarshalJSON

func (r *BetaManagedAgentsDeletedVault) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeletedVaultType

type BetaManagedAgentsDeletedVaultType string
const (
	BetaManagedAgentsDeletedVaultTypeVaultDeleted BetaManagedAgentsDeletedVaultType = "vault_deleted"
)

type BetaManagedAgentsDeltaContent

type BetaManagedAgentsDeltaContent struct {
	// Regular text content.
	Content BetaManagedAgentsTextBlock `json:"content" api:"required"`
	// Any of "content_delta".
	Type BetaManagedAgentsDeltaContentType `json:"type" api:"required"`
	// Which entry in the previewed event's content array this fragment lands in.
	// Insert content as that entry when the index is new; append to the existing entry
	// otherwise.
	Index int64 `json:"index"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		Type        respjson.Field
		Index       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaManagedAgentsDeltaContent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeltaContent) UnmarshalJSON

func (r *BetaManagedAgentsDeltaContent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeltaContentType

type BetaManagedAgentsDeltaContentType string
const (
	BetaManagedAgentsDeltaContentTypeContentDelta BetaManagedAgentsDeltaContentType = "content_delta"
)

type BetaManagedAgentsDeltaEvent

type BetaManagedAgentsDeltaEvent struct {
	// One fragment of the previewed event. The delta type is named for the previewed
	// event's field it streams into: agent.message events stream content_delta
	// fragments, each a partial element of the content array.
	Delta BetaManagedAgentsDeltaContent `json:"delta" api:"required"`
	// The id of the event being previewed. Matches event.id on the corresponding
	// event_start and the buffered event that reconciles the preview.
	EventID string `json:"event_id" api:"required"`
	// Any of "event_delta".
	Type BetaManagedAgentsDeltaEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Delta       respjson.Field
		EventID     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An incremental update to an event that is still being streamed. Deltas are best-effort and may stop early; when the buffered event with id == event_id is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no buffered event — its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.

func (BetaManagedAgentsDeltaEvent) RawJSON

func (r BetaManagedAgentsDeltaEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeltaEvent) UnmarshalJSON

func (r *BetaManagedAgentsDeltaEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeltaEventType

type BetaManagedAgentsDeltaEventType string
const (
	BetaManagedAgentsDeltaEventTypeEventDelta BetaManagedAgentsDeltaEventType = "event_delta"
)

type BetaManagedAgentsDeltaType

type BetaManagedAgentsDeltaType string

EventDeltaType enum

const (
	BetaManagedAgentsDeltaTypeAgentMessage  BetaManagedAgentsDeltaType = "agent.message"
	BetaManagedAgentsDeltaTypeAgentThinking BetaManagedAgentsDeltaType = "agent.thinking"
)

type BetaManagedAgentsDeployment

type BetaManagedAgentsDeployment struct {
	// Unique identifier for this deployment.
	ID string `json:"id" api:"required"`
	// A resolved agent reference with a concrete version.
	Agent BetaManagedAgentsAgentReference `json:"agent" api:"required"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Description of what the deployment does.
	Description string `json:"description" api:"required"`
	// ID of the `environment` where sessions run.
	EnvironmentID string `json:"environment_id" api:"required"`
	// Events sent to each session immediately after creation.
	InitialEvents []BetaManagedAgentsDeploymentInitialEventUnion `json:"initial_events" api:"required"`
	// Arbitrary key-value metadata. Maximum 16 pairs.
	Metadata map[string]string `json:"metadata" api:"required"`
	// Human-readable name.
	Name string `json:"name" api:"required"`
	// Why a deployment is paused. Non-null exactly when `status` is `paused`.
	PausedReason BetaManagedAgentsDeploymentPausedReasonUnion `json:"paused_reason" api:"required"`
	// Resources attached to sessions created from this deployment. Echoes the input
	// minus write-only credentials.
	Resources []BetaManagedAgentsSessionResourceConfigUnion `json:"resources" api:"required"`
	// 5-field POSIX cron schedule with computed runtime timestamps.
	Schedule BetaManagedAgentsSchedule `json:"schedule" api:"required"`
	// Lifecycle status of a deployment.
	//
	// Any of "active", "paused".
	Status BetaManagedAgentsDeploymentStatus `json:"status" api:"required"`
	// Any of "deployment".
	Type BetaManagedAgentsDeploymentType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Vault IDs supplying stored credentials for sessions created from this
	// deployment.
	VaultIDs []string `json:"vault_ids" api:"required"`
	// A hard spend ceiling. The session stops issuing new model requests once the
	// tracked list cost reaches `max_list_cost`.
	Budget BetaManagedAgentsBudgetLimit `json:"budget" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Agent         respjson.Field
		ArchivedAt    respjson.Field
		CreatedAt     respjson.Field
		Description   respjson.Field
		EnvironmentID respjson.Field
		InitialEvents respjson.Field
		Metadata      respjson.Field
		Name          respjson.Field
		PausedReason  respjson.Field
		Resources     respjson.Field
		Schedule      respjson.Field
		Status        respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		VaultIDs      respjson.Field
		Budget        respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A deployment is a configured instance of an agent — it binds the agent to everything needed to run it autonomously: an environment, credentials, initial events, and an optional schedule.

func (BetaManagedAgentsDeployment) RawJSON

func (r BetaManagedAgentsDeployment) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeployment) UnmarshalJSON

func (r *BetaManagedAgentsDeployment) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeploymentInitialEventParamsUnion

type BetaManagedAgentsDeploymentInitialEventParamsUnion struct {
	OfUserMessage       *BetaManagedAgentsUserMessageEventParams       `json:",omitzero,inline"`
	OfUserDefineOutcome *BetaManagedAgentsUserDefineOutcomeEventParams `json:",omitzero,inline"`
	OfSystemMessage     *BetaManagedAgentsSystemMessageEventParams     `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 (BetaManagedAgentsDeploymentInitialEventParamsUnion) GetContent

func (u BetaManagedAgentsDeploymentInitialEventParamsUnion) GetContent() (res betaManagedAgentsDeploymentInitialEventParamsUnionContent)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaManagedAgentsDeploymentInitialEventParamsUnion) GetDescription

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsDeploymentInitialEventParamsUnion) GetMaxIterations

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsDeploymentInitialEventParamsUnion) GetRubric

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsDeploymentInitialEventParamsUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsDeploymentInitialEventParamsUnion) MarshalJSON

func (*BetaManagedAgentsDeploymentInitialEventParamsUnion) UnmarshalJSON

type BetaManagedAgentsDeploymentInitialEventUnion

type BetaManagedAgentsDeploymentInitialEventUnion struct {
	// This field is a union of
	// [[]BetaManagedAgentsDeploymentUserMessageEventContentUnion],
	// [[]BetaManagedAgentsSystemContentBlock]
	Content BetaManagedAgentsDeploymentInitialEventUnionContent `json:"content"`
	// Any of "user.message", "user.define_outcome", "system.message".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsDeploymentUserDefineOutcomeEvent].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsDeploymentUserDefineOutcomeEvent].
	Rubric BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion `json:"rubric"`
	// This field is from variant [BetaManagedAgentsDeploymentUserDefineOutcomeEvent].
	MaxIterations int64 `json:"max_iterations"`
	JSON          struct {
		Content       respjson.Field
		Type          respjson.Field
		Description   respjson.Field
		Rubric        respjson.Field
		MaxIterations respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsDeploymentInitialEventUnion contains all possible properties and values from BetaManagedAgentsDeploymentUserMessageEvent, BetaManagedAgentsDeploymentUserDefineOutcomeEvent, BetaManagedAgentsDeploymentSystemMessageEvent.

Use the BetaManagedAgentsDeploymentInitialEventUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsDeploymentInitialEventUnion) AsAny

func (u BetaManagedAgentsDeploymentInitialEventUnion) AsAny() anyBetaManagedAgentsDeploymentInitialEvent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsDeploymentInitialEventUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsDeploymentUserMessageEvent:
case Juglow.BetaManagedAgentsDeploymentUserDefineOutcomeEvent:
case Juglow.BetaManagedAgentsDeploymentSystemMessageEvent:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsDeploymentInitialEventUnion) AsSystemMessage

func (BetaManagedAgentsDeploymentInitialEventUnion) AsUserDefineOutcome

func (BetaManagedAgentsDeploymentInitialEventUnion) AsUserMessage

func (BetaManagedAgentsDeploymentInitialEventUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentInitialEventUnion) UnmarshalJSON

func (r *BetaManagedAgentsDeploymentInitialEventUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeploymentInitialEventUnionContent

type BetaManagedAgentsDeploymentInitialEventUnionContent struct {
	// This field will be present if the value is a
	// [[]BetaManagedAgentsDeploymentUserMessageEventContentUnion] instead of an
	// object.
	OfBetaManagedAgentsDeploymentUserMessageEventContentArray []BetaManagedAgentsDeploymentUserMessageEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsSystemContentBlock] instead of an object.
	OfBetaManagedAgentsSystemContentBlockArray []BetaManagedAgentsSystemContentBlock `json:",inline"`
	JSON                                       struct {
		OfBetaManagedAgentsDeploymentUserMessageEventContentArray respjson.Field
		OfBetaManagedAgentsSystemContentBlockArray                respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsDeploymentInitialEventUnionContent is an implicit subunion of BetaManagedAgentsDeploymentInitialEventUnion. BetaManagedAgentsDeploymentInitialEventUnionContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsDeploymentInitialEventUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaManagedAgentsDeploymentUserMessageEventContentArray OfBetaManagedAgentsSystemContentBlockArray]

func (*BetaManagedAgentsDeploymentInitialEventUnionContent) UnmarshalJSON

type BetaManagedAgentsDeploymentPausedReasonErrorUnion

type BetaManagedAgentsDeploymentPausedReasonErrorUnion struct {
	// Any of "environment_archived_error", "agent_archived_error",
	// "environment_not_found_error", "vault_not_found_error", "file_not_found_error",
	// "session_resource_not_found_error", "workspace_archived_error",
	// "organization_disabled_error", "memory_store_archived_error",
	// "track_not_found_error", "vault_archived_error", "unknown_error",
	// "self_hosted_resources_unsupported_error", "mcp_egress_blocked_error".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsDeploymentPausedReasonErrorUnion contains all possible properties and values from BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError, BetaManagedAgentsAgentArchivedDeploymentPausedReasonError, BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError, BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError, BetaManagedAgentsFileNotFoundDeploymentPausedReasonError, BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError, BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError, BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError, BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError, BetaManagedAgentsTrackNotFoundDeploymentPausedReasonError, BetaManagedAgentsVaultArchivedDeploymentPausedReasonError, BetaManagedAgentsUnknownDeploymentPausedReasonError, BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError, BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError.

Use the BetaManagedAgentsDeploymentPausedReasonErrorUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsAgentArchivedError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsAny

func (u BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsAny() anyBetaManagedAgentsDeploymentPausedReasonError

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsDeploymentPausedReasonErrorUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsAgentArchivedDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsFileNotFoundDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsTrackNotFoundDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsVaultArchivedDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsUnknownDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError:
case Juglow.BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsEnvironmentArchivedError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsEnvironmentNotFoundError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsFileNotFoundError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsMCPEgressBlockedError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsMemoryStoreArchivedError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsOrganizationDisabledError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsSelfHostedResourcesUnsupportedError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsSessionResourceNotFoundError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsTrackNotFoundError added in v1.71.2

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsUnknownError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsVaultArchivedError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsVaultNotFoundError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) AsWorkspaceArchivedError

func (BetaManagedAgentsDeploymentPausedReasonErrorUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentPausedReasonErrorUnion) UnmarshalJSON

type BetaManagedAgentsDeploymentPausedReasonUnion

type BetaManagedAgentsDeploymentPausedReasonUnion struct {
	// Any of "manual", "error".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsErrorDeploymentPausedReason].
	Error BetaManagedAgentsDeploymentPausedReasonErrorUnion `json:"error"`
	JSON  struct {
		Type  respjson.Field
		Error respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsDeploymentPausedReasonUnion contains all possible properties and values from BetaManagedAgentsManualDeploymentPausedReason, BetaManagedAgentsErrorDeploymentPausedReason.

Use the BetaManagedAgentsDeploymentPausedReasonUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsDeploymentPausedReasonUnion) AsAny

func (u BetaManagedAgentsDeploymentPausedReasonUnion) AsAny() anyBetaManagedAgentsDeploymentPausedReason

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsDeploymentPausedReasonUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsManualDeploymentPausedReason:
case Juglow.BetaManagedAgentsErrorDeploymentPausedReason:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsDeploymentPausedReasonUnion) AsError

func (BetaManagedAgentsDeploymentPausedReasonUnion) AsManual

func (BetaManagedAgentsDeploymentPausedReasonUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentPausedReasonUnion) UnmarshalJSON

func (r *BetaManagedAgentsDeploymentPausedReasonUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeploymentRun

type BetaManagedAgentsDeploymentRun struct {
	// Unique identifier for this run (`drun_...`).
	ID string `json:"id" api:"required"`
	// A resolved agent reference with a concrete version.
	Agent BetaManagedAgentsAgentReference `json:"agent" api:"required"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// ID of the deployment that produced this run.
	DeploymentID string `json:"deployment_id" api:"required"`
	// Why the run failed to create a session. The type identifies the failure; message
	// is human-readable detail.
	Error BetaManagedAgentsDeploymentRunErrorUnion `json:"error" api:"required"`
	// Populated on success. Null on creation failure. Exactly one of session_id or
	// error is non-null.
	SessionID string `json:"session_id" api:"required"`
	// Describes what triggered a deployment run, with trigger-specific metadata.
	TriggerContext BetaManagedAgentsTriggerContextUnion `json:"trigger_context" api:"required"`
	// Any of "deployment_run".
	Type BetaManagedAgentsDeploymentRunType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Agent          respjson.Field
		CreatedAt      respjson.Field
		DeploymentID   respjson.Field
		Error          respjson.Field
		SessionID      respjson.Field
		TriggerContext respjson.Field
		Type           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A persistent, append-only record of a single deployment execution. Records session creation success or failure — no session lifecycle tracking.

func (BetaManagedAgentsDeploymentRun) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentRun) UnmarshalJSON

func (r *BetaManagedAgentsDeploymentRun) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeploymentRunErrorUnion

type BetaManagedAgentsDeploymentRunErrorUnion struct {
	Message string `json:"message"`
	// Any of "environment_archived_error", "agent_archived_error",
	// "environment_not_found_error", "vault_not_found_error", "vault_archived_error",
	// "file_not_found_error", "memory_store_archived_error", "track_not_found_error",
	// "session_resource_not_found_error", "workspace_archived_error",
	// "organization_disabled_error", "session_rate_limited_error",
	// "session_creation_rejected_error", "unknown_error",
	// "self_hosted_resources_unsupported_error", "mcp_egress_blocked_error".
	Type string `json:"type"`
	JSON struct {
		Message respjson.Field
		Type    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsDeploymentRunErrorUnion contains all possible properties and values from BetaManagedAgentsEnvironmentArchivedRunError, BetaManagedAgentsAgentArchivedRunError, BetaManagedAgentsEnvironmentNotFoundRunError, BetaManagedAgentsVaultNotFoundRunError, BetaManagedAgentsVaultArchivedRunError, BetaManagedAgentsFileNotFoundRunError, BetaManagedAgentsMemoryStoreArchivedRunError, BetaManagedAgentsTrackNotFoundRunError, BetaManagedAgentsSessionResourceNotFoundRunError, BetaManagedAgentsWorkspaceArchivedRunError, BetaManagedAgentsOrganizationDisabledRunError, BetaManagedAgentsSessionRateLimitedRunError, BetaManagedAgentsSessionCreationRejectedRunError, BetaManagedAgentsUnknownRunError, BetaManagedAgentsSelfHostedResourcesUnsupportedRunError, BetaManagedAgentsMCPEgressBlockedRunError.

Use the BetaManagedAgentsDeploymentRunErrorUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsDeploymentRunErrorUnion) AsAgentArchivedError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsAny

func (u BetaManagedAgentsDeploymentRunErrorUnion) AsAny() anyBetaManagedAgentsDeploymentRunError

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsDeploymentRunErrorUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsEnvironmentArchivedRunError:
case Juglow.BetaManagedAgentsAgentArchivedRunError:
case Juglow.BetaManagedAgentsEnvironmentNotFoundRunError:
case Juglow.BetaManagedAgentsVaultNotFoundRunError:
case Juglow.BetaManagedAgentsVaultArchivedRunError:
case Juglow.BetaManagedAgentsFileNotFoundRunError:
case Juglow.BetaManagedAgentsMemoryStoreArchivedRunError:
case Juglow.BetaManagedAgentsTrackNotFoundRunError:
case Juglow.BetaManagedAgentsSessionResourceNotFoundRunError:
case Juglow.BetaManagedAgentsWorkspaceArchivedRunError:
case Juglow.BetaManagedAgentsOrganizationDisabledRunError:
case Juglow.BetaManagedAgentsSessionRateLimitedRunError:
case Juglow.BetaManagedAgentsSessionCreationRejectedRunError:
case Juglow.BetaManagedAgentsUnknownRunError:
case Juglow.BetaManagedAgentsSelfHostedResourcesUnsupportedRunError:
case Juglow.BetaManagedAgentsMCPEgressBlockedRunError:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsDeploymentRunErrorUnion) AsEnvironmentArchivedError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsEnvironmentNotFoundError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsFileNotFoundError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsMCPEgressBlockedError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsMemoryStoreArchivedError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsOrganizationDisabledError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsSelfHostedResourcesUnsupportedError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsSessionCreationRejectedError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsSessionRateLimitedError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsSessionResourceNotFoundError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsTrackNotFoundError added in v1.71.2

func (BetaManagedAgentsDeploymentRunErrorUnion) AsUnknownError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsVaultArchivedError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsVaultNotFoundError

func (BetaManagedAgentsDeploymentRunErrorUnion) AsWorkspaceArchivedError

func (BetaManagedAgentsDeploymentRunErrorUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentRunErrorUnion) UnmarshalJSON

func (r *BetaManagedAgentsDeploymentRunErrorUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeploymentRunType

type BetaManagedAgentsDeploymentRunType string
const (
	BetaManagedAgentsDeploymentRunTypeDeploymentRun BetaManagedAgentsDeploymentRunType = "deployment_run"
)

type BetaManagedAgentsDeploymentStatus

type BetaManagedAgentsDeploymentStatus string

Lifecycle status of a deployment.

const (
	BetaManagedAgentsDeploymentStatusActive BetaManagedAgentsDeploymentStatus = "active"
	BetaManagedAgentsDeploymentStatusPaused BetaManagedAgentsDeploymentStatus = "paused"
)

type BetaManagedAgentsDeploymentSystemMessageEvent

type BetaManagedAgentsDeploymentSystemMessageEvent struct {
	// System content blocks to append. Text-only.
	Content []BetaManagedAgentsSystemContentBlock `json:"content" api:"required"`
	// Any of "system.message".
	Type BetaManagedAgentsDeploymentSystemMessageEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt.

func (BetaManagedAgentsDeploymentSystemMessageEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentSystemMessageEvent) UnmarshalJSON

func (r *BetaManagedAgentsDeploymentSystemMessageEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeploymentSystemMessageEventType

type BetaManagedAgentsDeploymentSystemMessageEventType string
const (
	BetaManagedAgentsDeploymentSystemMessageEventTypeSystemMessage BetaManagedAgentsDeploymentSystemMessageEventType = "system.message"
)

type BetaManagedAgentsDeploymentType

type BetaManagedAgentsDeploymentType string
const (
	BetaManagedAgentsDeploymentTypeDeployment BetaManagedAgentsDeploymentType = "deployment"
)

type BetaManagedAgentsDeploymentUserDefineOutcomeEvent

type BetaManagedAgentsDeploymentUserDefineOutcomeEvent struct {
	// What the agent should produce. This is the task specification.
	Description string `json:"description" api:"required"`
	// Rubric for grading the quality of an outcome.
	Rubric BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion `json:"rubric" api:"required"`
	// Any of "user.define_outcome".
	Type BetaManagedAgentsDeploymentUserDefineOutcomeEventType `json:"type" api:"required"`
	// Eval→revision cycles before giving up. Default 3, max 20.
	MaxIterations int64 `json:"max_iterations" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description   respjson.Field
		Rubric        respjson.Field
		Type          respjson.Field
		MaxIterations respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An outcome the agent should work toward. The agent begins work on receipt.

func (BetaManagedAgentsDeploymentUserDefineOutcomeEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentUserDefineOutcomeEvent) UnmarshalJSON

type BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion

type BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion struct {
	// This field is from variant [BetaManagedAgentsFileRubric].
	FileID string `json:"file_id"`
	// Any of "file", "text".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsTextRubric].
	Content string `json:"content"`
	JSON    struct {
		FileID  respjson.Field
		Type    respjson.Field
		Content respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion contains all possible properties and values from BetaManagedAgentsFileRubric, BetaManagedAgentsTextRubric.

Use the BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion) AsAny

func (u BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion) AsAny() anyBetaManagedAgentsDeploymentUserDefineOutcomeEventRubric

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsFileRubric:
case Juglow.BetaManagedAgentsTextRubric:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion) AsFile

func (BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion) AsText

func (BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentUserDefineOutcomeEventRubricUnion) UnmarshalJSON

type BetaManagedAgentsDeploymentUserDefineOutcomeEventType

type BetaManagedAgentsDeploymentUserDefineOutcomeEventType string
const (
	BetaManagedAgentsDeploymentUserDefineOutcomeEventTypeUserDefineOutcome BetaManagedAgentsDeploymentUserDefineOutcomeEventType = "user.define_outcome"
)

type BetaManagedAgentsDeploymentUserMessageEvent

type BetaManagedAgentsDeploymentUserMessageEvent struct {
	// Array of content blocks for the user message.
	Content []BetaManagedAgentsDeploymentUserMessageEventContentUnion `json:"content" api:"required"`
	// Any of "user.message".
	Type BetaManagedAgentsDeploymentUserMessageEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A user message sent to the session.

func (BetaManagedAgentsDeploymentUserMessageEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentUserMessageEvent) UnmarshalJSON

func (r *BetaManagedAgentsDeploymentUserMessageEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDeploymentUserMessageEventContentUnion

type BetaManagedAgentsDeploymentUserMessageEventContentUnion struct {
	// This field is from variant [BetaManagedAgentsTextBlock].
	Text string `json:"text"`
	// Any of "text", "image", "document", "redacted".
	Type string `json:"type"`
	// This field is a union of [BetaManagedAgentsImageBlockSourceUnion],
	// [BetaManagedAgentsDocumentBlockSourceUnion]
	Source BetaManagedAgentsDeploymentUserMessageEventContentUnionSource `json:"source"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Context string `json:"context"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Title string `json:"title"`
	JSON  struct {
		Text    respjson.Field
		Type    respjson.Field
		Source  respjson.Field
		Context respjson.Field
		Title   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsDeploymentUserMessageEventContentUnion contains all possible properties and values from BetaManagedAgentsTextBlock, BetaManagedAgentsImageBlock, BetaManagedAgentsDocumentBlock, BetaManagedAgentsRedactedBlock.

Use the BetaManagedAgentsDeploymentUserMessageEventContentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsDeploymentUserMessageEventContentUnion) AsAny

func (u BetaManagedAgentsDeploymentUserMessageEventContentUnion) AsAny() anyBetaManagedAgentsDeploymentUserMessageEventContent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsDeploymentUserMessageEventContentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTextBlock:
case Juglow.BetaManagedAgentsImageBlock:
case Juglow.BetaManagedAgentsDocumentBlock:
case Juglow.BetaManagedAgentsRedactedBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsDeploymentUserMessageEventContentUnion) AsDocument

func (BetaManagedAgentsDeploymentUserMessageEventContentUnion) AsImage

func (BetaManagedAgentsDeploymentUserMessageEventContentUnion) AsRedacted

func (BetaManagedAgentsDeploymentUserMessageEventContentUnion) AsText

func (BetaManagedAgentsDeploymentUserMessageEventContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDeploymentUserMessageEventContentUnion) UnmarshalJSON

type BetaManagedAgentsDeploymentUserMessageEventContentUnionSource

type BetaManagedAgentsDeploymentUserMessageEventContentUnionSource struct {
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	FileID    string `json:"file_id"`
	JSON      struct {
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsDeploymentUserMessageEventContentUnionSource is an implicit subunion of BetaManagedAgentsDeploymentUserMessageEventContentUnion. BetaManagedAgentsDeploymentUserMessageEventContentUnionSource provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsDeploymentUserMessageEventContentUnion.

func (*BetaManagedAgentsDeploymentUserMessageEventContentUnionSource) UnmarshalJSON

type BetaManagedAgentsDeploymentUserMessageEventType

type BetaManagedAgentsDeploymentUserMessageEventType string
const (
	BetaManagedAgentsDeploymentUserMessageEventTypeUserMessage BetaManagedAgentsDeploymentUserMessageEventType = "user.message"
)

type BetaManagedAgentsDocumentBlock

type BetaManagedAgentsDocumentBlock struct {
	// Union type for document source variants.
	Source BetaManagedAgentsDocumentBlockSourceUnion `json:"source" api:"required"`
	// Any of "document".
	Type BetaManagedAgentsDocumentBlockType `json:"type" api:"required"`
	// Additional context about the document for the model.
	Context string `json:"context" api:"nullable"`
	// The title of the document.
	Title string `json:"title" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Source      respjson.Field
		Type        respjson.Field
		Context     respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Document content, either specified directly as base64 data, as text, or as a reference via a URL.

func (BetaManagedAgentsDocumentBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsDocumentBlock) ToParam

ToParam converts this BetaManagedAgentsDocumentBlock to a BetaManagedAgentsDocumentBlockParam.

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 BetaManagedAgentsDocumentBlockParam.Overrides()

func (*BetaManagedAgentsDocumentBlock) UnmarshalJSON

func (r *BetaManagedAgentsDocumentBlock) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDocumentBlockParam

type BetaManagedAgentsDocumentBlockParam struct {
	// Union type for document source variants.
	Source BetaManagedAgentsDocumentBlockSourceUnionParam `json:"source,omitzero" api:"required"`
	// Any of "document".
	Type BetaManagedAgentsDocumentBlockType `json:"type,omitzero" api:"required"`
	// Additional context about the document for the model.
	Context param.Opt[string] `json:"context,omitzero"`
	// The title of the document.
	Title param.Opt[string] `json:"title,omitzero"`
	// contains filtered or unexported fields
}

Document content, either specified directly as base64 data, as text, or as a reference via a URL.

The properties Source, Type are required.

func (BetaManagedAgentsDocumentBlockParam) MarshalJSON

func (r BetaManagedAgentsDocumentBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsDocumentBlockParam) UnmarshalJSON

func (r *BetaManagedAgentsDocumentBlockParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDocumentBlockSourceUnion

type BetaManagedAgentsDocumentBlockSourceUnion struct {
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	// Any of "base64", "text", "url", "file".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsURLDocumentSource].
	URL string `json:"url"`
	// This field is from variant [BetaManagedAgentsFileDocumentSource].
	FileID string `json:"file_id"`
	JSON   struct {
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsDocumentBlockSourceUnion contains all possible properties and values from BetaManagedAgentsBase64DocumentSource, BetaManagedAgentsPlainTextDocumentSource, BetaManagedAgentsURLDocumentSource, BetaManagedAgentsFileDocumentSource.

Use the BetaManagedAgentsDocumentBlockSourceUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsDocumentBlockSourceUnion) AsAny

func (u BetaManagedAgentsDocumentBlockSourceUnion) AsAny() anyBetaManagedAgentsDocumentBlockSource

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsDocumentBlockSourceUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsBase64DocumentSource:
case Juglow.BetaManagedAgentsPlainTextDocumentSource:
case Juglow.BetaManagedAgentsURLDocumentSource:
case Juglow.BetaManagedAgentsFileDocumentSource:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsDocumentBlockSourceUnion) AsBase64

func (BetaManagedAgentsDocumentBlockSourceUnion) AsFile

func (BetaManagedAgentsDocumentBlockSourceUnion) AsText

func (BetaManagedAgentsDocumentBlockSourceUnion) AsURL

func (BetaManagedAgentsDocumentBlockSourceUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsDocumentBlockSourceUnion) UnmarshalJSON

func (r *BetaManagedAgentsDocumentBlockSourceUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsDocumentBlockSourceUnionParam

type BetaManagedAgentsDocumentBlockSourceUnionParam struct {
	OfBase64 *BetaManagedAgentsBase64DocumentSourceParam    `json:",omitzero,inline"`
	OfText   *BetaManagedAgentsPlainTextDocumentSourceParam `json:",omitzero,inline"`
	OfURL    *BetaManagedAgentsURLDocumentSourceParam       `json:",omitzero,inline"`
	OfFile   *BetaManagedAgentsFileDocumentSourceParam      `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 (BetaManagedAgentsDocumentBlockSourceUnionParam) GetData

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsDocumentBlockSourceUnionParam) GetFileID

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsDocumentBlockSourceUnionParam) GetMediaType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsDocumentBlockSourceUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsDocumentBlockSourceUnionParam) GetURL

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsDocumentBlockSourceUnionParam) MarshalJSON

func (*BetaManagedAgentsDocumentBlockSourceUnionParam) UnmarshalJSON

type BetaManagedAgentsDocumentBlockType

type BetaManagedAgentsDocumentBlockType string
const (
	BetaManagedAgentsDocumentBlockTypeDocument BetaManagedAgentsDocumentBlockType = "document"
)

type BetaManagedAgentsEffortHigh

type BetaManagedAgentsEffortHigh struct {
	// Any of "high".
	Type BetaManagedAgentsEffortHighType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

High effort. Favors reasoning depth.

func (BetaManagedAgentsEffortHigh) RawJSON

func (r BetaManagedAgentsEffortHigh) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaManagedAgentsEffortHigh) ToParam

ToParam converts this BetaManagedAgentsEffortHigh to a BetaManagedAgentsEffortHighParam.

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 BetaManagedAgentsEffortHighParam.Overrides()

func (*BetaManagedAgentsEffortHigh) UnmarshalJSON

func (r *BetaManagedAgentsEffortHigh) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortHighParam

type BetaManagedAgentsEffortHighParam struct {
	// Any of "high".
	Type BetaManagedAgentsEffortHighType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

High effort. Favors reasoning depth.

The property Type is required.

func (BetaManagedAgentsEffortHighParam) MarshalJSON

func (r BetaManagedAgentsEffortHighParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsEffortHighParam) UnmarshalJSON

func (r *BetaManagedAgentsEffortHighParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortHighType

type BetaManagedAgentsEffortHighType string
const (
	BetaManagedAgentsEffortHighTypeHigh BetaManagedAgentsEffortHighType = "high"
)

type BetaManagedAgentsEffortLow

type BetaManagedAgentsEffortLow struct {
	// Any of "low".
	Type BetaManagedAgentsEffortLowType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Low effort. Favors latency over reasoning depth.

func (BetaManagedAgentsEffortLow) RawJSON

func (r BetaManagedAgentsEffortLow) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaManagedAgentsEffortLow) ToParam

ToParam converts this BetaManagedAgentsEffortLow to a BetaManagedAgentsEffortLowParam.

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 BetaManagedAgentsEffortLowParam.Overrides()

func (*BetaManagedAgentsEffortLow) UnmarshalJSON

func (r *BetaManagedAgentsEffortLow) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortLowParam

type BetaManagedAgentsEffortLowParam struct {
	// Any of "low".
	Type BetaManagedAgentsEffortLowType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Low effort. Favors latency over reasoning depth.

The property Type is required.

func (BetaManagedAgentsEffortLowParam) MarshalJSON

func (r BetaManagedAgentsEffortLowParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsEffortLowParam) UnmarshalJSON

func (r *BetaManagedAgentsEffortLowParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortLowType

type BetaManagedAgentsEffortLowType string
const (
	BetaManagedAgentsEffortLowTypeLow BetaManagedAgentsEffortLowType = "low"
)

type BetaManagedAgentsEffortMax

type BetaManagedAgentsEffortMax struct {
	// Any of "max".
	Type BetaManagedAgentsEffortMaxType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Maximum effort. Favors reasoning depth over latency.

func (BetaManagedAgentsEffortMax) RawJSON

func (r BetaManagedAgentsEffortMax) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaManagedAgentsEffortMax) ToParam

ToParam converts this BetaManagedAgentsEffortMax to a BetaManagedAgentsEffortMaxParam.

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 BetaManagedAgentsEffortMaxParam.Overrides()

func (*BetaManagedAgentsEffortMax) UnmarshalJSON

func (r *BetaManagedAgentsEffortMax) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortMaxParam

type BetaManagedAgentsEffortMaxParam struct {
	// Any of "max".
	Type BetaManagedAgentsEffortMaxType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Maximum effort. Favors reasoning depth over latency.

The property Type is required.

func (BetaManagedAgentsEffortMaxParam) MarshalJSON

func (r BetaManagedAgentsEffortMaxParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsEffortMaxParam) UnmarshalJSON

func (r *BetaManagedAgentsEffortMaxParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortMaxType

type BetaManagedAgentsEffortMaxType string
const (
	BetaManagedAgentsEffortMaxTypeMax BetaManagedAgentsEffortMaxType = "max"
)

type BetaManagedAgentsEffortMedium

type BetaManagedAgentsEffortMedium struct {
	// Any of "medium".
	Type BetaManagedAgentsEffortMediumType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Medium effort. Balances latency and reasoning depth.

func (BetaManagedAgentsEffortMedium) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsEffortMedium) ToParam

ToParam converts this BetaManagedAgentsEffortMedium to a BetaManagedAgentsEffortMediumParam.

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 BetaManagedAgentsEffortMediumParam.Overrides()

func (*BetaManagedAgentsEffortMedium) UnmarshalJSON

func (r *BetaManagedAgentsEffortMedium) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortMediumParam

type BetaManagedAgentsEffortMediumParam struct {
	// Any of "medium".
	Type BetaManagedAgentsEffortMediumType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Medium effort. Balances latency and reasoning depth.

The property Type is required.

func (BetaManagedAgentsEffortMediumParam) MarshalJSON

func (r BetaManagedAgentsEffortMediumParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsEffortMediumParam) UnmarshalJSON

func (r *BetaManagedAgentsEffortMediumParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortMediumType

type BetaManagedAgentsEffortMediumType string
const (
	BetaManagedAgentsEffortMediumTypeMedium BetaManagedAgentsEffortMediumType = "medium"
)

type BetaManagedAgentsEffortXhigh

type BetaManagedAgentsEffortXhigh struct {
	// Any of "xhigh".
	Type BetaManagedAgentsEffortXhighType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Extra-high effort. Not all models accept this level.

func (BetaManagedAgentsEffortXhigh) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsEffortXhigh) ToParam

ToParam converts this BetaManagedAgentsEffortXhigh to a BetaManagedAgentsEffortXhighParam.

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 BetaManagedAgentsEffortXhighParam.Overrides()

func (*BetaManagedAgentsEffortXhigh) UnmarshalJSON

func (r *BetaManagedAgentsEffortXhigh) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortXhighParam

type BetaManagedAgentsEffortXhighParam struct {
	// Any of "xhigh".
	Type BetaManagedAgentsEffortXhighType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Extra-high effort. Not all models accept this level.

The property Type is required.

func (BetaManagedAgentsEffortXhighParam) MarshalJSON

func (r BetaManagedAgentsEffortXhighParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsEffortXhighParam) UnmarshalJSON

func (r *BetaManagedAgentsEffortXhighParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEffortXhighType

type BetaManagedAgentsEffortXhighType string
const (
	BetaManagedAgentsEffortXhighTypeXhigh BetaManagedAgentsEffortXhighType = "xhigh"
)

type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError

type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError struct {
	// Any of "environment_archived_error".
	Type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's environment was archived.

func (BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType

type BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorTypeEnvironmentArchivedError BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonErrorType = "environment_archived_error"
)

type BetaManagedAgentsEnvironmentArchivedRunError

type BetaManagedAgentsEnvironmentArchivedRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "environment_archived_error".
	Type BetaManagedAgentsEnvironmentArchivedRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's environment was archived.

func (BetaManagedAgentsEnvironmentArchivedRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsEnvironmentArchivedRunError) UnmarshalJSON

func (r *BetaManagedAgentsEnvironmentArchivedRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEnvironmentArchivedRunErrorType

type BetaManagedAgentsEnvironmentArchivedRunErrorType string
const (
	BetaManagedAgentsEnvironmentArchivedRunErrorTypeEnvironmentArchivedError BetaManagedAgentsEnvironmentArchivedRunErrorType = "environment_archived_error"
)

type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError

type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError struct {
	// Any of "environment_not_found_error".
	Type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's environment no longer exists.

func (BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType

type BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorTypeEnvironmentNotFoundError BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonErrorType = "environment_not_found_error"
)

type BetaManagedAgentsEnvironmentNotFoundRunError

type BetaManagedAgentsEnvironmentNotFoundRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "environment_not_found_error".
	Type BetaManagedAgentsEnvironmentNotFoundRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's environment no longer exists.

func (BetaManagedAgentsEnvironmentNotFoundRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsEnvironmentNotFoundRunError) UnmarshalJSON

func (r *BetaManagedAgentsEnvironmentNotFoundRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsEnvironmentNotFoundRunErrorType

type BetaManagedAgentsEnvironmentNotFoundRunErrorType string
const (
	BetaManagedAgentsEnvironmentNotFoundRunErrorTypeEnvironmentNotFoundError BetaManagedAgentsEnvironmentNotFoundRunErrorType = "environment_not_found_error"
)

type BetaManagedAgentsEnvironmentVariableAuthResponse

type BetaManagedAgentsEnvironmentVariableAuthResponse struct {
	// Where in the outbound request the secret value is substituted.
	InjectionLocation BetaManagedAgentsInjectionLocationResponse `json:"injection_location" api:"required"`
	// Outbound hosts the secret value is substituted on.
	Networking BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion `json:"networking" api:"required"`
	// Name of the environment variable.
	SecretName string `json:"secret_name" api:"required"`
	// Any of "environment_variable".
	Type BetaManagedAgentsEnvironmentVariableAuthResponseType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		InjectionLocation respjson.Field
		Networking        respjson.Field
		SecretName        respjson.Field
		Type              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Environment variable credential details. The secret value is never returned.

func (BetaManagedAgentsEnvironmentVariableAuthResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsEnvironmentVariableAuthResponse) UnmarshalJSON

type BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion

type BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion struct {
	// Any of "unrestricted", "limited".
	Type string `json:"type"`
	// This field is from variant
	// [BetaManagedAgentsLimitedCredentialNetworkingResponse].
	AllowedHosts []string `json:"allowed_hosts"`
	JSON         struct {
		Type         respjson.Field
		AllowedHosts respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion contains all possible properties and values from BetaManagedAgentsUnrestrictedCredentialNetworkingResponse, BetaManagedAgentsLimitedCredentialNetworkingResponse.

Use the BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion) AsAny

func (u BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion) AsAny() anyBetaManagedAgentsEnvironmentVariableAuthResponseNetworking

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsUnrestrictedCredentialNetworkingResponse:
case Juglow.BetaManagedAgentsLimitedCredentialNetworkingResponse:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion) AsLimited

func (BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion) AsUnrestricted

func (BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsEnvironmentVariableAuthResponseNetworkingUnion) UnmarshalJSON

type BetaManagedAgentsEnvironmentVariableAuthResponseType

type BetaManagedAgentsEnvironmentVariableAuthResponseType string
const (
	BetaManagedAgentsEnvironmentVariableAuthResponseTypeEnvironmentVariable BetaManagedAgentsEnvironmentVariableAuthResponseType = "environment_variable"
)

type BetaManagedAgentsEnvironmentVariableCreateParams

type BetaManagedAgentsEnvironmentVariableCreateParams struct {
	// Outbound hosts the secret value is substituted on.
	Networking BetaManagedAgentsCredentialNetworkingParamsUnion `json:"networking,omitzero" api:"required"`
	// Name of the environment variable. Immutable after create.
	SecretName string `json:"secret_name" api:"required"`
	// Secret value. Write-only; never returned in responses.
	SecretValue string `json:"secret_value" api:"required"`
	// Any of "environment_variable".
	Type BetaManagedAgentsEnvironmentVariableCreateParamsType `json:"type,omitzero" api:"required"`
	// Where in the outbound request the secret value may be substituted.
	InjectionLocation BetaManagedAgentsInjectionLocationParams `json:"injection_location,omitzero"`
	// contains filtered or unexported fields
}

Parameters for creating an environment variable credential.

The properties Networking, SecretName, SecretValue, Type are required.

func (BetaManagedAgentsEnvironmentVariableCreateParams) MarshalJSON

func (r BetaManagedAgentsEnvironmentVariableCreateParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsEnvironmentVariableCreateParams) UnmarshalJSON

type BetaManagedAgentsEnvironmentVariableCreateParamsType

type BetaManagedAgentsEnvironmentVariableCreateParamsType string
const (
	BetaManagedAgentsEnvironmentVariableCreateParamsTypeEnvironmentVariable BetaManagedAgentsEnvironmentVariableCreateParamsType = "environment_variable"
)

type BetaManagedAgentsEnvironmentVariableUpdateParams

type BetaManagedAgentsEnvironmentVariableUpdateParams struct {
	// Any of "environment_variable".
	Type BetaManagedAgentsEnvironmentVariableUpdateParamsType `json:"type,omitzero" api:"required"`
	// Updated secret value.
	SecretValue param.Opt[string] `json:"secret_value,omitzero"`
	// Updated injection location.
	InjectionLocation BetaManagedAgentsInjectionLocationUpdateParams `json:"injection_location,omitzero"`
	// Updated networking scope. Full replacement.
	Networking BetaManagedAgentsCredentialNetworkingParamsUnion `json:"networking,omitzero"`
	// contains filtered or unexported fields
}

Parameters for updating an environment variable credential. `secret_name` is immutable.

The property Type is required.

func (BetaManagedAgentsEnvironmentVariableUpdateParams) MarshalJSON

func (r BetaManagedAgentsEnvironmentVariableUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsEnvironmentVariableUpdateParams) UnmarshalJSON

type BetaManagedAgentsEnvironmentVariableUpdateParamsType

type BetaManagedAgentsEnvironmentVariableUpdateParamsType string
const (
	BetaManagedAgentsEnvironmentVariableUpdateParamsTypeEnvironmentVariable BetaManagedAgentsEnvironmentVariableUpdateParamsType = "environment_variable"
)

type BetaManagedAgentsErrorDeploymentPausedReason

type BetaManagedAgentsErrorDeploymentPausedReason struct {
	// The error that triggered an auto-pause. Matches the failed run's `error.type`.
	Error BetaManagedAgentsDeploymentPausedReasonErrorUnion `json:"error" api:"required"`
	// Any of "error".
	Type BetaManagedAgentsErrorDeploymentPausedReasonType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Error       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A scheduled fire recorded a failed run whose error auto-pauses the deployment.

func (BetaManagedAgentsErrorDeploymentPausedReason) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsErrorDeploymentPausedReason) UnmarshalJSON

func (r *BetaManagedAgentsErrorDeploymentPausedReason) UnmarshalJSON(data []byte) error

type BetaManagedAgentsErrorDeploymentPausedReasonType

type BetaManagedAgentsErrorDeploymentPausedReasonType string
const (
	BetaManagedAgentsErrorDeploymentPausedReasonTypeError BetaManagedAgentsErrorDeploymentPausedReasonType = "error"
)

type BetaManagedAgentsEventAccumulator

type BetaManagedAgentsEventAccumulator struct {
	// AgentMessages holds one snapshot per event id. Reconciled canonical
	// agent.message events persist across model requests; unreconciled previews
	// are dropped at span.model_request_end because the server will never
	// complete them. The buffered event stream is the authoritative transcript.
	AgentMessages map[string]BetaManagedAgentsAgentMessageEvent
}

BetaManagedAgentsEventAccumulator folds event_start / event_delta preview events into per-event-id agent.message snapshots. The zero value is ready to use.

var previews Juglow.BetaManagedAgentsEventAccumulator
for stream.Next() {
	event := stream.Current()
	previews.Accumulate(event)

	if event.Type == "event_delta" {
		fmt.Print(previews.AgentMessageText(event.EventID))
	}
}

func (*BetaManagedAgentsEventAccumulator) Accumulate

func (*BetaManagedAgentsEventAccumulator) AgentMessageText

func (acc *BetaManagedAgentsEventAccumulator) AgentMessageText(eventID string) string

type BetaManagedAgentsEventParamsUnion

type BetaManagedAgentsEventParamsUnion struct {
	OfUserMessage          *BetaManagedAgentsUserMessageEventParams          `json:",omitzero,inline"`
	OfUserInterrupt        *BetaManagedAgentsUserInterruptEventParams        `json:",omitzero,inline"`
	OfUserToolConfirmation *BetaManagedAgentsUserToolConfirmationEventParams `json:",omitzero,inline"`
	OfUserCustomToolResult *BetaManagedAgentsUserCustomToolResultEventParams `json:",omitzero,inline"`
	OfUserDefineOutcome    *BetaManagedAgentsUserDefineOutcomeEventParams    `json:",omitzero,inline"`
	OfUserToolResult       *BetaManagedAgentsUserToolResultEventParams       `json:",omitzero,inline"`
	OfSystemMessage        *BetaManagedAgentsSystemMessageEventParams        `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 BetaManagedAgentsEventParamsOfUserCustomToolResult

func BetaManagedAgentsEventParamsOfUserCustomToolResult(customToolUseID string) BetaManagedAgentsEventParamsUnion

func BetaManagedAgentsEventParamsOfUserToolResult

func BetaManagedAgentsEventParamsOfUserToolResult(toolUseID string) BetaManagedAgentsEventParamsUnion

func (BetaManagedAgentsEventParamsUnion) GetContent

func (u BetaManagedAgentsEventParamsUnion) GetContent() (res betaManagedAgentsEventParamsUnionContent)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaManagedAgentsEventParamsUnion) GetCustomToolUseID

func (u BetaManagedAgentsEventParamsUnion) GetCustomToolUseID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) GetDenyMessage

func (u BetaManagedAgentsEventParamsUnion) GetDenyMessage() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) GetDescription

func (u BetaManagedAgentsEventParamsUnion) GetDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) GetIsError

func (u BetaManagedAgentsEventParamsUnion) GetIsError() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) GetMaxIterations

func (u BetaManagedAgentsEventParamsUnion) GetMaxIterations() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) GetResult

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) GetRubric

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) GetSessionThreadID

func (u BetaManagedAgentsEventParamsUnion) GetSessionThreadID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) GetToolUseID

func (u BetaManagedAgentsEventParamsUnion) GetToolUseID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsEventParamsUnion) MarshalJSON

func (u BetaManagedAgentsEventParamsUnion) MarshalJSON() ([]byte, error)

func (*BetaManagedAgentsEventParamsUnion) UnmarshalJSON

func (u *BetaManagedAgentsEventParamsUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileDocumentSource

type BetaManagedAgentsFileDocumentSource struct {
	// ID of a previously uploaded file.
	FileID string `json:"file_id" api:"required"`
	// Any of "file".
	Type BetaManagedAgentsFileDocumentSourceType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Document referenced by file ID.

func (BetaManagedAgentsFileDocumentSource) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsFileDocumentSource) ToParam

ToParam converts this BetaManagedAgentsFileDocumentSource to a BetaManagedAgentsFileDocumentSourceParam.

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 BetaManagedAgentsFileDocumentSourceParam.Overrides()

func (*BetaManagedAgentsFileDocumentSource) UnmarshalJSON

func (r *BetaManagedAgentsFileDocumentSource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileDocumentSourceParam

type BetaManagedAgentsFileDocumentSourceParam struct {
	// ID of a previously uploaded file.
	FileID string `json:"file_id" api:"required"`
	// Any of "file".
	Type BetaManagedAgentsFileDocumentSourceType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Document referenced by file ID.

The properties FileID, Type are required.

func (BetaManagedAgentsFileDocumentSourceParam) MarshalJSON

func (r BetaManagedAgentsFileDocumentSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsFileDocumentSourceParam) UnmarshalJSON

func (r *BetaManagedAgentsFileDocumentSourceParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileDocumentSourceType

type BetaManagedAgentsFileDocumentSourceType string
const (
	BetaManagedAgentsFileDocumentSourceTypeFile BetaManagedAgentsFileDocumentSourceType = "file"
)

type BetaManagedAgentsFileImageSource

type BetaManagedAgentsFileImageSource struct {
	// ID of a previously uploaded file.
	FileID string `json:"file_id" api:"required"`
	// Any of "file".
	Type BetaManagedAgentsFileImageSourceType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Image referenced by file ID.

func (BetaManagedAgentsFileImageSource) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsFileImageSource) ToParam

ToParam converts this BetaManagedAgentsFileImageSource to a BetaManagedAgentsFileImageSourceParam.

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 BetaManagedAgentsFileImageSourceParam.Overrides()

func (*BetaManagedAgentsFileImageSource) UnmarshalJSON

func (r *BetaManagedAgentsFileImageSource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileImageSourceParam

type BetaManagedAgentsFileImageSourceParam struct {
	// ID of a previously uploaded file.
	FileID string `json:"file_id" api:"required"`
	// Any of "file".
	Type BetaManagedAgentsFileImageSourceType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Image referenced by file ID.

The properties FileID, Type are required.

func (BetaManagedAgentsFileImageSourceParam) MarshalJSON

func (r BetaManagedAgentsFileImageSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsFileImageSourceParam) UnmarshalJSON

func (r *BetaManagedAgentsFileImageSourceParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileImageSourceType

type BetaManagedAgentsFileImageSourceType string
const (
	BetaManagedAgentsFileImageSourceTypeFile BetaManagedAgentsFileImageSourceType = "file"
)

type BetaManagedAgentsFileNotFoundDeploymentPausedReasonError

type BetaManagedAgentsFileNotFoundDeploymentPausedReasonError struct {
	// Any of "file_not_found_error".
	Type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A file resource referenced by the deployment no longer exists.

func (BetaManagedAgentsFileNotFoundDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsFileNotFoundDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType

type BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorTypeFileNotFoundError BetaManagedAgentsFileNotFoundDeploymentPausedReasonErrorType = "file_not_found_error"
)

type BetaManagedAgentsFileNotFoundRunError

type BetaManagedAgentsFileNotFoundRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "file_not_found_error".
	Type BetaManagedAgentsFileNotFoundRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A file resource referenced by the deployment no longer exists.

func (BetaManagedAgentsFileNotFoundRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsFileNotFoundRunError) UnmarshalJSON

func (r *BetaManagedAgentsFileNotFoundRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileNotFoundRunErrorType

type BetaManagedAgentsFileNotFoundRunErrorType string
const (
	BetaManagedAgentsFileNotFoundRunErrorTypeFileNotFoundError BetaManagedAgentsFileNotFoundRunErrorType = "file_not_found_error"
)

type BetaManagedAgentsFileResource

type BetaManagedAgentsFileResource struct {
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	FileID    string    `json:"file_id" api:"required"`
	MountPath string    `json:"mount_path" api:"required"`
	// Any of "file".
	Type BetaManagedAgentsFileResourceType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		FileID      respjson.Field
		MountPath   respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaManagedAgentsFileResource) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsFileResource) UnmarshalJSON

func (r *BetaManagedAgentsFileResource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileResourceConfig

type BetaManagedAgentsFileResourceConfig struct {
	// ID of a previously uploaded file.
	FileID string `json:"file_id" api:"required"`
	// Any of "file".
	Type BetaManagedAgentsFileResourceConfigType `json:"type" api:"required"`
	// Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.
	MountPath string `json:"mount_path" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		MountPath   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A file mounted into each session's container.

func (BetaManagedAgentsFileResourceConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsFileResourceConfig) UnmarshalJSON

func (r *BetaManagedAgentsFileResourceConfig) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileResourceConfigType

type BetaManagedAgentsFileResourceConfigType string
const (
	BetaManagedAgentsFileResourceConfigTypeFile BetaManagedAgentsFileResourceConfigType = "file"
)

type BetaManagedAgentsFileResourceParams

type BetaManagedAgentsFileResourceParams struct {
	// ID of a previously uploaded file.
	FileID string `json:"file_id" api:"required"`
	// Any of "file".
	Type BetaManagedAgentsFileResourceParamsType `json:"type,omitzero" api:"required"`
	// Mount path in the container. Defaults to `/mnt/session/uploads/<file_id>`.
	MountPath param.Opt[string] `json:"mount_path,omitzero"`
	// contains filtered or unexported fields
}

Mount a file uploaded via the Files API into the session.

The properties FileID, Type are required.

func (BetaManagedAgentsFileResourceParams) MarshalJSON

func (r BetaManagedAgentsFileResourceParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsFileResourceParams) UnmarshalJSON

func (r *BetaManagedAgentsFileResourceParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileResourceParamsType

type BetaManagedAgentsFileResourceParamsType string
const (
	BetaManagedAgentsFileResourceParamsTypeFile BetaManagedAgentsFileResourceParamsType = "file"
)

type BetaManagedAgentsFileResourceType

type BetaManagedAgentsFileResourceType string
const (
	BetaManagedAgentsFileResourceTypeFile BetaManagedAgentsFileResourceType = "file"
)

type BetaManagedAgentsFileRubric

type BetaManagedAgentsFileRubric struct {
	// ID of the rubric file.
	FileID string `json:"file_id" api:"required"`
	// Any of "file".
	Type BetaManagedAgentsFileRubricType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Rubric referenced by a file uploaded via the Files API.

func (BetaManagedAgentsFileRubric) RawJSON

func (r BetaManagedAgentsFileRubric) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsFileRubric) UnmarshalJSON

func (r *BetaManagedAgentsFileRubric) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileRubricParams

type BetaManagedAgentsFileRubricParams struct {
	// ID of the rubric file.
	FileID string `json:"file_id" api:"required"`
	// Any of "file".
	Type BetaManagedAgentsFileRubricParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Rubric referenced by a file uploaded via the Files API.

The properties FileID, Type are required.

func (BetaManagedAgentsFileRubricParams) MarshalJSON

func (r BetaManagedAgentsFileRubricParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsFileRubricParams) UnmarshalJSON

func (r *BetaManagedAgentsFileRubricParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsFileRubricParamsType

type BetaManagedAgentsFileRubricParamsType string
const (
	BetaManagedAgentsFileRubricParamsTypeFile BetaManagedAgentsFileRubricParamsType = "file"
)

type BetaManagedAgentsFileRubricType

type BetaManagedAgentsFileRubricType string
const (
	BetaManagedAgentsFileRubricTypeFile BetaManagedAgentsFileRubricType = "file"
)

type BetaManagedAgentsGitHubRepositoryResource

type BetaManagedAgentsGitHubRepositoryResource struct {
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	MountPath string    `json:"mount_path" api:"required"`
	// Any of "github_repository".
	Type BetaManagedAgentsGitHubRepositoryResourceType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time                                              `json:"updated_at" api:"required" format:"date-time"`
	URL       string                                                 `json:"url" api:"required"`
	Checkout  BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion `json:"checkout" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		MountPath   respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		URL         respjson.Field
		Checkout    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaManagedAgentsGitHubRepositoryResource) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsGitHubRepositoryResource) UnmarshalJSON

func (r *BetaManagedAgentsGitHubRepositoryResource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion

type BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion struct {
	// This field is from variant [BetaManagedAgentsBranchCheckout].
	Name string `json:"name"`
	// Any of "branch", "commit".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsCommitCheckout].
	Sha  string `json:"sha"`
	JSON struct {
		Name respjson.Field
		Type respjson.Field
		Sha  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion contains all possible properties and values from BetaManagedAgentsBranchCheckout, BetaManagedAgentsCommitCheckout.

Use the BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion) AsAny

func (u BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion) AsAny() anyBetaManagedAgentsGitHubRepositoryResourceCheckout

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsBranchCheckout:
case Juglow.BetaManagedAgentsCommitCheckout:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion) AsBranch

func (BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion) AsCommit

func (BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion) UnmarshalJSON

type BetaManagedAgentsGitHubRepositoryResourceConfig

type BetaManagedAgentsGitHubRepositoryResourceConfig struct {
	// Any of "github_repository".
	Type BetaManagedAgentsGitHubRepositoryResourceConfigType `json:"type" api:"required"`
	// Github URL of the repository
	URL string `json:"url" api:"required"`
	// Branch or commit to check out. Defaults to the repository's default branch.
	Checkout BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion `json:"checkout" api:"nullable"`
	// Mount path in the container. Defaults to `/workspace/<repo-name>`.
	MountPath string `json:"mount_path" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Checkout    respjson.Field
		MountPath   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A GitHub repository mounted into each session's container. The authorization token is write-only and never returned.

func (BetaManagedAgentsGitHubRepositoryResourceConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsGitHubRepositoryResourceConfig) UnmarshalJSON

type BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion

type BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion struct {
	// This field is from variant [BetaManagedAgentsBranchCheckout].
	Name string `json:"name"`
	// Any of "branch", "commit".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsCommitCheckout].
	Sha  string `json:"sha"`
	JSON struct {
		Name respjson.Field
		Type respjson.Field
		Sha  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion contains all possible properties and values from BetaManagedAgentsBranchCheckout, BetaManagedAgentsCommitCheckout.

Use the BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion) AsAny

func (u BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion) AsAny() anyBetaManagedAgentsGitHubRepositoryResourceConfigCheckout

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsBranchCheckout:
case Juglow.BetaManagedAgentsCommitCheckout:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion) AsBranch

func (BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion) AsCommit

func (BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion) UnmarshalJSON

type BetaManagedAgentsGitHubRepositoryResourceConfigType

type BetaManagedAgentsGitHubRepositoryResourceConfigType string
const (
	BetaManagedAgentsGitHubRepositoryResourceConfigTypeGitHubRepository BetaManagedAgentsGitHubRepositoryResourceConfigType = "github_repository"
)

type BetaManagedAgentsGitHubRepositoryResourceParams

type BetaManagedAgentsGitHubRepositoryResourceParams struct {
	// GitHub authorization token used to clone the repository.
	AuthorizationToken string `json:"authorization_token" api:"required"`
	// Any of "github_repository".
	Type BetaManagedAgentsGitHubRepositoryResourceParamsType `json:"type,omitzero" api:"required"`
	// Github URL of the repository
	URL string `json:"url" api:"required"`
	// Mount path in the container. Defaults to `/workspace/<repo-name>`.
	MountPath param.Opt[string] `json:"mount_path,omitzero"`
	// Branch or commit to check out. Defaults to the repository's default branch.
	Checkout BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion `json:"checkout,omitzero"`
	// contains filtered or unexported fields
}

Mount a GitHub repository into the session's container.

The properties AuthorizationToken, Type, URL are required.

func (BetaManagedAgentsGitHubRepositoryResourceParams) MarshalJSON

func (r BetaManagedAgentsGitHubRepositoryResourceParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsGitHubRepositoryResourceParams) UnmarshalJSON

type BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion

type BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion struct {
	OfBranch *BetaManagedAgentsBranchCheckoutParam `json:",omitzero,inline"`
	OfCommit *BetaManagedAgentsCommitCheckoutParam `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 (BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion) GetName

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion) GetSha

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion) MarshalJSON

func (*BetaManagedAgentsGitHubRepositoryResourceParamsCheckoutUnion) UnmarshalJSON

type BetaManagedAgentsGitHubRepositoryResourceParamsType

type BetaManagedAgentsGitHubRepositoryResourceParamsType string
const (
	BetaManagedAgentsGitHubRepositoryResourceParamsTypeGitHubRepository BetaManagedAgentsGitHubRepositoryResourceParamsType = "github_repository"
)

type BetaManagedAgentsGitHubRepositoryResourceType

type BetaManagedAgentsGitHubRepositoryResourceType string
const (
	BetaManagedAgentsGitHubRepositoryResourceTypeGitHubRepository BetaManagedAgentsGitHubRepositoryResourceType = "github_repository"
)

type BetaManagedAgentsImageBlock

type BetaManagedAgentsImageBlock struct {
	// Union type for image source variants.
	Source BetaManagedAgentsImageBlockSourceUnion `json:"source" api:"required"`
	// Any of "image".
	Type BetaManagedAgentsImageBlockType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Source      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Image content specified directly as base64 data or as a reference via a URL.

func (BetaManagedAgentsImageBlock) RawJSON

func (r BetaManagedAgentsImageBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaManagedAgentsImageBlock) ToParam

ToParam converts this BetaManagedAgentsImageBlock to a BetaManagedAgentsImageBlockParam.

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 BetaManagedAgentsImageBlockParam.Overrides()

func (*BetaManagedAgentsImageBlock) UnmarshalJSON

func (r *BetaManagedAgentsImageBlock) UnmarshalJSON(data []byte) error

type BetaManagedAgentsImageBlockParam

type BetaManagedAgentsImageBlockParam struct {
	// Union type for image source variants.
	Source BetaManagedAgentsImageBlockSourceUnionParam `json:"source,omitzero" api:"required"`
	// Any of "image".
	Type BetaManagedAgentsImageBlockType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Image content specified directly as base64 data or as a reference via a URL.

The properties Source, Type are required.

func (BetaManagedAgentsImageBlockParam) MarshalJSON

func (r BetaManagedAgentsImageBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsImageBlockParam) UnmarshalJSON

func (r *BetaManagedAgentsImageBlockParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsImageBlockSourceUnion

type BetaManagedAgentsImageBlockSourceUnion struct {
	// This field is from variant [BetaManagedAgentsBase64ImageSource].
	Data string `json:"data"`
	// This field is from variant [BetaManagedAgentsBase64ImageSource].
	MediaType string `json:"media_type"`
	// Any of "base64", "url", "file".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsURLImageSource].
	URL string `json:"url"`
	// This field is from variant [BetaManagedAgentsFileImageSource].
	FileID string `json:"file_id"`
	JSON   struct {
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsImageBlockSourceUnion contains all possible properties and values from BetaManagedAgentsBase64ImageSource, BetaManagedAgentsURLImageSource, BetaManagedAgentsFileImageSource.

Use the BetaManagedAgentsImageBlockSourceUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsImageBlockSourceUnion) AsAny

func (u BetaManagedAgentsImageBlockSourceUnion) AsAny() anyBetaManagedAgentsImageBlockSource

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsImageBlockSourceUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsBase64ImageSource:
case Juglow.BetaManagedAgentsURLImageSource:
case Juglow.BetaManagedAgentsFileImageSource:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsImageBlockSourceUnion) AsBase64

func (BetaManagedAgentsImageBlockSourceUnion) AsFile

func (BetaManagedAgentsImageBlockSourceUnion) AsURL

func (BetaManagedAgentsImageBlockSourceUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsImageBlockSourceUnion) UnmarshalJSON

func (r *BetaManagedAgentsImageBlockSourceUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsImageBlockSourceUnionParam

type BetaManagedAgentsImageBlockSourceUnionParam struct {
	OfBase64 *BetaManagedAgentsBase64ImageSourceParam `json:",omitzero,inline"`
	OfURL    *BetaManagedAgentsURLImageSourceParam    `json:",omitzero,inline"`
	OfFile   *BetaManagedAgentsFileImageSourceParam   `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 (BetaManagedAgentsImageBlockSourceUnionParam) GetData

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsImageBlockSourceUnionParam) GetFileID

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsImageBlockSourceUnionParam) GetMediaType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsImageBlockSourceUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsImageBlockSourceUnionParam) GetURL

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsImageBlockSourceUnionParam) MarshalJSON

func (*BetaManagedAgentsImageBlockSourceUnionParam) UnmarshalJSON

func (u *BetaManagedAgentsImageBlockSourceUnionParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsImageBlockType

type BetaManagedAgentsImageBlockType string
const (
	BetaManagedAgentsImageBlockTypeImage BetaManagedAgentsImageBlockType = "image"
)

type BetaManagedAgentsInjectionLocationParams

type BetaManagedAgentsInjectionLocationParams struct {
	// Substitute when the placeholder appears in the request body.
	Body param.Opt[bool] `json:"body,omitzero"`
	// Substitute when the placeholder appears in a request header value.
	Header param.Opt[bool] `json:"header,omitzero"`
	// contains filtered or unexported fields
}

Where in the outbound request the secret value may be substituted.

func (BetaManagedAgentsInjectionLocationParams) MarshalJSON

func (r BetaManagedAgentsInjectionLocationParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsInjectionLocationParams) UnmarshalJSON

func (r *BetaManagedAgentsInjectionLocationParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsInjectionLocationResponse

type BetaManagedAgentsInjectionLocationResponse struct {
	// Whether the placeholder is substituted in the request body.
	Body bool `json:"body" api:"required"`
	// Whether the placeholder is substituted in request header values.
	Header bool `json:"header" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Body        respjson.Field
		Header      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Where in the outbound request the secret value is substituted.

func (BetaManagedAgentsInjectionLocationResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsInjectionLocationResponse) UnmarshalJSON

func (r *BetaManagedAgentsInjectionLocationResponse) UnmarshalJSON(data []byte) error

type BetaManagedAgentsInjectionLocationUpdateParams

type BetaManagedAgentsInjectionLocationUpdateParams struct {
	// Substitute when the placeholder appears in the request body.
	Body param.Opt[bool] `json:"body,omitzero"`
	// Substitute when the placeholder appears in a request header value.
	Header param.Opt[bool] `json:"header,omitzero"`
	// contains filtered or unexported fields
}

Updated injection location.

func (BetaManagedAgentsInjectionLocationUpdateParams) MarshalJSON

func (r BetaManagedAgentsInjectionLocationUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsInjectionLocationUpdateParams) UnmarshalJSON

type BetaManagedAgentsJuglowTrack added in v1.71.2

type BetaManagedAgentsJuglowTrack struct {
	TrackID string `json:"track_id" api:"required"`
	// Any of "Juglow".
	Type    BetaManagedAgentsJuglowTrackType `json:"type" api:"required"`
	Version string                           `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TrackID     respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A resolved Juglow-managed track.

func (BetaManagedAgentsJuglowTrack) RawJSON added in v1.71.2

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsJuglowTrack) UnmarshalJSON added in v1.71.2

func (r *BetaManagedAgentsJuglowTrack) UnmarshalJSON(data []byte) error

type BetaManagedAgentsJuglowTrackParams added in v1.71.2

type BetaManagedAgentsJuglowTrackParams struct {
	// Identifier of the Juglow track (e.g., "xlsx").
	TrackID string `json:"track_id" api:"required"`
	// Any of "Juglow".
	Type BetaManagedAgentsJuglowTrackParamsType `json:"type,omitzero" api:"required"`
	// Version to pin. Defaults to latest if omitted.
	Version param.Opt[string] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

An Juglow-managed track.

The properties TrackID, Type are required.

func (BetaManagedAgentsJuglowTrackParams) MarshalJSON added in v1.71.2

func (r BetaManagedAgentsJuglowTrackParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsJuglowTrackParams) UnmarshalJSON added in v1.71.2

func (r *BetaManagedAgentsJuglowTrackParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsJuglowTrackParamsType added in v1.71.2

type BetaManagedAgentsJuglowTrackParamsType string
const (
	BetaManagedAgentsJuglowTrackParamsTypeJuglow BetaManagedAgentsJuglowTrackParamsType = "Juglow"
)

type BetaManagedAgentsJuglowTrackType added in v1.71.2

type BetaManagedAgentsJuglowTrackType string
const (
	BetaManagedAgentsJuglowTrackTypeJuglow BetaManagedAgentsJuglowTrackType = "Juglow"
)

type BetaManagedAgentsLimitedCredentialNetworkingParams

type BetaManagedAgentsLimitedCredentialNetworkingParams struct {
	// Hostnames on which the secret will be substituted. Each entry is a bare hostname
	// (`api.example.com`), an IPv4 address (`192.0.2.1`), or a `*.`-prefixed wildcard
	// (`*.example.com`). URLs, ports, paths, and IPv6 addresses are not accepted. At
	// most 16 entries.
	AllowedHosts []string `json:"allowed_hosts,omitzero" api:"required"`
	// Any of "limited".
	Type BetaManagedAgentsLimitedCredentialNetworkingParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Substitute the secret only on requests to the listed hosts.

The properties AllowedHosts, Type are required.

func (BetaManagedAgentsLimitedCredentialNetworkingParams) MarshalJSON

func (r BetaManagedAgentsLimitedCredentialNetworkingParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsLimitedCredentialNetworkingParams) UnmarshalJSON

type BetaManagedAgentsLimitedCredentialNetworkingParamsType

type BetaManagedAgentsLimitedCredentialNetworkingParamsType string
const (
	BetaManagedAgentsLimitedCredentialNetworkingParamsTypeLimited BetaManagedAgentsLimitedCredentialNetworkingParamsType = "limited"
)

type BetaManagedAgentsLimitedCredentialNetworkingResponse

type BetaManagedAgentsLimitedCredentialNetworkingResponse struct {
	// Hostnames on which the secret will be substituted. An entry matches the request
	// host exactly; a `*.`-prefixed entry matches any subdomain of the named domain
	// but not the domain itself.
	AllowedHosts []string `json:"allowed_hosts" api:"required"`
	// Any of "limited".
	Type BetaManagedAgentsLimitedCredentialNetworkingResponseType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowedHosts respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The secret is substituted only on requests to the listed hosts.

func (BetaManagedAgentsLimitedCredentialNetworkingResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsLimitedCredentialNetworkingResponse) UnmarshalJSON

type BetaManagedAgentsLimitedCredentialNetworkingResponseType

type BetaManagedAgentsLimitedCredentialNetworkingResponseType string
const (
	BetaManagedAgentsLimitedCredentialNetworkingResponseTypeLimited BetaManagedAgentsLimitedCredentialNetworkingResponseType = "limited"
)

type BetaManagedAgentsMCPAuthenticationFailedError

type BetaManagedAgentsMCPAuthenticationFailedError struct {
	// Name of the MCP server that failed authentication.
	MCPServerName string `json:"mcp_server_name" api:"required"`
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// What the client should do next in response to this error.
	RetryStatus BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion `json:"retry_status" api:"required"`
	// Any of "mcp_authentication_failed_error".
	Type BetaManagedAgentsMCPAuthenticationFailedErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MCPServerName respjson.Field
		Message       respjson.Field
		RetryStatus   respjson.Field
		Type          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Authentication to an MCP server failed.

func (BetaManagedAgentsMCPAuthenticationFailedError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPAuthenticationFailedError) UnmarshalJSON

func (r *BetaManagedAgentsMCPAuthenticationFailedError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion

type BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion struct {
	// Any of "retrying", "exhausted", "terminal".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion contains all possible properties and values from BetaManagedAgentsRetryStatusRetrying, BetaManagedAgentsRetryStatusExhausted, BetaManagedAgentsRetryStatusTerminal.

Use the BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion) AsAny

func (u BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion) AsAny() anyBetaManagedAgentsMCPAuthenticationFailedErrorRetryStatus

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsRetryStatusRetrying:
case Juglow.BetaManagedAgentsRetryStatusExhausted:
case Juglow.BetaManagedAgentsRetryStatusTerminal:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion) AsExhausted

func (BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion) AsRetrying

func (BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion) AsTerminal

func (BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion) UnmarshalJSON

type BetaManagedAgentsMCPAuthenticationFailedErrorType

type BetaManagedAgentsMCPAuthenticationFailedErrorType string
const (
	BetaManagedAgentsMCPAuthenticationFailedErrorTypeMCPAuthenticationFailedError BetaManagedAgentsMCPAuthenticationFailedErrorType = "mcp_authentication_failed_error"
)

type BetaManagedAgentsMCPConnectionFailedError

type BetaManagedAgentsMCPConnectionFailedError struct {
	// Name of the MCP server that failed to connect.
	MCPServerName string `json:"mcp_server_name" api:"required"`
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// What the client should do next in response to this error.
	RetryStatus BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion `json:"retry_status" api:"required"`
	// Any of "mcp_connection_failed_error".
	Type BetaManagedAgentsMCPConnectionFailedErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MCPServerName respjson.Field
		Message       respjson.Field
		RetryStatus   respjson.Field
		Type          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Failed to connect to an MCP server.

func (BetaManagedAgentsMCPConnectionFailedError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPConnectionFailedError) UnmarshalJSON

func (r *BetaManagedAgentsMCPConnectionFailedError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion

type BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion struct {
	// Any of "retrying", "exhausted", "terminal".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion contains all possible properties and values from BetaManagedAgentsRetryStatusRetrying, BetaManagedAgentsRetryStatusExhausted, BetaManagedAgentsRetryStatusTerminal.

Use the BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion) AsAny

func (u BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion) AsAny() anyBetaManagedAgentsMCPConnectionFailedErrorRetryStatus

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsRetryStatusRetrying:
case Juglow.BetaManagedAgentsRetryStatusExhausted:
case Juglow.BetaManagedAgentsRetryStatusTerminal:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion) AsExhausted

func (BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion) AsRetrying

func (BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion) AsTerminal

func (BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion) UnmarshalJSON

type BetaManagedAgentsMCPConnectionFailedErrorType

type BetaManagedAgentsMCPConnectionFailedErrorType string
const (
	BetaManagedAgentsMCPConnectionFailedErrorTypeMCPConnectionFailedError BetaManagedAgentsMCPConnectionFailedErrorType = "mcp_connection_failed_error"
)

type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError

type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError struct {
	// Any of "mcp_egress_blocked_error".
	Type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An MCP server host used by the deployment's agent is blocked by the environment's network policy.

func (BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType

type BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorTypeMCPEgressBlockedError BetaManagedAgentsMCPEgressBlockedDeploymentPausedReasonErrorType = "mcp_egress_blocked_error"
)

type BetaManagedAgentsMCPEgressBlockedRunError

type BetaManagedAgentsMCPEgressBlockedRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "mcp_egress_blocked_error".
	Type BetaManagedAgentsMCPEgressBlockedRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An MCP server host used by the deployment's agent is blocked by the environment's network policy.

func (BetaManagedAgentsMCPEgressBlockedRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPEgressBlockedRunError) UnmarshalJSON

func (r *BetaManagedAgentsMCPEgressBlockedRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPEgressBlockedRunErrorType

type BetaManagedAgentsMCPEgressBlockedRunErrorType string
const (
	BetaManagedAgentsMCPEgressBlockedRunErrorTypeMCPEgressBlockedError BetaManagedAgentsMCPEgressBlockedRunErrorType = "mcp_egress_blocked_error"
)

type BetaManagedAgentsMCPOAuthAuthResponse

type BetaManagedAgentsMCPOAuthAuthResponse struct {
	// URL of the MCP server this credential authenticates against.
	MCPServerURL string `json:"mcp_server_url" api:"required"`
	// Any of "mcp_oauth".
	Type BetaManagedAgentsMCPOAuthAuthResponseType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	ExpiresAt time.Time `json:"expires_at" api:"nullable" format:"date-time"`
	// OAuth refresh token configuration returned in credential responses.
	Refresh BetaManagedAgentsMCPOAuthRefreshResponse `json:"refresh" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MCPServerURL respjson.Field
		Type         respjson.Field
		ExpiresAt    respjson.Field
		Refresh      respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

OAuth credential details for an MCP server.

func (BetaManagedAgentsMCPOAuthAuthResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPOAuthAuthResponse) UnmarshalJSON

func (r *BetaManagedAgentsMCPOAuthAuthResponse) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPOAuthAuthResponseType

type BetaManagedAgentsMCPOAuthAuthResponseType string
const (
	BetaManagedAgentsMCPOAuthAuthResponseTypeMCPOAuth BetaManagedAgentsMCPOAuthAuthResponseType = "mcp_oauth"
)

type BetaManagedAgentsMCPOAuthCreateParams

type BetaManagedAgentsMCPOAuthCreateParams struct {
	// OAuth access token.
	AccessToken string `json:"access_token" api:"required"`
	// URL of the MCP server this credential authenticates against.
	MCPServerURL string `json:"mcp_server_url" api:"required"`
	// Any of "mcp_oauth".
	Type BetaManagedAgentsMCPOAuthCreateParamsType `json:"type,omitzero" api:"required"`
	// A timestamp in RFC 3339 format
	ExpiresAt param.Opt[time.Time] `json:"expires_at,omitzero" format:"date-time"`
	// OAuth refresh token parameters for creating a credential with refresh support.
	Refresh BetaManagedAgentsMCPOAuthRefreshParams `json:"refresh,omitzero"`
	// contains filtered or unexported fields
}

Parameters for creating an MCP OAuth credential.

The properties AccessToken, MCPServerURL, Type are required.

func (BetaManagedAgentsMCPOAuthCreateParams) MarshalJSON

func (r BetaManagedAgentsMCPOAuthCreateParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMCPOAuthCreateParams) UnmarshalJSON

func (r *BetaManagedAgentsMCPOAuthCreateParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPOAuthCreateParamsType

type BetaManagedAgentsMCPOAuthCreateParamsType string
const (
	BetaManagedAgentsMCPOAuthCreateParamsTypeMCPOAuth BetaManagedAgentsMCPOAuthCreateParamsType = "mcp_oauth"
)

type BetaManagedAgentsMCPOAuthRefreshParams

type BetaManagedAgentsMCPOAuthRefreshParams struct {
	// OAuth client ID.
	ClientID string `json:"client_id" api:"required"`
	// OAuth refresh token.
	RefreshToken string `json:"refresh_token" api:"required"`
	// Token endpoint URL used to refresh the access token.
	TokenEndpoint string `json:"token_endpoint" api:"required"`
	// Token endpoint requires no client authentication.
	TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshParamsTokenEndpointAuthUnion `json:"token_endpoint_auth,omitzero" api:"required"`
	// OAuth resource indicator.
	Resource param.Opt[string] `json:"resource,omitzero"`
	// OAuth scope for the refresh request.
	Scope param.Opt[string] `json:"scope,omitzero"`
	// contains filtered or unexported fields
}

OAuth refresh token parameters for creating a credential with refresh support.

The properties ClientID, RefreshToken, TokenEndpoint, TokenEndpointAuth are required.

func (BetaManagedAgentsMCPOAuthRefreshParams) MarshalJSON

func (r BetaManagedAgentsMCPOAuthRefreshParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMCPOAuthRefreshParams) UnmarshalJSON

func (r *BetaManagedAgentsMCPOAuthRefreshParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPOAuthRefreshParamsTokenEndpointAuthUnion

type BetaManagedAgentsMCPOAuthRefreshParamsTokenEndpointAuthUnion struct {
	OfNone              *BetaManagedAgentsTokenEndpointAuthNoneParam  `json:",omitzero,inline"`
	OfClientSecretBasic *BetaManagedAgentsTokenEndpointAuthBasicParam `json:",omitzero,inline"`
	OfClientSecretPost  *BetaManagedAgentsTokenEndpointAuthPostParam  `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 (BetaManagedAgentsMCPOAuthRefreshParamsTokenEndpointAuthUnion) GetClientSecret

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMCPOAuthRefreshParamsTokenEndpointAuthUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMCPOAuthRefreshParamsTokenEndpointAuthUnion) MarshalJSON

func (*BetaManagedAgentsMCPOAuthRefreshParamsTokenEndpointAuthUnion) UnmarshalJSON

type BetaManagedAgentsMCPOAuthRefreshResponse

type BetaManagedAgentsMCPOAuthRefreshResponse struct {
	// OAuth client ID.
	ClientID string `json:"client_id" api:"required"`
	// Token endpoint URL used to refresh the access token.
	TokenEndpoint string `json:"token_endpoint" api:"required"`
	// Token endpoint requires no client authentication.
	TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion `json:"token_endpoint_auth" api:"required"`
	// OAuth resource indicator.
	Resource string `json:"resource" api:"nullable"`
	// OAuth scope for the refresh request.
	Scope string `json:"scope" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClientID          respjson.Field
		TokenEndpoint     respjson.Field
		TokenEndpointAuth respjson.Field
		Resource          respjson.Field
		Scope             respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

OAuth refresh token configuration returned in credential responses.

func (BetaManagedAgentsMCPOAuthRefreshResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPOAuthRefreshResponse) UnmarshalJSON

func (r *BetaManagedAgentsMCPOAuthRefreshResponse) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion

type BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion struct {
	// Any of "none", "client_secret_basic", "client_secret_post".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion contains all possible properties and values from BetaManagedAgentsTokenEndpointAuthNoneResponse, BetaManagedAgentsTokenEndpointAuthBasicResponse, BetaManagedAgentsTokenEndpointAuthPostResponse.

Use the BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion) AsAny

func (u BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion) AsAny() anyBetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuth

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTokenEndpointAuthNoneResponse:
case Juglow.BetaManagedAgentsTokenEndpointAuthBasicResponse:
case Juglow.BetaManagedAgentsTokenEndpointAuthPostResponse:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion) AsClientSecretBasic

func (BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion) AsClientSecretPost

func (BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion) AsNone

func (BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPOAuthRefreshResponseTokenEndpointAuthUnion) UnmarshalJSON

type BetaManagedAgentsMCPOAuthRefreshUpdateParams

type BetaManagedAgentsMCPOAuthRefreshUpdateParams struct {
	// Updated OAuth refresh token.
	RefreshToken param.Opt[string] `json:"refresh_token,omitzero"`
	// Updated OAuth scope for the refresh request.
	Scope param.Opt[string] `json:"scope,omitzero"`
	// Updated HTTP Basic authentication parameters for the token endpoint.
	TokenEndpointAuth BetaManagedAgentsMCPOAuthRefreshUpdateParamsTokenEndpointAuthUnion `json:"token_endpoint_auth,omitzero"`
	// contains filtered or unexported fields
}

Parameters for updating OAuth refresh token configuration.

func (BetaManagedAgentsMCPOAuthRefreshUpdateParams) MarshalJSON

func (r BetaManagedAgentsMCPOAuthRefreshUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMCPOAuthRefreshUpdateParams) UnmarshalJSON

func (r *BetaManagedAgentsMCPOAuthRefreshUpdateParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPOAuthRefreshUpdateParamsTokenEndpointAuthUnion

type BetaManagedAgentsMCPOAuthRefreshUpdateParamsTokenEndpointAuthUnion struct {
	OfClientSecretBasic *BetaManagedAgentsTokenEndpointAuthBasicUpdateParam `json:",omitzero,inline"`
	OfClientSecretPost  *BetaManagedAgentsTokenEndpointAuthPostUpdateParam  `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 (BetaManagedAgentsMCPOAuthRefreshUpdateParamsTokenEndpointAuthUnion) GetClientSecret

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMCPOAuthRefreshUpdateParamsTokenEndpointAuthUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMCPOAuthRefreshUpdateParamsTokenEndpointAuthUnion) MarshalJSON

func (*BetaManagedAgentsMCPOAuthRefreshUpdateParamsTokenEndpointAuthUnion) UnmarshalJSON

type BetaManagedAgentsMCPOAuthUpdateParams

type BetaManagedAgentsMCPOAuthUpdateParams struct {
	// Any of "mcp_oauth".
	Type BetaManagedAgentsMCPOAuthUpdateParamsType `json:"type,omitzero" api:"required"`
	// Updated OAuth access token.
	AccessToken param.Opt[string] `json:"access_token,omitzero"`
	// A timestamp in RFC 3339 format
	ExpiresAt param.Opt[time.Time] `json:"expires_at,omitzero" format:"date-time"`
	// Parameters for updating OAuth refresh token configuration.
	Refresh BetaManagedAgentsMCPOAuthRefreshUpdateParams `json:"refresh,omitzero"`
	// contains filtered or unexported fields
}

Parameters for updating an MCP OAuth credential. The `mcp_server_url` is immutable.

The property Type is required.

func (BetaManagedAgentsMCPOAuthUpdateParams) MarshalJSON

func (r BetaManagedAgentsMCPOAuthUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMCPOAuthUpdateParams) UnmarshalJSON

func (r *BetaManagedAgentsMCPOAuthUpdateParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPOAuthUpdateParamsType

type BetaManagedAgentsMCPOAuthUpdateParamsType string
const (
	BetaManagedAgentsMCPOAuthUpdateParamsTypeMCPOAuth BetaManagedAgentsMCPOAuthUpdateParamsType = "mcp_oauth"
)

type BetaManagedAgentsMCPProbe

type BetaManagedAgentsMCPProbe struct {
	// An HTTP response captured during a credential validation probe.
	HTTPResponse BetaManagedAgentsRefreshHTTPResponse `json:"http_response" api:"required"`
	// The MCP method that failed (for example `initialize` or `tools/list`).
	Method string `json:"method" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HTTPResponse respjson.Field
		Method       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The failing step of an MCP validation probe.

func (BetaManagedAgentsMCPProbe) RawJSON

func (r BetaManagedAgentsMCPProbe) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPProbe) UnmarshalJSON

func (r *BetaManagedAgentsMCPProbe) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPServerURLDefinition

type BetaManagedAgentsMCPServerURLDefinition struct {
	Name string `json:"name" api:"required"`
	// Any of "url".
	Type BetaManagedAgentsMCPServerURLDefinitionType `json:"type" api:"required"`
	URL  string                                      `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

URL-based MCP server connection as returned in API responses.

func (BetaManagedAgentsMCPServerURLDefinition) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPServerURLDefinition) UnmarshalJSON

func (r *BetaManagedAgentsMCPServerURLDefinition) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPServerURLDefinitionType

type BetaManagedAgentsMCPServerURLDefinitionType string
const (
	BetaManagedAgentsMCPServerURLDefinitionTypeURL BetaManagedAgentsMCPServerURLDefinitionType = "url"
)

type BetaManagedAgentsMCPToolConfig

type BetaManagedAgentsMCPToolConfig struct {
	Enabled bool   `json:"enabled" api:"required"`
	Name    string `json:"name" api:"required"`
	// Permission policy for tool execution.
	PermissionPolicy BetaManagedAgentsMCPToolConfigPermissionPolicyUnion `json:"permission_policy" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled          respjson.Field
		Name             respjson.Field
		PermissionPolicy respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolved configuration for a specific MCP tool.

func (BetaManagedAgentsMCPToolConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPToolConfig) UnmarshalJSON

func (r *BetaManagedAgentsMCPToolConfig) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPToolConfigParams

type BetaManagedAgentsMCPToolConfigParams struct {
	// Name of the MCP tool to configure. 1-128 characters.
	Name string `json:"name" api:"required"`
	// Whether this tool is enabled. Overrides the `default_config` setting.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Permission policy for tool execution.
	PermissionPolicy BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion `json:"permission_policy,omitzero"`
	// contains filtered or unexported fields
}

Configuration override for a specific MCP tool.

The property Name is required.

func (BetaManagedAgentsMCPToolConfigParams) MarshalJSON

func (r BetaManagedAgentsMCPToolConfigParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMCPToolConfigParams) UnmarshalJSON

func (r *BetaManagedAgentsMCPToolConfigParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion

type BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion struct {
	OfAlwaysAllow *BetaManagedAgentsAlwaysAllowPolicyParam `json:",omitzero,inline"`
	OfAlwaysAsk   *BetaManagedAgentsAlwaysAskPolicyParam   `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 (BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion) MarshalJSON

func (*BetaManagedAgentsMCPToolConfigParamsPermissionPolicyUnion) UnmarshalJSON

type BetaManagedAgentsMCPToolConfigPermissionPolicyUnion

type BetaManagedAgentsMCPToolConfigPermissionPolicyUnion struct {
	// Any of "always_allow", "always_ask".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsMCPToolConfigPermissionPolicyUnion contains all possible properties and values from BetaManagedAgentsAlwaysAllowPolicy, BetaManagedAgentsAlwaysAskPolicy.

Use the BetaManagedAgentsMCPToolConfigPermissionPolicyUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsMCPToolConfigPermissionPolicyUnion) AsAlwaysAllow

func (BetaManagedAgentsMCPToolConfigPermissionPolicyUnion) AsAlwaysAsk

func (BetaManagedAgentsMCPToolConfigPermissionPolicyUnion) AsAny

func (u BetaManagedAgentsMCPToolConfigPermissionPolicyUnion) AsAny() anyBetaManagedAgentsMCPToolConfigPermissionPolicy

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsMCPToolConfigPermissionPolicyUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsAlwaysAllowPolicy:
case Juglow.BetaManagedAgentsAlwaysAskPolicy:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsMCPToolConfigPermissionPolicyUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPToolConfigPermissionPolicyUnion) UnmarshalJSON

type BetaManagedAgentsMCPToolset

type BetaManagedAgentsMCPToolset struct {
	Configs []BetaManagedAgentsMCPToolConfig `json:"configs" api:"required"`
	// Resolved default configuration for all tools from an MCP server.
	DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfig `json:"default_config" api:"required"`
	MCPServerName string                                   `json:"mcp_server_name" api:"required"`
	// Any of "mcp_toolset".
	Type BetaManagedAgentsMCPToolsetType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Configs       respjson.Field
		DefaultConfig respjson.Field
		MCPServerName respjson.Field
		Type          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaManagedAgentsMCPToolset) RawJSON

func (r BetaManagedAgentsMCPToolset) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPToolset) UnmarshalJSON

func (r *BetaManagedAgentsMCPToolset) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPToolsetDefaultConfig

type BetaManagedAgentsMCPToolsetDefaultConfig struct {
	Enabled bool `json:"enabled" api:"required"`
	// Permission policy for tool execution.
	PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion `json:"permission_policy" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled          respjson.Field
		PermissionPolicy respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolved default configuration for all tools from an MCP server.

func (BetaManagedAgentsMCPToolsetDefaultConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPToolsetDefaultConfig) UnmarshalJSON

func (r *BetaManagedAgentsMCPToolsetDefaultConfig) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPToolsetDefaultConfigParams

type BetaManagedAgentsMCPToolsetDefaultConfigParams struct {
	// Whether tools are enabled by default. Defaults to true if not specified.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Permission policy for tool execution.
	PermissionPolicy BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion `json:"permission_policy,omitzero"`
	// contains filtered or unexported fields
}

Default configuration for all tools from an MCP server.

func (BetaManagedAgentsMCPToolsetDefaultConfigParams) MarshalJSON

func (r BetaManagedAgentsMCPToolsetDefaultConfigParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMCPToolsetDefaultConfigParams) UnmarshalJSON

type BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion

type BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion struct {
	OfAlwaysAllow *BetaManagedAgentsAlwaysAllowPolicyParam `json:",omitzero,inline"`
	OfAlwaysAsk   *BetaManagedAgentsAlwaysAskPolicyParam   `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 (BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion) MarshalJSON

func (*BetaManagedAgentsMCPToolsetDefaultConfigParamsPermissionPolicyUnion) UnmarshalJSON

type BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion

type BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion struct {
	// Any of "always_allow", "always_ask".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion contains all possible properties and values from BetaManagedAgentsAlwaysAllowPolicy, BetaManagedAgentsAlwaysAskPolicy.

Use the BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion) AsAlwaysAllow

func (BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion) AsAlwaysAsk

func (BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion) AsAny

func (u BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion) AsAny() anyBetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicy

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsAlwaysAllowPolicy:
case Juglow.BetaManagedAgentsAlwaysAskPolicy:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion) UnmarshalJSON

type BetaManagedAgentsMCPToolsetParams

type BetaManagedAgentsMCPToolsetParams struct {
	// Name of the MCP server. Must match a server name from the mcp_servers array.
	// 1-255 characters.
	MCPServerName string `json:"mcp_server_name" api:"required"`
	// Any of "mcp_toolset".
	Type BetaManagedAgentsMCPToolsetParamsType `json:"type,omitzero" api:"required"`
	// Per-tool configuration overrides.
	Configs []BetaManagedAgentsMCPToolConfigParams `json:"configs,omitzero"`
	// Default configuration for all tools from an MCP server.
	DefaultConfig BetaManagedAgentsMCPToolsetDefaultConfigParams `json:"default_config,omitzero"`
	// contains filtered or unexported fields
}

Configuration for tools from an MCP server defined in `mcp_servers`.

The properties MCPServerName, Type are required.

func (BetaManagedAgentsMCPToolsetParams) MarshalJSON

func (r BetaManagedAgentsMCPToolsetParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMCPToolsetParams) UnmarshalJSON

func (r *BetaManagedAgentsMCPToolsetParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMCPToolsetParamsType

type BetaManagedAgentsMCPToolsetParamsType string
const (
	BetaManagedAgentsMCPToolsetParamsTypeMCPToolset BetaManagedAgentsMCPToolsetParamsType = "mcp_toolset"
)

type BetaManagedAgentsMCPToolsetType

type BetaManagedAgentsMCPToolsetType string
const (
	BetaManagedAgentsMCPToolsetTypeMCPToolset BetaManagedAgentsMCPToolsetType = "mcp_toolset"
)

type BetaManagedAgentsManualDeploymentPausedReason

type BetaManagedAgentsManualDeploymentPausedReason struct {
	// Any of "manual".
	Type BetaManagedAgentsManualDeploymentPausedReasonType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The caller invoked the pause endpoint on the deployment.

func (BetaManagedAgentsManualDeploymentPausedReason) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsManualDeploymentPausedReason) UnmarshalJSON

func (r *BetaManagedAgentsManualDeploymentPausedReason) UnmarshalJSON(data []byte) error

type BetaManagedAgentsManualDeploymentPausedReasonType

type BetaManagedAgentsManualDeploymentPausedReasonType string
const (
	BetaManagedAgentsManualDeploymentPausedReasonTypeManual BetaManagedAgentsManualDeploymentPausedReasonType = "manual"
)

type BetaManagedAgentsManualTriggerContext

type BetaManagedAgentsManualTriggerContext struct {
	// Any of "manual".
	Type BetaManagedAgentsManualTriggerContextType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The run was started manually by creating a session directly against the deployment.

func (BetaManagedAgentsManualTriggerContext) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsManualTriggerContext) UnmarshalJSON

func (r *BetaManagedAgentsManualTriggerContext) UnmarshalJSON(data []byte) error

type BetaManagedAgentsManualTriggerContextType

type BetaManagedAgentsManualTriggerContextType string
const (
	BetaManagedAgentsManualTriggerContextTypeManual BetaManagedAgentsManualTriggerContextType = "manual"
)

type BetaManagedAgentsMemory

type BetaManagedAgentsMemory struct {
	// Unique identifier for this memory (a `mem_...` value). Stable across renames;
	// use this ID, not the path, to read, update, or delete the memory.
	ID string `json:"id" api:"required"`
	// Lowercase hex SHA-256 digest of the UTF-8 `content` bytes (64 characters). The
	// server applies no normalization, so clients can compute the same hash locally
	// for staleness checks and as the value for a `content_sha256` precondition on
	// update. Always populated, regardless of `view`.
	ContentSha256 string `json:"content_sha256" api:"required"`
	// Size of `content` in bytes (the UTF-8 plaintext length). Always populated,
	// regardless of `view`.
	ContentSizeBytes int64 `json:"content_size_bytes" api:"required"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// ID of the memory store this memory belongs to (a `memstore_...` value).
	MemoryStoreID string `json:"memory_store_id" api:"required"`
	// ID of the `memory_version` representing this memory's current content (a
	// `memver_...` value). This is the authoritative head pointer; `memory_version`
	// objects do not carry an `is_latest` flag, so compare against this field instead.
	// Enumerate the full history via
	// [List memory versions](/en/api/beta/memory_stores/memory_versions/list).
	MemoryVersionID string `json:"memory_version_id" api:"required"`
	// Hierarchical path of the memory within the store, e.g. `/projects/foo/notes.md`.
	// Always starts with `/`. Paths are case-sensitive and unique within a store.
	// Maximum 1,024 bytes.
	Path string `json:"path" api:"required"`
	// Any of "memory".
	Type BetaManagedAgentsMemoryType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The memory's UTF-8 text content. Populated when `view=full`; `null` when
	// `view=basic`. Maximum 100 kB (102,400 bytes).
	Content string `json:"content" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		ContentSha256    respjson.Field
		ContentSizeBytes respjson.Field
		CreatedAt        respjson.Field
		MemoryStoreID    respjson.Field
		MemoryVersionID  respjson.Field
		Path             respjson.Field
		Type             respjson.Field
		UpdatedAt        respjson.Field
		Content          respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A `memory` object: a single text document at a hierarchical path inside a memory store. The `content` field is populated when `view=full` and `null` when `view=basic`; the `content_size_bytes` and `content_sha256` fields are always populated so sync clients can diff without fetching content. Memories are addressed by their `mem_...` ID; the path is the create key and can be changed via update.

func (BetaManagedAgentsMemory) RawJSON

func (r BetaManagedAgentsMemory) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMemory) UnmarshalJSON

func (r *BetaManagedAgentsMemory) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMemoryListItemUnion

type BetaManagedAgentsMemoryListItemUnion struct {
	// This field is from variant [BetaManagedAgentsMemory].
	ID string `json:"id"`
	// This field is from variant [BetaManagedAgentsMemory].
	ContentSha256 string `json:"content_sha256"`
	// This field is from variant [BetaManagedAgentsMemory].
	ContentSizeBytes int64 `json:"content_size_bytes"`
	// This field is from variant [BetaManagedAgentsMemory].
	CreatedAt time.Time `json:"created_at"`
	// This field is from variant [BetaManagedAgentsMemory].
	MemoryStoreID string `json:"memory_store_id"`
	// This field is from variant [BetaManagedAgentsMemory].
	MemoryVersionID string `json:"memory_version_id"`
	Path            string `json:"path"`
	// Any of "memory", "memory_prefix".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsMemory].
	UpdatedAt time.Time `json:"updated_at"`
	// This field is from variant [BetaManagedAgentsMemory].
	Content string `json:"content"`
	JSON    struct {
		ID               respjson.Field
		ContentSha256    respjson.Field
		ContentSizeBytes respjson.Field
		CreatedAt        respjson.Field
		MemoryStoreID    respjson.Field
		MemoryVersionID  respjson.Field
		Path             respjson.Field
		Type             respjson.Field
		UpdatedAt        respjson.Field
		Content          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsMemoryListItemUnion contains all possible properties and values from BetaManagedAgentsMemory, BetaManagedAgentsMemoryPrefix.

Use the BetaManagedAgentsMemoryListItemUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsMemoryListItemUnion) AsAny

func (u BetaManagedAgentsMemoryListItemUnion) AsAny() anyBetaManagedAgentsMemoryListItem

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsMemoryListItemUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsMemory:
case Juglow.BetaManagedAgentsMemoryPrefix:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsMemoryListItemUnion) AsMemory

func (BetaManagedAgentsMemoryListItemUnion) AsMemoryPrefix

func (BetaManagedAgentsMemoryListItemUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMemoryListItemUnion) UnmarshalJSON

func (r *BetaManagedAgentsMemoryListItemUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMemoryPrefix

type BetaManagedAgentsMemoryPrefix struct {
	// The rolled-up path prefix, including a trailing `/` (e.g. `/projects/foo/`).
	// Pass this value as `path_prefix` on a subsequent list call to drill into the
	// directory.
	Path string `json:"path" api:"required"`
	// Any of "memory_prefix".
	Type BetaManagedAgentsMemoryPrefixType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Path        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A rolled-up directory marker returned by [List memories](/en/api/beta/memory_stores/memories/list) when `depth` is set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the page `limit` and interleaves with `memory` items in path order.

func (BetaManagedAgentsMemoryPrefix) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMemoryPrefix) UnmarshalJSON

func (r *BetaManagedAgentsMemoryPrefix) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMemoryPrefixType

type BetaManagedAgentsMemoryPrefixType string
const (
	BetaManagedAgentsMemoryPrefixTypeMemoryPrefix BetaManagedAgentsMemoryPrefixType = "memory_prefix"
)

type BetaManagedAgentsMemoryStore

type BetaManagedAgentsMemoryStore struct {
	// Unique identifier for the memory store (a `memstore_...` tagged ID). Use this
	// when attaching the store to a session, or in the `{memory_store_id}` path
	// parameter of subsequent calls.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable name for the store. 1–255 characters. The store's mount-path slug
	// under `/mnt/memory/` is derived from this name.
	Name string `json:"name" api:"required"`
	// Any of "memory_store".
	Type BetaManagedAgentsMemoryStoreType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"nullable" format:"date-time"`
	// Free-text description of what the store contains, up to 1024 characters.
	// Included in the agent's system prompt when the store is attached, so word it to
	// be useful to the agent. Empty string when unset.
	Description string `json:"description"`
	// Arbitrary key-value tags for your own bookkeeping (such as the end user a store
	// belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters.
	// Returned on retrieve/list but not filterable.
	Metadata map[string]string `json:"metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		ArchivedAt  respjson.Field
		Description respjson.Field
		Metadata    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A `memory_store`: a named container for agent memories, scoped to a workspace. Attach a store to a session via `resources[]` to mount it as a directory the agent can read and write.

func (BetaManagedAgentsMemoryStore) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMemoryStore) UnmarshalJSON

func (r *BetaManagedAgentsMemoryStore) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError

type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError struct {
	// Any of "memory_store_archived_error".
	Type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A memory store referenced by the deployment is archived.

func (BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType

type BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorTypeMemoryStoreArchivedError BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonErrorType = "memory_store_archived_error"
)

type BetaManagedAgentsMemoryStoreArchivedRunError

type BetaManagedAgentsMemoryStoreArchivedRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "memory_store_archived_error".
	Type BetaManagedAgentsMemoryStoreArchivedRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A memory store referenced by the deployment is archived.

func (BetaManagedAgentsMemoryStoreArchivedRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMemoryStoreArchivedRunError) UnmarshalJSON

func (r *BetaManagedAgentsMemoryStoreArchivedRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMemoryStoreArchivedRunErrorType

type BetaManagedAgentsMemoryStoreArchivedRunErrorType string
const (
	BetaManagedAgentsMemoryStoreArchivedRunErrorTypeMemoryStoreArchivedError BetaManagedAgentsMemoryStoreArchivedRunErrorType = "memory_store_archived_error"
)

type BetaManagedAgentsMemoryStoreResource

type BetaManagedAgentsMemoryStoreResource struct {
	// The memory store ID (memstore\_...). Must belong to the caller's organization
	// and workspace.
	MemoryStoreID string `json:"memory_store_id" api:"required"`
	// Any of "memory_store".
	Type BetaManagedAgentsMemoryStoreResourceType `json:"type" api:"required"`
	// Access mode for an attached memory store.
	//
	// Any of "read_write", "read_only".
	Access BetaManagedAgentsMemoryStoreResourceAccess `json:"access" api:"nullable"`
	// Description of the memory store, snapshotted at attach time. Rendered into the
	// agent's system prompt. Empty string when the store has no description.
	Description string `json:"description"`
	// Per-attachment guidance for the agent on how to use this store. Rendered into
	// the memory section of the system prompt. Max 4096 chars.
	Instructions string `json:"instructions" api:"nullable"`
	// Filesystem path where the store is mounted in the session container, e.g.
	// /mnt/memory/user-preferences. Derived from the store's name. Output-only.
	MountPath string `json:"mount_path" api:"nullable"`
	// Display name of the memory store, snapshotted at attach time. Later edits to the
	// store's name do not propagate to this resource.
	Name string `json:"name" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MemoryStoreID respjson.Field
		Type          respjson.Field
		Access        respjson.Field
		Description   respjson.Field
		Instructions  respjson.Field
		MountPath     respjson.Field
		Name          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A memory store attached to an agent session.

func (BetaManagedAgentsMemoryStoreResource) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMemoryStoreResource) UnmarshalJSON

func (r *BetaManagedAgentsMemoryStoreResource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMemoryStoreResourceAccess

type BetaManagedAgentsMemoryStoreResourceAccess string

Access mode for an attached memory store.

const (
	BetaManagedAgentsMemoryStoreResourceAccessReadWrite BetaManagedAgentsMemoryStoreResourceAccess = "read_write"
	BetaManagedAgentsMemoryStoreResourceAccessReadOnly  BetaManagedAgentsMemoryStoreResourceAccess = "read_only"
)

type BetaManagedAgentsMemoryStoreResourceConfig

type BetaManagedAgentsMemoryStoreResourceConfig struct {
	// The memory store ID (memstore\_...). Must belong to the caller's organization
	// and workspace.
	MemoryStoreID string `json:"memory_store_id" api:"required"`
	// Any of "memory_store".
	Type BetaManagedAgentsMemoryStoreResourceConfigType `json:"type" api:"required"`
	// Access mode for an attached memory store.
	//
	// Any of "read_write", "read_only".
	Access BetaManagedAgentsMemoryStoreResourceConfigAccess `json:"access" api:"nullable"`
	// Per-attachment guidance for the agent on how to use this store. Rendered into
	// the memory section of the system prompt. Max 4096 chars.
	Instructions string `json:"instructions" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MemoryStoreID respjson.Field
		Type          respjson.Field
		Access        respjson.Field
		Instructions  respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A memory store attached to each session created from this deployment.

func (BetaManagedAgentsMemoryStoreResourceConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMemoryStoreResourceConfig) UnmarshalJSON

func (r *BetaManagedAgentsMemoryStoreResourceConfig) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMemoryStoreResourceConfigAccess

type BetaManagedAgentsMemoryStoreResourceConfigAccess string

Access mode for an attached memory store.

const (
	BetaManagedAgentsMemoryStoreResourceConfigAccessReadWrite BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_write"
	BetaManagedAgentsMemoryStoreResourceConfigAccessReadOnly  BetaManagedAgentsMemoryStoreResourceConfigAccess = "read_only"
)

type BetaManagedAgentsMemoryStoreResourceConfigType

type BetaManagedAgentsMemoryStoreResourceConfigType string
const (
	BetaManagedAgentsMemoryStoreResourceConfigTypeMemoryStore BetaManagedAgentsMemoryStoreResourceConfigType = "memory_store"
)

type BetaManagedAgentsMemoryStoreResourceParam

type BetaManagedAgentsMemoryStoreResourceParam struct {
	// The memory store ID (memstore\_...). Must belong to the caller's organization
	// and workspace.
	MemoryStoreID string `json:"memory_store_id" api:"required"`
	// Any of "memory_store".
	Type BetaManagedAgentsMemoryStoreResourceParamType `json:"type,omitzero" api:"required"`
	// Per-attachment guidance for the agent on how to use this store. Rendered into
	// the memory section of the system prompt. Max 4096 chars.
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	// Access mode for an attached memory store.
	//
	// Any of "read_write", "read_only".
	Access BetaManagedAgentsMemoryStoreResourceParamAccess `json:"access,omitzero"`
	// contains filtered or unexported fields
}

Parameters for attaching a memory store to an agent session.

The properties MemoryStoreID, Type are required.

func (BetaManagedAgentsMemoryStoreResourceParam) MarshalJSON

func (r BetaManagedAgentsMemoryStoreResourceParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMemoryStoreResourceParam) UnmarshalJSON

func (r *BetaManagedAgentsMemoryStoreResourceParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMemoryStoreResourceParamAccess

type BetaManagedAgentsMemoryStoreResourceParamAccess string

Access mode for an attached memory store.

const (
	BetaManagedAgentsMemoryStoreResourceParamAccessReadWrite BetaManagedAgentsMemoryStoreResourceParamAccess = "read_write"
	BetaManagedAgentsMemoryStoreResourceParamAccessReadOnly  BetaManagedAgentsMemoryStoreResourceParamAccess = "read_only"
)

type BetaManagedAgentsMemoryStoreResourceParamType

type BetaManagedAgentsMemoryStoreResourceParamType string
const (
	BetaManagedAgentsMemoryStoreResourceParamTypeMemoryStore BetaManagedAgentsMemoryStoreResourceParamType = "memory_store"
)

type BetaManagedAgentsMemoryStoreResourceType

type BetaManagedAgentsMemoryStoreResourceType string
const (
	BetaManagedAgentsMemoryStoreResourceTypeMemoryStore BetaManagedAgentsMemoryStoreResourceType = "memory_store"
)

type BetaManagedAgentsMemoryStoreType

type BetaManagedAgentsMemoryStoreType string
const (
	BetaManagedAgentsMemoryStoreTypeMemoryStore BetaManagedAgentsMemoryStoreType = "memory_store"
)

type BetaManagedAgentsMemoryType

type BetaManagedAgentsMemoryType string
const (
	BetaManagedAgentsMemoryTypeMemory BetaManagedAgentsMemoryType = "memory"
)

type BetaManagedAgentsMemoryVersion

type BetaManagedAgentsMemoryVersion struct {
	// Unique identifier for this version (a `memver_...` value).
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// ID of the memory this version snapshots (a `mem_...` value). Remains valid after
	// the memory is deleted; pass it as `memory_id` to
	// [List memory versions](/en/api/beta/memory_stores/memory_versions/list) to
	// retrieve the full lineage including the `deleted` row.
	MemoryID string `json:"memory_id" api:"required"`
	// ID of the memory store this version belongs to (a `memstore_...` value).
	MemoryStoreID string `json:"memory_store_id" api:"required"`
	// The kind of mutation a `memory_version` records. Every non-no-op mutation to a
	// memory appends exactly one version row with one of these values.
	//
	// Any of "created", "modified", "deleted".
	Operation BetaManagedAgentsMemoryVersionOperation `json:"operation" api:"required"`
	// Any of "memory_version".
	Type BetaManagedAgentsMemoryVersionType `json:"type" api:"required"`
	// The memory's UTF-8 text content as of this version. `null` when `view=basic`,
	// when `operation` is `deleted`, or when `redacted_at` is set.
	Content string `json:"content" api:"nullable"`
	// Lowercase hex SHA-256 digest of `content` as of this version (64 characters).
	// `null` when `redacted_at` is set or `operation` is `deleted`. Populated
	// regardless of `view` otherwise.
	ContentSha256 string `json:"content_sha256" api:"nullable"`
	// Size of `content` in bytes as of this version. `null` when `redacted_at` is set
	// or `operation` is `deleted`. Populated regardless of `view` otherwise.
	ContentSizeBytes int64 `json:"content_size_bytes" api:"nullable"`
	// Identifies who performed a write or redact operation. Captured at write time on
	// the `memory_version` row. The API key that created a session is not recorded on
	// agent writes; attribution answers who made the write, not who is ultimately
	// responsible. Look up session provenance separately via the
	// [Sessions API](/en/api/sessions-retrieve).
	CreatedBy BetaManagedAgentsActorUnion `json:"created_by"`
	// The memory's path at the time of this write. `null` if and only if `redacted_at`
	// is set.
	Path string `json:"path" api:"nullable"`
	// A timestamp in RFC 3339 format
	RedactedAt time.Time `json:"redacted_at" api:"nullable" format:"date-time"`
	// Identifies who performed a write or redact operation. Captured at write time on
	// the `memory_version` row. The API key that created a session is not recorded on
	// agent writes; attribution answers who made the write, not who is ultimately
	// responsible. Look up session provenance separately via the
	// [Sessions API](/en/api/sessions-retrieve).
	RedactedBy BetaManagedAgentsActorUnion `json:"redacted_by"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		CreatedAt        respjson.Field
		MemoryID         respjson.Field
		MemoryStoreID    respjson.Field
		Operation        respjson.Field
		Type             respjson.Field
		Content          respjson.Field
		ContentSha256    respjson.Field
		ContentSizeBytes respjson.Field
		CreatedBy        respjson.Field
		Path             respjson.Field
		RedactedAt       respjson.Field
		RedactedBy       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A `memory_version` object: one immutable, attributed row in a memory's append-only history. Every non-no-op mutation to a memory produces a new version. Versions belong to the store (not the individual memory) and persist after the memory is deleted. Retrieving a redacted version returns 200 with `content`, `path`, `content_size_bytes`, and `content_sha256` set to `null`; branch on `redacted_at`, not HTTP status.

func (BetaManagedAgentsMemoryVersion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMemoryVersion) UnmarshalJSON

func (r *BetaManagedAgentsMemoryVersion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMemoryVersionOperation

type BetaManagedAgentsMemoryVersionOperation string

The kind of mutation a `memory_version` records. Every non-no-op mutation to a memory appends exactly one version row with one of these values.

const (
	BetaManagedAgentsMemoryVersionOperationCreated  BetaManagedAgentsMemoryVersionOperation = "created"
	BetaManagedAgentsMemoryVersionOperationModified BetaManagedAgentsMemoryVersionOperation = "modified"
	BetaManagedAgentsMemoryVersionOperationDeleted  BetaManagedAgentsMemoryVersionOperation = "deleted"
)

type BetaManagedAgentsMemoryVersionType

type BetaManagedAgentsMemoryVersionType string
const (
	BetaManagedAgentsMemoryVersionTypeMemoryVersion BetaManagedAgentsMemoryVersionType = "memory_version"
)

type BetaManagedAgentsMemoryView

type BetaManagedAgentsMemoryView string

Selects which projection of a `memory` or `memory_version` the server returns. `basic` returns the object with `content` set to `null`; `full` populates `content`. When omitted, the default is endpoint-specific: retrieve operations default to `full`; list, create, and update operations default to `basic`. Listing with `view=full` caps `limit` at 20.

const (
	BetaManagedAgentsMemoryViewBasic BetaManagedAgentsMemoryView = "basic"
	BetaManagedAgentsMemoryViewFull  BetaManagedAgentsMemoryView = "full"
)

type BetaManagedAgentsModel

type BetaManagedAgentsModel = string

The model that will power your agent.

See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional details and options.

const (
	BetaManagedAgentsModelHaijunSonnet5            BetaManagedAgentsModel = "haijun-sonnet-5"
	BetaManagedAgentsModelHaijunFable5             BetaManagedAgentsModel = "haijun-fable-5"
	BetaManagedAgentsModelHaijunOpus5              BetaManagedAgentsModel = "haijun-opus-5"
	BetaManagedAgentsModelHaijunOpus4_8            BetaManagedAgentsModel = "haijun-opus-4-8"
	BetaManagedAgentsModelHaijunOpus4_7            BetaManagedAgentsModel = "haijun-opus-4-7"
	BetaManagedAgentsModelHaijunOpus4_6            BetaManagedAgentsModel = "haijun-opus-4-6"
	BetaManagedAgentsModelHaijunSonnet4_6          BetaManagedAgentsModel = "haijun-sonnet-4-6"
	BetaManagedAgentsModelHaijunHaiku4_5           BetaManagedAgentsModel = "haijun-haiku-4-5"
	BetaManagedAgentsModelHaijunHaiku4_5_20251001  BetaManagedAgentsModel = "haijun-haiku-4-5-20251001"
	BetaManagedAgentsModelHaijunOpus4_5            BetaManagedAgentsModel = "haijun-opus-4-5"
	BetaManagedAgentsModelHaijunOpus4_5_20251101   BetaManagedAgentsModel = "haijun-opus-4-5-20251101"
	BetaManagedAgentsModelHaijunSonnet4_5          BetaManagedAgentsModel = "haijun-sonnet-4-5"
	BetaManagedAgentsModelHaijunSonnet4_5_20250929 BetaManagedAgentsModel = "haijun-sonnet-4-5-20250929"
)

type BetaManagedAgentsModelConfig

type BetaManagedAgentsModelConfig struct {
	// The model that will power your agent.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	ID BetaManagedAgentsModel `json:"id" api:"required"`
	// How hard haijun works on each turn. Sets `output_config.effort` on every
	// Messages call the session makes.
	Effort BetaManagedAgentsModelConfigEffortUnion `json:"effort"`
	// Geographic region for model inference. When unset, requests fall through to the
	// workspace's default_inference_geo.
	InferenceGeo string `json:"inference_geo"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed BetaManagedAgentsModelConfigSpeed `json:"speed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Effort       respjson.Field
		InferenceGeo respjson.Field
		Speed        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Model identifier and configuration.

func (BetaManagedAgentsModelConfig) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsModelConfig) UnmarshalJSON

func (r *BetaManagedAgentsModelConfig) UnmarshalJSON(data []byte) error

type BetaManagedAgentsModelConfigEffortUnion

type BetaManagedAgentsModelConfigEffortUnion struct {
	// Any of "low", "medium", "high", "xhigh", "max".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsModelConfigEffortUnion contains all possible properties and values from BetaManagedAgentsEffortLow, BetaManagedAgentsEffortMedium, BetaManagedAgentsEffortHigh, BetaManagedAgentsEffortXhigh, BetaManagedAgentsEffortMax.

Use the BetaManagedAgentsModelConfigEffortUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsModelConfigEffortUnion) AsAny

func (u BetaManagedAgentsModelConfigEffortUnion) AsAny() anyBetaManagedAgentsModelConfigEffort

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsModelConfigEffortUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsEffortLow:
case Juglow.BetaManagedAgentsEffortMedium:
case Juglow.BetaManagedAgentsEffortHigh:
case Juglow.BetaManagedAgentsEffortXhigh:
case Juglow.BetaManagedAgentsEffortMax:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsModelConfigEffortUnion) AsHigh

func (BetaManagedAgentsModelConfigEffortUnion) AsLow

func (BetaManagedAgentsModelConfigEffortUnion) AsMax

func (BetaManagedAgentsModelConfigEffortUnion) AsMedium

func (BetaManagedAgentsModelConfigEffortUnion) AsXhigh

func (BetaManagedAgentsModelConfigEffortUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsModelConfigEffortUnion) UnmarshalJSON

func (r *BetaManagedAgentsModelConfigEffortUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsModelConfigParams

type BetaManagedAgentsModelConfigParams struct {
	// The model that will power your agent.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	ID BetaManagedAgentsModel `json:"id,omitzero" api:"required"`
	// Geographic region for model inference. When unset, requests fall through to the
	// workspace's default_inference_geo. On update, `model` is whole-object
	// replacement — omitting inference_geo clears it.
	InferenceGeo param.Opt[string] `json:"inference_geo,omitzero"`
	// How hard haijun works on each inference call. Accepts a bare level string
	// (`"high"`) or `{"type": "high"}`. On create, omitting it resolves the per-model
	// default; on update, omitting it leaves the stored value unchanged.
	Effort BetaManagedAgentsModelConfigParamsEffortUnion `json:"effort,omitzero"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed BetaManagedAgentsModelConfigParamsSpeed `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

An object that defines additional configuration control over model use

The property ID is required.

func (BetaManagedAgentsModelConfigParams) MarshalJSON

func (r BetaManagedAgentsModelConfigParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsModelConfigParams) UnmarshalJSON

func (r *BetaManagedAgentsModelConfigParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel

type BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel string

How hard haijun works on each turn. Higher levels favor reasoning depth over latency. Not all models accept every level; invalid combinations are rejected at create time.

const (
	BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelLow    BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "low"
	BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelMedium BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "medium"
	BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelHigh   BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "high"
	BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelXhigh  BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "xhigh"
	BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevelMax    BetaManagedAgentsModelConfigParamsEffortBetaManagedAgentsEffortLevel = "max"
)

type BetaManagedAgentsModelConfigParamsEffortUnion

type BetaManagedAgentsModelConfigParamsEffortUnion struct {
	// Check if union is this variant with
	// !param.IsOmitted(union.OfBetaManagedAgentsModelConfigsEffortBetaManagedAgentsEffortLevel)
	OfBetaManagedAgentsModelConfigsEffortBetaManagedAgentsEffortLevel param.Opt[string]                   `json:",omitzero,inline"`
	OfBetaManagedAgentsEffortLow                                      *BetaManagedAgentsEffortLowParam    `json:",omitzero,inline"`
	OfBetaManagedAgentsEffortMedium                                   *BetaManagedAgentsEffortMediumParam `json:",omitzero,inline"`
	OfBetaManagedAgentsEffortHigh                                     *BetaManagedAgentsEffortHighParam   `json:",omitzero,inline"`
	OfBetaManagedAgentsEffortXhigh                                    *BetaManagedAgentsEffortXhighParam  `json:",omitzero,inline"`
	OfBetaManagedAgentsEffortMax                                      *BetaManagedAgentsEffortMaxParam    `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 (BetaManagedAgentsModelConfigParamsEffortUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsModelConfigParamsEffortUnion) MarshalJSON

func (*BetaManagedAgentsModelConfigParamsEffortUnion) UnmarshalJSON

func (u *BetaManagedAgentsModelConfigParamsEffortUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsModelConfigParamsSpeed

type BetaManagedAgentsModelConfigParamsSpeed string

Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

const (
	BetaManagedAgentsModelConfigParamsSpeedStandard BetaManagedAgentsModelConfigParamsSpeed = "standard"
	BetaManagedAgentsModelConfigParamsSpeedFast     BetaManagedAgentsModelConfigParamsSpeed = "fast"
)

type BetaManagedAgentsModelConfigSpeed

type BetaManagedAgentsModelConfigSpeed string

Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

const (
	BetaManagedAgentsModelConfigSpeedStandard BetaManagedAgentsModelConfigSpeed = "standard"
	BetaManagedAgentsModelConfigSpeedFast     BetaManagedAgentsModelConfigSpeed = "fast"
)

type BetaManagedAgentsModelOverloadedError

type BetaManagedAgentsModelOverloadedError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// What the client should do next in response to this error.
	RetryStatus BetaManagedAgentsModelOverloadedErrorRetryStatusUnion `json:"retry_status" api:"required"`
	// Any of "model_overloaded_error".
	Type BetaManagedAgentsModelOverloadedErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		RetryStatus respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The model is currently overloaded. Emitted after automatic retries are exhausted.

func (BetaManagedAgentsModelOverloadedError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsModelOverloadedError) UnmarshalJSON

func (r *BetaManagedAgentsModelOverloadedError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsModelOverloadedErrorRetryStatusUnion

type BetaManagedAgentsModelOverloadedErrorRetryStatusUnion struct {
	// Any of "retrying", "exhausted", "terminal".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsModelOverloadedErrorRetryStatusUnion contains all possible properties and values from BetaManagedAgentsRetryStatusRetrying, BetaManagedAgentsRetryStatusExhausted, BetaManagedAgentsRetryStatusTerminal.

Use the BetaManagedAgentsModelOverloadedErrorRetryStatusUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsModelOverloadedErrorRetryStatusUnion) AsAny

func (u BetaManagedAgentsModelOverloadedErrorRetryStatusUnion) AsAny() anyBetaManagedAgentsModelOverloadedErrorRetryStatus

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsModelOverloadedErrorRetryStatusUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsRetryStatusRetrying:
case Juglow.BetaManagedAgentsRetryStatusExhausted:
case Juglow.BetaManagedAgentsRetryStatusTerminal:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsModelOverloadedErrorRetryStatusUnion) AsExhausted

func (BetaManagedAgentsModelOverloadedErrorRetryStatusUnion) AsRetrying

func (BetaManagedAgentsModelOverloadedErrorRetryStatusUnion) AsTerminal

func (BetaManagedAgentsModelOverloadedErrorRetryStatusUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsModelOverloadedErrorRetryStatusUnion) UnmarshalJSON

type BetaManagedAgentsModelOverloadedErrorType

type BetaManagedAgentsModelOverloadedErrorType string
const (
	BetaManagedAgentsModelOverloadedErrorTypeModelOverloadedError BetaManagedAgentsModelOverloadedErrorType = "model_overloaded_error"
)

type BetaManagedAgentsModelRateLimitedError

type BetaManagedAgentsModelRateLimitedError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// What the client should do next in response to this error.
	RetryStatus BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion `json:"retry_status" api:"required"`
	// Any of "model_rate_limited_error".
	Type BetaManagedAgentsModelRateLimitedErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		RetryStatus respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The model request was rate-limited.

func (BetaManagedAgentsModelRateLimitedError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsModelRateLimitedError) UnmarshalJSON

func (r *BetaManagedAgentsModelRateLimitedError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion

type BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion struct {
	// Any of "retrying", "exhausted", "terminal".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion contains all possible properties and values from BetaManagedAgentsRetryStatusRetrying, BetaManagedAgentsRetryStatusExhausted, BetaManagedAgentsRetryStatusTerminal.

Use the BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion) AsAny

func (u BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion) AsAny() anyBetaManagedAgentsModelRateLimitedErrorRetryStatus

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsRetryStatusRetrying:
case Juglow.BetaManagedAgentsRetryStatusExhausted:
case Juglow.BetaManagedAgentsRetryStatusTerminal:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion) AsExhausted

func (BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion) AsRetrying

func (BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion) AsTerminal

func (BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion) UnmarshalJSON

type BetaManagedAgentsModelRateLimitedErrorType

type BetaManagedAgentsModelRateLimitedErrorType string
const (
	BetaManagedAgentsModelRateLimitedErrorTypeModelRateLimitedError BetaManagedAgentsModelRateLimitedErrorType = "model_rate_limited_error"
)

type BetaManagedAgentsModelRequestFailedError

type BetaManagedAgentsModelRequestFailedError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// What the client should do next in response to this error.
	RetryStatus BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion `json:"retry_status" api:"required"`
	// Any of "model_request_failed_error".
	Type BetaManagedAgentsModelRequestFailedErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		RetryStatus respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A model request failed for a reason other than overload or rate-limiting.

func (BetaManagedAgentsModelRequestFailedError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsModelRequestFailedError) UnmarshalJSON

func (r *BetaManagedAgentsModelRequestFailedError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion

type BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion struct {
	// Any of "retrying", "exhausted", "terminal".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion contains all possible properties and values from BetaManagedAgentsRetryStatusRetrying, BetaManagedAgentsRetryStatusExhausted, BetaManagedAgentsRetryStatusTerminal.

Use the BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion) AsAny

func (u BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion) AsAny() anyBetaManagedAgentsModelRequestFailedErrorRetryStatus

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsRetryStatusRetrying:
case Juglow.BetaManagedAgentsRetryStatusExhausted:
case Juglow.BetaManagedAgentsRetryStatusTerminal:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion) AsExhausted

func (BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion) AsRetrying

func (BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion) AsTerminal

func (BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion) UnmarshalJSON

type BetaManagedAgentsModelRequestFailedErrorType

type BetaManagedAgentsModelRequestFailedErrorType string
const (
	BetaManagedAgentsModelRequestFailedErrorTypeModelRequestFailedError BetaManagedAgentsModelRequestFailedErrorType = "model_request_failed_error"
)

type BetaManagedAgentsMultiagent

type BetaManagedAgentsMultiagent struct {
	// Agents the coordinator may spawn as session threads, each resolved to a specific
	// version.
	Agents []BetaManagedAgentsMultiagentAgentUnion `json:"agents" api:"required"`
	// Any of "coordinator".
	Type BetaManagedAgentsMultiagentType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Agents      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolved coordinator topology with a concrete agent roster.

func (BetaManagedAgentsMultiagent) RawJSON

func (r BetaManagedAgentsMultiagent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMultiagent) UnmarshalJSON

func (r *BetaManagedAgentsMultiagent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMultiagentAgentUnion

type BetaManagedAgentsMultiagentAgentUnion struct {
	// This field is from variant [BetaManagedAgentsAgentReference].
	ID string `json:"id"`
	// Any of "agent", "advisor".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsAgentReference].
	Version int64 `json:"version"`
	// This field is from variant [BetaManagedAgentsAdvisor].
	Model string `json:"model"`
	JSON  struct {
		ID      respjson.Field
		Type    respjson.Field
		Version respjson.Field
		Model   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsMultiagentAgentUnion contains all possible properties and values from BetaManagedAgentsAgentReference, BetaManagedAgentsAdvisor.

Use the BetaManagedAgentsMultiagentAgentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsMultiagentAgentUnion) AsAdvisor

func (BetaManagedAgentsMultiagentAgentUnion) AsAgent

func (BetaManagedAgentsMultiagentAgentUnion) AsAny

func (u BetaManagedAgentsMultiagentAgentUnion) AsAny() anyBetaManagedAgentsMultiagentAgent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsMultiagentAgentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsAgentReference:
case Juglow.BetaManagedAgentsAdvisor:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsMultiagentAgentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsMultiagentAgentUnion) UnmarshalJSON

func (r *BetaManagedAgentsMultiagentAgentUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMultiagentParams

type BetaManagedAgentsMultiagentParams struct {
	// Agents the coordinator may spawn as session threads. 1–20 entries. Each entry is
	// an agent ID string, a versioned `{"type":"agent","id","version"}` reference, or
	// `{"type":"self"}` to allow recursive self-invocation. Entries must reference
	// distinct agents (after resolving `self` and string forms); at most one `self`.
	// Referenced agents must exist, must not be archived, and must not themselves have
	// `multiagent` set (depth limit 1).
	Agents []BetaManagedAgentsMultiagentRosterEntryParamsUnion `json:"agents,omitzero" api:"required"`
	// Any of "coordinator".
	Type BetaManagedAgentsMultiagentParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

A coordinator topology: the session's primary thread orchestrates work by spawning session threads, each running an agent drawn from the `agents` roster.

The properties Agents, Type are required.

func (BetaManagedAgentsMultiagentParams) MarshalJSON

func (r BetaManagedAgentsMultiagentParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMultiagentParams) UnmarshalJSON

func (r *BetaManagedAgentsMultiagentParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMultiagentParamsType

type BetaManagedAgentsMultiagentParamsType string
const (
	BetaManagedAgentsMultiagentParamsTypeCoordinator BetaManagedAgentsMultiagentParamsType = "coordinator"
)

type BetaManagedAgentsMultiagentRosterEntryParamsUnion

type BetaManagedAgentsMultiagentRosterEntryParamsUnion struct {
	OfString                           param.Opt[string]                      `json:",omitzero,inline"`
	OfBetaManagedAgentsAgents          *BetaManagedAgentsAgentParams          `json:",omitzero,inline"`
	OfBetaManagedAgentsMultiagentSelfs *BetaManagedAgentsMultiagentSelfParams `json:",omitzero,inline"`
	OfBetaManagedAgentsAdvisors        *BetaManagedAgentsAdvisorParams        `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 (BetaManagedAgentsMultiagentRosterEntryParamsUnion) GetID

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMultiagentRosterEntryParamsUnion) GetModel

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMultiagentRosterEntryParamsUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMultiagentRosterEntryParamsUnion) GetVersion

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsMultiagentRosterEntryParamsUnion) MarshalJSON

func (*BetaManagedAgentsMultiagentRosterEntryParamsUnion) UnmarshalJSON

type BetaManagedAgentsMultiagentSelfParams

type BetaManagedAgentsMultiagentSelfParams struct {
	// Any of "self".
	Type BetaManagedAgentsMultiagentSelfParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Sentinel roster entry meaning "the agent that owns this configuration". Resolved server-side to a concrete agent reference.

The property Type is required.

func (BetaManagedAgentsMultiagentSelfParams) MarshalJSON

func (r BetaManagedAgentsMultiagentSelfParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsMultiagentSelfParams) UnmarshalJSON

func (r *BetaManagedAgentsMultiagentSelfParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsMultiagentSelfParamsType

type BetaManagedAgentsMultiagentSelfParamsType string
const (
	BetaManagedAgentsMultiagentSelfParamsTypeSelf BetaManagedAgentsMultiagentSelfParamsType = "self"
)

type BetaManagedAgentsMultiagentType

type BetaManagedAgentsMultiagentType string
const (
	BetaManagedAgentsMultiagentTypeCoordinator BetaManagedAgentsMultiagentType = "coordinator"
)

type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError

type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError struct {
	// Any of "organization_disabled_error".
	Type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's organization is disabled.

func (BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType

type BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorTypeOrganizationDisabledError BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonErrorType = "organization_disabled_error"
)

type BetaManagedAgentsOrganizationDisabledRunError

type BetaManagedAgentsOrganizationDisabledRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "organization_disabled_error".
	Type BetaManagedAgentsOrganizationDisabledRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's organization is disabled.

func (BetaManagedAgentsOrganizationDisabledRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsOrganizationDisabledRunError) UnmarshalJSON

func (r *BetaManagedAgentsOrganizationDisabledRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsOrganizationDisabledRunErrorType

type BetaManagedAgentsOrganizationDisabledRunErrorType string
const (
	BetaManagedAgentsOrganizationDisabledRunErrorTypeOrganizationDisabledError BetaManagedAgentsOrganizationDisabledRunErrorType = "organization_disabled_error"
)

type BetaManagedAgentsOutcomeEvaluationResource

type BetaManagedAgentsOutcomeEvaluationResource struct {
	// A timestamp in RFC 3339 format
	CompletedAt time.Time `json:"completed_at" api:"required" format:"date-time"`
	// What the agent should produce.
	Description string `json:"description" api:"required"`
	// Grader's verdict text from the most recent evaluation. For satisfied, explains
	// why criteria are met; for needs_revision (intermediate), what's missing; for
	// failed, why unrecoverable.
	Explanation string `json:"explanation" api:"required"`
	// 0-indexed revision cycle the outcome is currently on.
	Iteration int64 `json:"iteration" api:"required"`
	// Server-generated outc\_ ID for this outcome.
	OutcomeID string `json:"outcome_id" api:"required"`
	// Current evaluation state. `pending` before the agent begins work; `running`
	// while producing or revising; `evaluating` while the grader scores;
	// `satisfied`/`max_iterations_reached`/`failed`/`interrupted` are terminal.
	Result string `json:"result" api:"required"`
	// Any of "outcome_evaluation".
	Type BetaManagedAgentsOutcomeEvaluationResourceType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletedAt respjson.Field
		Description respjson.Field
		Explanation respjson.Field
		Iteration   respjson.Field
		OutcomeID   respjson.Field
		Result      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Evaluation state for a single outcome defined via a define_outcome event.

func (BetaManagedAgentsOutcomeEvaluationResource) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsOutcomeEvaluationResource) UnmarshalJSON

func (r *BetaManagedAgentsOutcomeEvaluationResource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsOutcomeEvaluationResourceType

type BetaManagedAgentsOutcomeEvaluationResourceType string
const (
	BetaManagedAgentsOutcomeEvaluationResourceTypeOutcomeEvaluation BetaManagedAgentsOutcomeEvaluationResourceType = "outcome_evaluation"
)

type BetaManagedAgentsPlainTextDocumentSource

type BetaManagedAgentsPlainTextDocumentSource struct {
	// The plain text content.
	Data string `json:"data" api:"required"`
	// MIME type of the text content. Must be "text/plain".
	//
	// Any of "text/plain".
	MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType `json:"media_type" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsPlainTextDocumentSourceType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		MediaType   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Plain text document content.

func (BetaManagedAgentsPlainTextDocumentSource) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsPlainTextDocumentSource) ToParam

ToParam converts this BetaManagedAgentsPlainTextDocumentSource to a BetaManagedAgentsPlainTextDocumentSourceParam.

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 BetaManagedAgentsPlainTextDocumentSourceParam.Overrides()

func (*BetaManagedAgentsPlainTextDocumentSource) UnmarshalJSON

func (r *BetaManagedAgentsPlainTextDocumentSource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsPlainTextDocumentSourceMediaType

type BetaManagedAgentsPlainTextDocumentSourceMediaType string

MIME type of the text content. Must be "text/plain".

const (
	BetaManagedAgentsPlainTextDocumentSourceMediaTypeTextPlain BetaManagedAgentsPlainTextDocumentSourceMediaType = "text/plain"
)

type BetaManagedAgentsPlainTextDocumentSourceParam

type BetaManagedAgentsPlainTextDocumentSourceParam struct {
	// The plain text content.
	Data string `json:"data" api:"required"`
	// MIME type of the text content. Must be "text/plain".
	//
	// Any of "text/plain".
	MediaType BetaManagedAgentsPlainTextDocumentSourceMediaType `json:"media_type,omitzero" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsPlainTextDocumentSourceType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Plain text document content.

The properties Data, MediaType, Type are required.

func (BetaManagedAgentsPlainTextDocumentSourceParam) MarshalJSON

func (r BetaManagedAgentsPlainTextDocumentSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsPlainTextDocumentSourceParam) UnmarshalJSON

func (r *BetaManagedAgentsPlainTextDocumentSourceParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsPlainTextDocumentSourceType

type BetaManagedAgentsPlainTextDocumentSourceType string
const (
	BetaManagedAgentsPlainTextDocumentSourceTypeText BetaManagedAgentsPlainTextDocumentSourceType = "text"
)

type BetaManagedAgentsPreconditionParam

type BetaManagedAgentsPreconditionParam struct {
	// Any of "content_sha256".
	Type BetaManagedAgentsPreconditionType `json:"type,omitzero" api:"required"`
	// Expected `content_sha256` of the stored memory (64 lowercase hexadecimal
	// characters). Typically the `content_sha256` returned by a prior read or list
	// call. Because the server applies no content normalization, clients can also
	// compute this locally as the SHA-256 of the UTF-8 content bytes.
	ContentSha256 param.Opt[string] `json:"content_sha256,omitzero"`
	// contains filtered or unexported fields
}

Optimistic-concurrency precondition: the update applies only if the memory's stored `content_sha256` equals the supplied value. On mismatch, the request returns `memory_precondition_failed_error` (HTTP 409); re-read the memory and retry against the fresh state. If the precondition fails but the stored state already exactly matches the requested `content` and `path`, the server returns 200 instead of 409.

The property Type is required.

func (BetaManagedAgentsPreconditionParam) MarshalJSON

func (r BetaManagedAgentsPreconditionParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsPreconditionParam) UnmarshalJSON

func (r *BetaManagedAgentsPreconditionParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsPreconditionType

type BetaManagedAgentsPreconditionType string
const (
	BetaManagedAgentsPreconditionTypeContentSha256 BetaManagedAgentsPreconditionType = "content_sha256"
)

type BetaManagedAgentsRedactedBlock

type BetaManagedAgentsRedactedBlock struct {
	// Any of "redacted".
	Type BetaManagedAgentsRedactedBlockType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Placeholder for content withheld by Juglow model policy.

func (BetaManagedAgentsRedactedBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsRedactedBlock) ToParam

ToParam converts this BetaManagedAgentsRedactedBlock to a BetaManagedAgentsRedactedBlockParam.

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 BetaManagedAgentsRedactedBlockParam.Overrides()

func (*BetaManagedAgentsRedactedBlock) UnmarshalJSON

func (r *BetaManagedAgentsRedactedBlock) UnmarshalJSON(data []byte) error

type BetaManagedAgentsRedactedBlockParam

type BetaManagedAgentsRedactedBlockParam struct {
	// Any of "redacted".
	Type BetaManagedAgentsRedactedBlockType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Placeholder for content withheld by Juglow model policy.

The property Type is required.

func (BetaManagedAgentsRedactedBlockParam) MarshalJSON

func (r BetaManagedAgentsRedactedBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsRedactedBlockParam) UnmarshalJSON

func (r *BetaManagedAgentsRedactedBlockParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsRedactedBlockType

type BetaManagedAgentsRedactedBlockType string
const (
	BetaManagedAgentsRedactedBlockTypeRedacted BetaManagedAgentsRedactedBlockType = "redacted"
)

type BetaManagedAgentsRefreshHTTPResponse

type BetaManagedAgentsRefreshHTTPResponse struct {
	// Response body. May be truncated and has sensitive values scrubbed.
	Body string `json:"body" api:"required"`
	// Whether `body` was truncated.
	BodyTruncated bool `json:"body_truncated" api:"required"`
	// Value of the `Content-Type` response header.
	ContentType string `json:"content_type" api:"required"`
	// HTTP status code.
	StatusCode int64 `json:"status_code" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Body          respjson.Field
		BodyTruncated respjson.Field
		ContentType   respjson.Field
		StatusCode    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An HTTP response captured during a credential validation probe.

func (BetaManagedAgentsRefreshHTTPResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsRefreshHTTPResponse) UnmarshalJSON

func (r *BetaManagedAgentsRefreshHTTPResponse) UnmarshalJSON(data []byte) error

type BetaManagedAgentsRefreshObject

type BetaManagedAgentsRefreshObject struct {
	// An HTTP response captured during a credential validation probe.
	HTTPResponse BetaManagedAgentsRefreshHTTPResponse `json:"http_response" api:"required"`
	// Outcome of a refresh-token exchange attempted during credential validation.
	//
	// Any of "succeeded", "failed", "connect_error", "no_refresh_token".
	Status BetaManagedAgentsRefreshObjectStatus `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HTTPResponse respjson.Field
		Status       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Outcome of a refresh-token exchange attempted during credential validation.

func (BetaManagedAgentsRefreshObject) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsRefreshObject) UnmarshalJSON

func (r *BetaManagedAgentsRefreshObject) UnmarshalJSON(data []byte) error

type BetaManagedAgentsRefreshObjectStatus

type BetaManagedAgentsRefreshObjectStatus string

Outcome of a refresh-token exchange attempted during credential validation.

const (
	BetaManagedAgentsRefreshObjectStatusSucceeded      BetaManagedAgentsRefreshObjectStatus = "succeeded"
	BetaManagedAgentsRefreshObjectStatusFailed         BetaManagedAgentsRefreshObjectStatus = "failed"
	BetaManagedAgentsRefreshObjectStatusConnectError   BetaManagedAgentsRefreshObjectStatus = "connect_error"
	BetaManagedAgentsRefreshObjectStatusNoRefreshToken BetaManagedAgentsRefreshObjectStatus = "no_refresh_token"
)

type BetaManagedAgentsRetryStatusExhausted

type BetaManagedAgentsRetryStatusExhausted struct {
	// Any of "exhausted".
	Type BetaManagedAgentsRetryStatusExhaustedType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

This turn is dead; queued inputs are flushed and the session returns to idle. Client may send a new prompt.

func (BetaManagedAgentsRetryStatusExhausted) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsRetryStatusExhausted) UnmarshalJSON

func (r *BetaManagedAgentsRetryStatusExhausted) UnmarshalJSON(data []byte) error

type BetaManagedAgentsRetryStatusExhaustedType

type BetaManagedAgentsRetryStatusExhaustedType string
const (
	BetaManagedAgentsRetryStatusExhaustedTypeExhausted BetaManagedAgentsRetryStatusExhaustedType = "exhausted"
)

type BetaManagedAgentsRetryStatusRetrying

type BetaManagedAgentsRetryStatusRetrying struct {
	// Any of "retrying".
	Type BetaManagedAgentsRetryStatusRetryingType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The server is retrying automatically. Client should wait; the same error type may fire again as retrying, then once as exhausted when the retry budget runs out.

func (BetaManagedAgentsRetryStatusRetrying) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsRetryStatusRetrying) UnmarshalJSON

func (r *BetaManagedAgentsRetryStatusRetrying) UnmarshalJSON(data []byte) error

type BetaManagedAgentsRetryStatusRetryingType

type BetaManagedAgentsRetryStatusRetryingType string
const (
	BetaManagedAgentsRetryStatusRetryingTypeRetrying BetaManagedAgentsRetryStatusRetryingType = "retrying"
)

type BetaManagedAgentsRetryStatusTerminal

type BetaManagedAgentsRetryStatusTerminal struct {
	// Any of "terminal".
	Type BetaManagedAgentsRetryStatusTerminalType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The session encountered a terminal error and will transition to `terminated` state.

func (BetaManagedAgentsRetryStatusTerminal) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsRetryStatusTerminal) UnmarshalJSON

func (r *BetaManagedAgentsRetryStatusTerminal) UnmarshalJSON(data []byte) error

type BetaManagedAgentsRetryStatusTerminalType

type BetaManagedAgentsRetryStatusTerminalType string
const (
	BetaManagedAgentsRetryStatusTerminalTypeTerminal BetaManagedAgentsRetryStatusTerminalType = "terminal"
)

type BetaManagedAgentsSchedule

type BetaManagedAgentsSchedule struct {
	// 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g.,
	// "0 9 \* \* 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean
	// Sunday. Extended cron syntax - seconds or year fields, and the special
	// characters L, W, #, and ? - is not supported, nor are predefined shortcuts
	// (@daily).
	Expression string `json:"expression" api:"required"`
	// IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").
	Timezone string `json:"timezone" api:"required"`
	// Any of "cron".
	Type BetaManagedAgentsScheduleType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	LastRunAt time.Time `json:"last_run_at" api:"nullable" format:"date-time"`
	// Up to 5 timestamps of upcoming cron occurrences. Non-empty for active and paused
	// deployments (reflects what the schedule would do if unpaused); empty once the
	// deployment is archived (`archived_at` set). Each fire is offset by a small
	// per-schedule jitter, so a run will actually start at or shortly after its listed
	// time.
	UpcomingRunsAt []time.Time `json:"upcoming_runs_at" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Expression     respjson.Field
		Timezone       respjson.Field
		Type           respjson.Field
		LastRunAt      respjson.Field
		UpcomingRunsAt respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

5-field POSIX cron schedule with computed runtime timestamps.

func (BetaManagedAgentsSchedule) RawJSON

func (r BetaManagedAgentsSchedule) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSchedule) UnmarshalJSON

func (r *BetaManagedAgentsSchedule) UnmarshalJSON(data []byte) error

type BetaManagedAgentsScheduleParams

type BetaManagedAgentsScheduleParams struct {
	// 5-field POSIX cron expression: minute hour day-of-month month day-of-week (e.g.,
	// "0 9 \* \* 1-5" for weekdays at 9am). Day-of-week is 0-7 where 0 and 7 both mean
	// Sunday. Extended cron syntax - seconds or year fields, and the special
	// characters L, W, #, and ? - is not supported, nor are predefined shortcuts
	// (@daily).
	Expression string `json:"expression" api:"required"`
	// Required. IANA timezone identifier (e.g., "America/Los_Angeles", "UTC").
	// Validated against the IANA timezone database.
	Timezone string `json:"timezone" api:"required"`
	// Any of "cron".
	Type BetaManagedAgentsScheduleParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

5-field POSIX cron schedule. Literal wall-clock matching in the configured timezone.

The properties Expression, Timezone, Type are required.

func (BetaManagedAgentsScheduleParams) MarshalJSON

func (r BetaManagedAgentsScheduleParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsScheduleParams) UnmarshalJSON

func (r *BetaManagedAgentsScheduleParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsScheduleParamsType

type BetaManagedAgentsScheduleParamsType string
const (
	BetaManagedAgentsScheduleParamsTypeCron BetaManagedAgentsScheduleParamsType = "cron"
)

type BetaManagedAgentsScheduleTriggerContext

type BetaManagedAgentsScheduleTriggerContext struct {
	// A timestamp in RFC 3339 format
	ScheduledAt time.Time `json:"scheduled_at" api:"required" format:"date-time"`
	// Any of "schedule".
	Type BetaManagedAgentsScheduleTriggerContextType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ScheduledAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The run was fired by the deployment's cron schedule.

func (BetaManagedAgentsScheduleTriggerContext) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsScheduleTriggerContext) UnmarshalJSON

func (r *BetaManagedAgentsScheduleTriggerContext) UnmarshalJSON(data []byte) error

type BetaManagedAgentsScheduleTriggerContextType

type BetaManagedAgentsScheduleTriggerContextType string
const (
	BetaManagedAgentsScheduleTriggerContextTypeSchedule BetaManagedAgentsScheduleTriggerContextType = "schedule"
)

type BetaManagedAgentsScheduleType

type BetaManagedAgentsScheduleType string
const (
	BetaManagedAgentsScheduleTypeCron BetaManagedAgentsScheduleType = "cron"
)

type BetaManagedAgentsSearchResultBlock

type BetaManagedAgentsSearchResultBlock struct {
	// Citation settings for a search result.
	Citations BetaManagedAgentsSearchResultCitations `json:"citations" api:"required"`
	// Array of text content blocks from the search result.
	Content []BetaManagedAgentsSearchResultContent `json:"content" api:"required"`
	// The URL source of the search result.
	Source string `json:"source" api:"required"`
	// The title of the search result.
	Title string `json:"title" api:"required"`
	// Any of "search_result".
	Type BetaManagedAgentsSearchResultBlockType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Citations   respjson.Field
		Content     respjson.Field
		Source      respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A block containing a web search result.

func (BetaManagedAgentsSearchResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsSearchResultBlock) ToParam

ToParam converts this BetaManagedAgentsSearchResultBlock to a BetaManagedAgentsSearchResultBlockParam.

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 BetaManagedAgentsSearchResultBlockParam.Overrides()

func (*BetaManagedAgentsSearchResultBlock) UnmarshalJSON

func (r *BetaManagedAgentsSearchResultBlock) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSearchResultBlockParam

type BetaManagedAgentsSearchResultBlockParam struct {
	// Citation settings for a search result.
	Citations BetaManagedAgentsSearchResultCitationsParam `json:"citations,omitzero" api:"required"`
	// Array of text content blocks from the search result.
	Content []BetaManagedAgentsSearchResultContentParam `json:"content,omitzero" api:"required"`
	// The URL source of the search result.
	Source string `json:"source" api:"required"`
	// The title of the search result.
	Title string `json:"title" api:"required"`
	// Any of "search_result".
	Type BetaManagedAgentsSearchResultBlockType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

A block containing a web search result.

The properties Citations, Content, Source, Title, Type are required.

func (BetaManagedAgentsSearchResultBlockParam) MarshalJSON

func (r BetaManagedAgentsSearchResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsSearchResultBlockParam) UnmarshalJSON

func (r *BetaManagedAgentsSearchResultBlockParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSearchResultBlockType

type BetaManagedAgentsSearchResultBlockType string
const (
	BetaManagedAgentsSearchResultBlockTypeSearchResult BetaManagedAgentsSearchResultBlockType = "search_result"
)

type BetaManagedAgentsSearchResultCitations

type BetaManagedAgentsSearchResultCitations struct {
	// Whether citations are enabled for this search result.
	Enabled bool `json:"enabled" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Citation settings for a search result.

func (BetaManagedAgentsSearchResultCitations) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsSearchResultCitations) ToParam

ToParam converts this BetaManagedAgentsSearchResultCitations to a BetaManagedAgentsSearchResultCitationsParam.

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 BetaManagedAgentsSearchResultCitationsParam.Overrides()

func (*BetaManagedAgentsSearchResultCitations) UnmarshalJSON

func (r *BetaManagedAgentsSearchResultCitations) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSearchResultCitationsParam

type BetaManagedAgentsSearchResultCitationsParam struct {
	// Whether citations are enabled for this search result.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Citation settings for a search result.

The property Enabled is required.

func (BetaManagedAgentsSearchResultCitationsParam) MarshalJSON

func (r BetaManagedAgentsSearchResultCitationsParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsSearchResultCitationsParam) UnmarshalJSON

func (r *BetaManagedAgentsSearchResultCitationsParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSearchResultContent

type BetaManagedAgentsSearchResultContent struct {
	// The text content.
	Text string `json:"text" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsSearchResultContentType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Text content within a search result.

func (BetaManagedAgentsSearchResultContent) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsSearchResultContent) ToParam

ToParam converts this BetaManagedAgentsSearchResultContent to a BetaManagedAgentsSearchResultContentParam.

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 BetaManagedAgentsSearchResultContentParam.Overrides()

func (*BetaManagedAgentsSearchResultContent) UnmarshalJSON

func (r *BetaManagedAgentsSearchResultContent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSearchResultContentParam

type BetaManagedAgentsSearchResultContentParam struct {
	// The text content.
	Text string `json:"text" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsSearchResultContentType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Text content within a search result.

The properties Text, Type are required.

func (BetaManagedAgentsSearchResultContentParam) MarshalJSON

func (r BetaManagedAgentsSearchResultContentParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsSearchResultContentParam) UnmarshalJSON

func (r *BetaManagedAgentsSearchResultContentParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSearchResultContentType

type BetaManagedAgentsSearchResultContentType string
const (
	BetaManagedAgentsSearchResultContentTypeText BetaManagedAgentsSearchResultContentType = "text"
)

type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError

type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError struct {
	// Any of "self_hosted_resources_unsupported_error".
	Type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment configures resources, but its environment is self-hosted and cannot mount them.

func (BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType

type BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorTypeSelfHostedResourcesUnsupportedError BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonErrorType = "self_hosted_resources_unsupported_error"
)

type BetaManagedAgentsSelfHostedResourcesUnsupportedRunError

type BetaManagedAgentsSelfHostedResourcesUnsupportedRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "self_hosted_resources_unsupported_error".
	Type BetaManagedAgentsSelfHostedResourcesUnsupportedRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment configures resources, but its environment is self-hosted and cannot mount them.

func (BetaManagedAgentsSelfHostedResourcesUnsupportedRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSelfHostedResourcesUnsupportedRunError) UnmarshalJSON

type BetaManagedAgentsSelfHostedResourcesUnsupportedRunErrorType

type BetaManagedAgentsSelfHostedResourcesUnsupportedRunErrorType string
const (
	BetaManagedAgentsSelfHostedResourcesUnsupportedRunErrorTypeSelfHostedResourcesUnsupportedError BetaManagedAgentsSelfHostedResourcesUnsupportedRunErrorType = "self_hosted_resources_unsupported_error"
)

type BetaManagedAgentsSendSessionEvents

type BetaManagedAgentsSendSessionEvents struct {
	// Sent events
	Data []BetaManagedAgentsSendSessionEventsDataUnion `json:"data"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Events that were successfully sent to the session.

func (BetaManagedAgentsSendSessionEvents) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSendSessionEvents) UnmarshalJSON

func (r *BetaManagedAgentsSendSessionEvents) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSendSessionEventsDataUnion

type BetaManagedAgentsSendSessionEventsDataUnion struct {
	ID string `json:"id"`
	// This field is a union of [[]BetaManagedAgentsUserMessageEventContentUnion],
	// [[]BetaManagedAgentsUserCustomToolResultEventContentUnion],
	// [[]BetaManagedAgentsUserToolResultEventContentUnion],
	// [[]BetaManagedAgentsSystemContentBlock]
	Content BetaManagedAgentsSendSessionEventsDataUnionContent `json:"content"`
	// Any of "user.message", "user.interrupt", "user.tool_confirmation",
	// "user.custom_tool_result", "user.define_outcome", "user.tool_result",
	// "system.message".
	Type            string    `json:"type"`
	ProcessedAt     time.Time `json:"processed_at"`
	SessionThreadID string    `json:"session_thread_id"`
	// This field is from variant [BetaManagedAgentsUserToolConfirmationEvent].
	Result    BetaManagedAgentsUserToolConfirmationEventResult `json:"result"`
	ToolUseID string                                           `json:"tool_use_id"`
	// This field is from variant [BetaManagedAgentsUserToolConfirmationEvent].
	DenyMessage string `json:"deny_message"`
	// This field is from variant [BetaManagedAgentsUserCustomToolResultEvent].
	CustomToolUseID string `json:"custom_tool_use_id"`
	IsError         bool   `json:"is_error"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	MaxIterations int64 `json:"max_iterations"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	OutcomeID string `json:"outcome_id"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion `json:"rubric"`
	JSON   struct {
		ID              respjson.Field
		Content         respjson.Field
		Type            respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		Result          respjson.Field
		ToolUseID       respjson.Field
		DenyMessage     respjson.Field
		CustomToolUseID respjson.Field
		IsError         respjson.Field
		Description     respjson.Field
		MaxIterations   respjson.Field
		OutcomeID       respjson.Field
		Rubric          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSendSessionEventsDataUnion contains all possible properties and values from BetaManagedAgentsUserMessageEvent, BetaManagedAgentsUserInterruptEvent, BetaManagedAgentsUserToolConfirmationEvent, BetaManagedAgentsUserCustomToolResultEvent, BetaManagedAgentsUserDefineOutcomeEvent, BetaManagedAgentsUserToolResultEvent, BetaManagedAgentsSystemMessageEvent.

Use the BetaManagedAgentsSendSessionEventsDataUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSendSessionEventsDataUnion) AsAny

func (u BetaManagedAgentsSendSessionEventsDataUnion) AsAny() anyBetaManagedAgentsSendSessionEventsData

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSendSessionEventsDataUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsUserMessageEvent:
case Juglow.BetaManagedAgentsUserInterruptEvent:
case Juglow.BetaManagedAgentsUserToolConfirmationEvent:
case Juglow.BetaManagedAgentsUserCustomToolResultEvent:
case Juglow.BetaManagedAgentsUserDefineOutcomeEvent:
case Juglow.BetaManagedAgentsUserToolResultEvent:
case Juglow.BetaManagedAgentsSystemMessageEvent:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSendSessionEventsDataUnion) AsSystemMessage

func (BetaManagedAgentsSendSessionEventsDataUnion) AsUserCustomToolResult

func (BetaManagedAgentsSendSessionEventsDataUnion) AsUserDefineOutcome

func (BetaManagedAgentsSendSessionEventsDataUnion) AsUserInterrupt

func (BetaManagedAgentsSendSessionEventsDataUnion) AsUserMessage

func (BetaManagedAgentsSendSessionEventsDataUnion) AsUserToolConfirmation

func (BetaManagedAgentsSendSessionEventsDataUnion) AsUserToolResult

func (BetaManagedAgentsSendSessionEventsDataUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSendSessionEventsDataUnion) UnmarshalJSON

func (r *BetaManagedAgentsSendSessionEventsDataUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSendSessionEventsDataUnionContent

type BetaManagedAgentsSendSessionEventsDataUnionContent struct {
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserMessageEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserMessageEventContentArray []BetaManagedAgentsUserMessageEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserCustomToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserCustomToolResultEventContentArray []BetaManagedAgentsUserCustomToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserToolResultEventContentArray []BetaManagedAgentsUserToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsSystemContentBlock] instead of an object.
	OfBetaManagedAgentsSystemContentBlockArray []BetaManagedAgentsSystemContentBlock `json:",inline"`
	JSON                                       struct {
		OfBetaManagedAgentsUserMessageEventContentArray          respjson.Field
		OfBetaManagedAgentsUserCustomToolResultEventContentArray respjson.Field
		OfBetaManagedAgentsUserToolResultEventContentArray       respjson.Field
		OfBetaManagedAgentsSystemContentBlockArray               respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSendSessionEventsDataUnionContent is an implicit subunion of BetaManagedAgentsSendSessionEventsDataUnion. BetaManagedAgentsSendSessionEventsDataUnionContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSendSessionEventsDataUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaManagedAgentsUserMessageEventContentArray OfBetaManagedAgentsUserCustomToolResultEventContentArray OfBetaManagedAgentsUserToolResultEventContentArray OfBetaManagedAgentsSystemContentBlockArray]

func (*BetaManagedAgentsSendSessionEventsDataUnionContent) UnmarshalJSON

type BetaManagedAgentsServerToolUsage

type BetaManagedAgentsServerToolUsage struct {
	// Number of server-executed web fetch requests.
	WebFetchRequests int64 `json:"web_fetch_requests"`
	// Number of server-executed web search requests.
	WebSearchRequests int64 `json:"web_search_requests"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		WebFetchRequests  respjson.Field
		WebSearchRequests respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cumulative count of server-executed tool invocations, broken down by tool.

func (BetaManagedAgentsServerToolUsage) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsServerToolUsage) UnmarshalJSON

func (r *BetaManagedAgentsServerToolUsage) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSession

type BetaManagedAgentsSession struct {
	ID string `json:"id" api:"required"`
	// Resolved `agent` definition for a `session`. Snapshot of the `agent` at
	// `session` creation time.
	Agent BetaManagedAgentsSessionAgent `json:"agent" api:"required"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// A hard spend ceiling. The session stops issuing new model requests once the
	// tracked list cost reaches `max_list_cost`.
	Budget BetaManagedAgentsBudgetLimit `json:"budget" api:"required"`
	// A timestamp in RFC 3339 format
	CreatedAt     time.Time         `json:"created_at" api:"required" format:"date-time"`
	EnvironmentID string            `json:"environment_id" api:"required"`
	Metadata      map[string]string `json:"metadata" api:"required"`
	// Per-outcome evaluation state. One entry per define_outcome event sent to the
	// session.
	OutcomeEvaluations []BetaManagedAgentsOutcomeEvaluationResource `json:"outcome_evaluations" api:"required"`
	Resources          []BetaManagedAgentsSessionResourceUnion      `json:"resources" api:"required"`
	// Timing statistics for a session.
	Stats BetaManagedAgentsSessionStats `json:"stats" api:"required"`
	// SessionStatus enum
	//
	// Any of "rescheduling", "running", "idle", "terminated".
	Status BetaManagedAgentsSessionStatus `json:"status" api:"required"`
	Title  string                         `json:"title" api:"required"`
	// Any of "session".
	Type BetaManagedAgentsSessionType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Cumulative token usage for a session across all turns.
	Usage BetaManagedAgentsSessionUsage `json:"usage" api:"required"`
	// Vault IDs attached to the session at creation. Empty when no vaults were
	// supplied.
	VaultIDs []string `json:"vault_ids" api:"required"`
	// Deployment ID when the session was created from a deployment reference. Null
	// otherwise.
	DeploymentID string `json:"deployment_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		Agent              respjson.Field
		ArchivedAt         respjson.Field
		Budget             respjson.Field
		CreatedAt          respjson.Field
		EnvironmentID      respjson.Field
		Metadata           respjson.Field
		OutcomeEvaluations respjson.Field
		Resources          respjson.Field
		Stats              respjson.Field
		Status             respjson.Field
		Title              respjson.Field
		Type               respjson.Field
		UpdatedAt          respjson.Field
		Usage              respjson.Field
		VaultIDs           respjson.Field
		DeploymentID       respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Managed Agents `session`.

func (BetaManagedAgentsSession) RawJSON

func (r BetaManagedAgentsSession) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSession) UnmarshalJSON

func (r *BetaManagedAgentsSession) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionActor

type BetaManagedAgentsSessionActor struct {
	// ID of the session that performed the write (a `sesn_...` value). Look up the
	// session via [Retrieve a session](/en/api/sessions-retrieve) for further
	// provenance.
	SessionID string `json:"session_id" api:"required"`
	// Any of "session_actor".
	Type BetaManagedAgentsSessionActorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SessionID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Attribution for a write made by an agent during a session, through the mounted filesystem at `/mnt/memory/`.

func (BetaManagedAgentsSessionActor) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionActor) UnmarshalJSON

func (r *BetaManagedAgentsSessionActor) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionActorType

type BetaManagedAgentsSessionActorType string
const (
	BetaManagedAgentsSessionActorTypeSessionActor BetaManagedAgentsSessionActorType = "session_actor"
)

type BetaManagedAgentsSessionAgent

type BetaManagedAgentsSessionAgent struct {
	ID          string                                    `json:"id" api:"required"`
	Description string                                    `json:"description" api:"required"`
	MCPServers  []BetaManagedAgentsMCPServerURLDefinition `json:"mcp_servers" api:"required"`
	// Model identifier and configuration.
	Model BetaManagedAgentsModelConfig `json:"model" api:"required"`
	// Resolved coordinator topology with full agent definitions for each roster
	// member.
	Multiagent BetaManagedAgentsSessionMultiagentCoordinator `json:"multiagent" api:"required"`
	Name       string                                        `json:"name" api:"required"`
	Tracks     []BetaManagedAgentsSessionAgentTrackUnion     `json:"tracks" api:"required"`
	System     string                                        `json:"system" api:"required"`
	Tools      []BetaManagedAgentsSessionAgentToolUnion      `json:"tools" api:"required"`
	// Any of "agent".
	Type    BetaManagedAgentsSessionAgentType `json:"type" api:"required"`
	Version int64                             `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Description respjson.Field
		MCPServers  respjson.Field
		Model       respjson.Field
		Multiagent  respjson.Field
		Name        respjson.Field
		Tracks      respjson.Field
		System      respjson.Field
		Tools       respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolved `agent` definition for a `session`. Snapshot of the `agent` at `session` creation time.

func (BetaManagedAgentsSessionAgent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionAgent) UnmarshalJSON

func (r *BetaManagedAgentsSessionAgent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionAgentToolUnion

type BetaManagedAgentsSessionAgentToolUnion struct {
	// This field is a union of [[]BetaManagedAgentsAgentToolConfig],
	// [[]BetaManagedAgentsMCPToolConfig]
	Configs BetaManagedAgentsSessionAgentToolUnionConfigs `json:"configs"`
	// This field is a union of [BetaManagedAgentsAgentToolsetDefaultConfig],
	// [BetaManagedAgentsMCPToolsetDefaultConfig]
	DefaultConfig BetaManagedAgentsSessionAgentToolUnionDefaultConfig `json:"default_config"`
	// Any of "agent_toolset_20260401", "mcp_toolset", "custom".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsMCPToolset].
	MCPServerName string `json:"mcp_server_name"`
	// This field is from variant [BetaManagedAgentsCustomTool].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsCustomTool].
	InputSchema BetaManagedAgentsCustomToolInputSchema `json:"input_schema"`
	// This field is from variant [BetaManagedAgentsCustomTool].
	Name string `json:"name"`
	JSON struct {
		Configs       respjson.Field
		DefaultConfig respjson.Field
		Type          respjson.Field
		MCPServerName respjson.Field
		Description   respjson.Field
		InputSchema   respjson.Field
		Name          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionAgentToolUnion contains all possible properties and values from BetaManagedAgentsAgentToolset20260401, BetaManagedAgentsMCPToolset, BetaManagedAgentsCustomTool.

Use the BetaManagedAgentsSessionAgentToolUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionAgentToolUnion) AsAgentToolset20260401

func (BetaManagedAgentsSessionAgentToolUnion) AsAny

func (u BetaManagedAgentsSessionAgentToolUnion) AsAny() anyBetaManagedAgentsSessionAgentTool

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionAgentToolUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsAgentToolset20260401:
case Juglow.BetaManagedAgentsMCPToolset:
case Juglow.BetaManagedAgentsCustomTool:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionAgentToolUnion) AsCustom

func (BetaManagedAgentsSessionAgentToolUnion) AsMCPToolset

func (BetaManagedAgentsSessionAgentToolUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionAgentToolUnion) UnmarshalJSON

func (r *BetaManagedAgentsSessionAgentToolUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionAgentToolUnionConfigs

type BetaManagedAgentsSessionAgentToolUnionConfigs struct {
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentToolConfig] instead of an object.
	OfBetaManagedAgentsAgentToolConfigArray []BetaManagedAgentsAgentToolConfig `json:",inline"`
	// This field will be present if the value is a [[]BetaManagedAgentsMCPToolConfig]
	// instead of an object.
	OfBetaManagedAgentsMCPToolConfigArray []BetaManagedAgentsMCPToolConfig `json:",inline"`
	JSON                                  struct {
		OfBetaManagedAgentsAgentToolConfigArray respjson.Field
		OfBetaManagedAgentsMCPToolConfigArray   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionAgentToolUnionConfigs is an implicit subunion of BetaManagedAgentsSessionAgentToolUnion. BetaManagedAgentsSessionAgentToolUnionConfigs provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionAgentToolUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaManagedAgentsAgentToolConfigArray OfBetaManagedAgentsMCPToolConfigArray]

func (*BetaManagedAgentsSessionAgentToolUnionConfigs) UnmarshalJSON

func (r *BetaManagedAgentsSessionAgentToolUnionConfigs) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionAgentToolUnionDefaultConfig

type BetaManagedAgentsSessionAgentToolUnionDefaultConfig struct {
	Enabled bool `json:"enabled"`
	// This field is a union of
	// [BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion],
	// [BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion]
	PermissionPolicy BetaManagedAgentsSessionAgentToolUnionDefaultConfigPermissionPolicy `json:"permission_policy"`
	JSON             struct {
		Enabled          respjson.Field
		PermissionPolicy respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionAgentToolUnionDefaultConfig is an implicit subunion of BetaManagedAgentsSessionAgentToolUnion. BetaManagedAgentsSessionAgentToolUnionDefaultConfig provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionAgentToolUnion.

func (*BetaManagedAgentsSessionAgentToolUnionDefaultConfig) UnmarshalJSON

type BetaManagedAgentsSessionAgentToolUnionDefaultConfigPermissionPolicy

type BetaManagedAgentsSessionAgentToolUnionDefaultConfigPermissionPolicy struct {
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionAgentToolUnionDefaultConfigPermissionPolicy is an implicit subunion of BetaManagedAgentsSessionAgentToolUnion. BetaManagedAgentsSessionAgentToolUnionDefaultConfigPermissionPolicy provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionAgentToolUnion.

func (*BetaManagedAgentsSessionAgentToolUnionDefaultConfigPermissionPolicy) UnmarshalJSON

type BetaManagedAgentsSessionAgentTrackUnion added in v1.71.2

type BetaManagedAgentsSessionAgentTrackUnion struct {
	TrackID string `json:"track_id"`
	// Any of "Juglow", "custom".
	Type    string `json:"type"`
	Version string `json:"version"`
	JSON    struct {
		TrackID respjson.Field
		Type    respjson.Field
		Version respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionAgentTrackUnion contains all possible properties and values from BetaManagedAgentsJuglowTrack, BetaManagedAgentsCustomTrack.

Use the BetaManagedAgentsSessionAgentTrackUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionAgentTrackUnion) AsAny added in v1.71.2

func (u BetaManagedAgentsSessionAgentTrackUnion) AsAny() anyBetaManagedAgentsSessionAgentTrack

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionAgentTrackUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsJuglowTrack:
case Juglow.BetaManagedAgentsCustomTrack:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionAgentTrackUnion) AsCustom added in v1.71.2

func (BetaManagedAgentsSessionAgentTrackUnion) AsJuglow added in v1.71.2

func (BetaManagedAgentsSessionAgentTrackUnion) RawJSON added in v1.71.2

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionAgentTrackUnion) UnmarshalJSON added in v1.71.2

func (r *BetaManagedAgentsSessionAgentTrackUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionAgentType

type BetaManagedAgentsSessionAgentType string
const (
	BetaManagedAgentsSessionAgentTypeAgent BetaManagedAgentsSessionAgentType = "agent"
)

type BetaManagedAgentsSessionAgentUpdateParam

type BetaManagedAgentsSessionAgentUpdateParam struct {
	// Replacement MCP server list. Full replacement: the provided array becomes the
	// new value. Send an empty array to clear; omit to preserve.
	MCPServers []BetaManagedAgentsURLMCPServerParams `json:"mcp_servers,omitzero"`
	// Replacement tool list. Full replacement: the provided array becomes the new
	// value. Send an empty array to clear; omit to preserve.
	Tools []BetaManagedAgentsSessionAgentUpdateToolUnionParam `json:"tools,omitzero"`
	// contains filtered or unexported fields
}

Mid-session agent configuration update. Only `tools` and `mcp_servers` are updatable. Full replacement: the provided array becomes the new value. To preserve existing entries, GET the session, modify the array, and POST it back.

func (BetaManagedAgentsSessionAgentUpdateParam) MarshalJSON

func (r BetaManagedAgentsSessionAgentUpdateParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsSessionAgentUpdateParam) UnmarshalJSON

func (r *BetaManagedAgentsSessionAgentUpdateParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionAgentUpdateToolUnionParam

type BetaManagedAgentsSessionAgentUpdateToolUnionParam struct {
	OfAgentToolset20260401 *BetaManagedAgentsAgentToolset20260401Params `json:",omitzero,inline"`
	OfMCPToolset           *BetaManagedAgentsMCPToolsetParams           `json:",omitzero,inline"`
	OfCustom               *BetaManagedAgentsCustomToolParams           `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 (BetaManagedAgentsSessionAgentUpdateToolUnionParam) GetConfigs

func (u BetaManagedAgentsSessionAgentUpdateToolUnionParam) GetConfigs() (res betaManagedAgentsSessionAgentUpdateToolUnionParamConfigs)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaManagedAgentsSessionAgentUpdateToolUnionParam) GetDefaultConfig

func (u BetaManagedAgentsSessionAgentUpdateToolUnionParam) GetDefaultConfig() (res betaManagedAgentsSessionAgentUpdateToolUnionParamDefaultConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaManagedAgentsSessionAgentUpdateToolUnionParam) GetDescription

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsSessionAgentUpdateToolUnionParam) GetInputSchema

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsSessionAgentUpdateToolUnionParam) GetMCPServerName

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsSessionAgentUpdateToolUnionParam) GetName

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsSessionAgentUpdateToolUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsSessionAgentUpdateToolUnionParam) MarshalJSON

func (*BetaManagedAgentsSessionAgentUpdateToolUnionParam) UnmarshalJSON

type BetaManagedAgentsSessionBudgetReached

type BetaManagedAgentsSessionBudgetReached struct {
	// Any of "budget_reached".
	Type BetaManagedAgentsSessionBudgetReachedType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The agent stopped because the session's tracked list cost reached its budget, or because its usage includes a model with no list price (which the budget cannot measure). Raise the budget to continue — or, if raising is rejected because a model has no list price, remove the budget.

func (BetaManagedAgentsSessionBudgetReached) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionBudgetReached) UnmarshalJSON

func (r *BetaManagedAgentsSessionBudgetReached) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionBudgetReachedType

type BetaManagedAgentsSessionBudgetReachedType string
const (
	BetaManagedAgentsSessionBudgetReachedTypeBudgetReached BetaManagedAgentsSessionBudgetReachedType = "budget_reached"
)

type BetaManagedAgentsSessionCreationRejectedRunError

type BetaManagedAgentsSessionCreationRejectedRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "session_creation_rejected_error".
	Type BetaManagedAgentsSessionCreationRejectedRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The session create request was rejected with a non-retryable validation error.

func (BetaManagedAgentsSessionCreationRejectedRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionCreationRejectedRunError) UnmarshalJSON

type BetaManagedAgentsSessionCreationRejectedRunErrorType

type BetaManagedAgentsSessionCreationRejectedRunErrorType string
const (
	BetaManagedAgentsSessionCreationRejectedRunErrorTypeSessionCreationRejectedError BetaManagedAgentsSessionCreationRejectedRunErrorType = "session_creation_rejected_error"
)

type BetaManagedAgentsSessionDeletedEvent

type BetaManagedAgentsSessionDeletedEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "session.deleted".
	Type BetaManagedAgentsSessionDeletedEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Emitted when a session has been deleted. Terminates any active event stream — no further events will be emitted for this session.

func (BetaManagedAgentsSessionDeletedEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionDeletedEvent) UnmarshalJSON

func (r *BetaManagedAgentsSessionDeletedEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionDeletedEventType

type BetaManagedAgentsSessionDeletedEventType string
const (
	BetaManagedAgentsSessionDeletedEventTypeSessionDeleted BetaManagedAgentsSessionDeletedEventType = "session.deleted"
)

type BetaManagedAgentsSessionEndTurn

type BetaManagedAgentsSessionEndTurn struct {
	// Any of "end_turn".
	Type BetaManagedAgentsSessionEndTurnType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The agent completed its turn naturally and is ready for the next user message.

func (BetaManagedAgentsSessionEndTurn) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionEndTurn) UnmarshalJSON

func (r *BetaManagedAgentsSessionEndTurn) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionEndTurnType

type BetaManagedAgentsSessionEndTurnType string
const (
	BetaManagedAgentsSessionEndTurnTypeEndTurn BetaManagedAgentsSessionEndTurnType = "end_turn"
)

type BetaManagedAgentsSessionErrorEvent

type BetaManagedAgentsSessionErrorEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// An unknown or unexpected error occurred during session execution. A fallback
	// variant; clients that don't recognize a new error code can match on
	// `retry_status` and `message` alone.
	Error BetaManagedAgentsSessionErrorEventErrorUnion `json:"error" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "session.error".
	Type BetaManagedAgentsSessionErrorEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Error       respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An error event indicating a problem occurred during session execution.

func (BetaManagedAgentsSessionErrorEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionErrorEvent) UnmarshalJSON

func (r *BetaManagedAgentsSessionErrorEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionErrorEventErrorUnion

type BetaManagedAgentsSessionErrorEventErrorUnion struct {
	Message string `json:"message"`
	// This field is a union of [BetaManagedAgentsUnknownErrorRetryStatusUnion],
	// [BetaManagedAgentsModelOverloadedErrorRetryStatusUnion],
	// [BetaManagedAgentsModelRateLimitedErrorRetryStatusUnion],
	// [BetaManagedAgentsModelRequestFailedErrorRetryStatusUnion],
	// [BetaManagedAgentsMCPConnectionFailedErrorRetryStatusUnion],
	// [BetaManagedAgentsMCPAuthenticationFailedErrorRetryStatusUnion],
	// [BetaManagedAgentsBillingErrorRetryStatusUnion],
	// [BetaManagedAgentsCredentialHostUnreachableErrorRetryStatusUnion]
	RetryStatus BetaManagedAgentsSessionErrorEventErrorUnionRetryStatus `json:"retry_status"`
	// Any of "unknown_error", "model_overloaded_error", "model_rate_limited_error",
	// "model_request_failed_error", "mcp_connection_failed_error",
	// "mcp_authentication_failed_error", "billing_error",
	// "credential_host_unreachable_error".
	Type          string `json:"type"`
	MCPServerName string `json:"mcp_server_name"`
	// This field is from variant [BetaManagedAgentsCredentialHostUnreachableError].
	CredentialID string `json:"credential_id"`
	// This field is from variant [BetaManagedAgentsCredentialHostUnreachableError].
	VaultID string `json:"vault_id"`
	JSON    struct {
		Message       respjson.Field
		RetryStatus   respjson.Field
		Type          respjson.Field
		MCPServerName respjson.Field
		CredentialID  respjson.Field
		VaultID       respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionErrorEventErrorUnion contains all possible properties and values from BetaManagedAgentsUnknownError, BetaManagedAgentsModelOverloadedError, BetaManagedAgentsModelRateLimitedError, BetaManagedAgentsModelRequestFailedError, BetaManagedAgentsMCPConnectionFailedError, BetaManagedAgentsMCPAuthenticationFailedError, BetaManagedAgentsBillingError, BetaManagedAgentsCredentialHostUnreachableError.

Use the BetaManagedAgentsSessionErrorEventErrorUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionErrorEventErrorUnion) AsAny

func (u BetaManagedAgentsSessionErrorEventErrorUnion) AsAny() anyBetaManagedAgentsSessionErrorEventError

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionErrorEventErrorUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsUnknownError:
case Juglow.BetaManagedAgentsModelOverloadedError:
case Juglow.BetaManagedAgentsModelRateLimitedError:
case Juglow.BetaManagedAgentsModelRequestFailedError:
case Juglow.BetaManagedAgentsMCPConnectionFailedError:
case Juglow.BetaManagedAgentsMCPAuthenticationFailedError:
case Juglow.BetaManagedAgentsBillingError:
case Juglow.BetaManagedAgentsCredentialHostUnreachableError:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionErrorEventErrorUnion) AsBillingError

func (BetaManagedAgentsSessionErrorEventErrorUnion) AsCredentialHostUnreachableError

func (BetaManagedAgentsSessionErrorEventErrorUnion) AsMCPAuthenticationFailedError

func (BetaManagedAgentsSessionErrorEventErrorUnion) AsMCPConnectionFailedError

func (BetaManagedAgentsSessionErrorEventErrorUnion) AsModelOverloadedError

func (BetaManagedAgentsSessionErrorEventErrorUnion) AsModelRateLimitedError

func (BetaManagedAgentsSessionErrorEventErrorUnion) AsModelRequestFailedError

func (BetaManagedAgentsSessionErrorEventErrorUnion) AsUnknownError

func (BetaManagedAgentsSessionErrorEventErrorUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionErrorEventErrorUnion) UnmarshalJSON

func (r *BetaManagedAgentsSessionErrorEventErrorUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionErrorEventErrorUnionRetryStatus

type BetaManagedAgentsSessionErrorEventErrorUnionRetryStatus struct {
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionErrorEventErrorUnionRetryStatus is an implicit subunion of BetaManagedAgentsSessionErrorEventErrorUnion. BetaManagedAgentsSessionErrorEventErrorUnionRetryStatus provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionErrorEventErrorUnion.

func (*BetaManagedAgentsSessionErrorEventErrorUnionRetryStatus) UnmarshalJSON

type BetaManagedAgentsSessionErrorEventType

type BetaManagedAgentsSessionErrorEventType string
const (
	BetaManagedAgentsSessionErrorEventTypeSessionError BetaManagedAgentsSessionErrorEventType = "session.error"
)

type BetaManagedAgentsSessionEventUnion

type BetaManagedAgentsSessionEventUnion struct {
	ID string `json:"id"`
	// This field is a union of [[]BetaManagedAgentsUserMessageEventContentUnion],
	// [[]BetaManagedAgentsUserCustomToolResultEventContentUnion],
	// [[]BetaManagedAgentsAgentMessageEventContentUnion],
	// [[]BetaManagedAgentsAgentMCPToolResultEventContentUnion],
	// [[]BetaManagedAgentsAgentToolResultEventContentUnion],
	// [[]BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion],
	// [[]BetaManagedAgentsAgentThreadMessageSentEventContentUnion],
	// [[]BetaManagedAgentsUserToolResultEventContentUnion],
	// [[]BetaManagedAgentsSystemContentBlock]
	Content BetaManagedAgentsSessionEventUnionContent `json:"content"`
	// Any of "user.message", "user.interrupt", "user.tool_confirmation",
	// "user.custom_tool_result", "agent.custom_tool_use", "agent.message",
	// "agent.thinking", "agent.mcp_tool_use", "agent.mcp_tool_result",
	// "agent.tool_use", "agent.tool_result", "agent.thread_message_received",
	// "agent.thread_message_sent", "agent.thread_context_compacted", "session.error",
	// "session.status_rescheduled", "session.status_running", "session.status_idle",
	// "session.status_terminated", "session.thread_created",
	// "span.outcome_evaluation_start", "span.outcome_evaluation_end",
	// "span.model_request_start", "span.model_request_end",
	// "span.outcome_evaluation_ongoing", "user.define_outcome", "session.deleted",
	// "session.thread_status_running", "session.thread_status_idle",
	// "session.thread_status_terminated", "user.tool_result",
	// "session.thread_status_rescheduled", "session.updated", "system.message",
	// "session.usage".
	Type            string    `json:"type"`
	ProcessedAt     time.Time `json:"processed_at"`
	SessionThreadID string    `json:"session_thread_id"`
	Result          string    `json:"result"`
	ToolUseID       string    `json:"tool_use_id"`
	// This field is from variant [BetaManagedAgentsUserToolConfirmationEvent].
	DenyMessage string `json:"deny_message"`
	// This field is from variant [BetaManagedAgentsUserCustomToolResultEvent].
	CustomToolUseID string `json:"custom_tool_use_id"`
	IsError         bool   `json:"is_error"`
	Input           any    `json:"input"`
	Name            string `json:"name"`
	// This field is from variant [BetaManagedAgentsAgentMCPToolUseEvent].
	MCPServerName       string `json:"mcp_server_name"`
	EvaluatedPermission string `json:"evaluated_permission"`
	// This field is from variant [BetaManagedAgentsAgentMCPToolResultEvent].
	MCPToolUseID string `json:"mcp_tool_use_id"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageReceivedEvent].
	FromSessionThreadID string `json:"from_session_thread_id"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageReceivedEvent].
	FromAgentName string `json:"from_agent_name"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageSentEvent].
	ToSessionThreadID string `json:"to_session_thread_id"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageSentEvent].
	ToAgentName string `json:"to_agent_name"`
	// This field is from variant [BetaManagedAgentsSessionErrorEvent].
	Error BetaManagedAgentsSessionErrorEventErrorUnion `json:"error"`
	// This field is a union of
	// [BetaManagedAgentsSessionStatusIdleEventStopReasonUnion],
	// [BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion]
	StopReason BetaManagedAgentsSessionEventUnionStopReason `json:"stop_reason"`
	AgentName  string                                       `json:"agent_name"`
	Iteration  int64                                        `json:"iteration"`
	OutcomeID  string                                       `json:"outcome_id"`
	// This field is from variant [BetaManagedAgentsSpanOutcomeEvaluationEndEvent].
	Explanation string `json:"explanation"`
	// This field is from variant [BetaManagedAgentsSpanOutcomeEvaluationEndEvent].
	OutcomeEvaluationStartID string `json:"outcome_evaluation_start_id"`
	// This field is a union of [BetaManagedAgentsSpanModelUsage],
	// [BetaManagedAgentsSessionUsageSnapshot]
	Usage BetaManagedAgentsSessionEventUnionUsage `json:"usage"`
	// This field is from variant [BetaManagedAgentsSpanModelRequestEndEvent].
	ModelRequestStartID string `json:"model_request_start_id"`
	// This field is from variant [BetaManagedAgentsSpanModelRequestEndEvent].
	ModelUsage BetaManagedAgentsSpanModelUsage `json:"model_usage"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	MaxIterations int64 `json:"max_iterations"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion `json:"rubric"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Agent BetaManagedAgentsSessionAgent `json:"agent"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Budget BetaManagedAgentsBudgetLimit `json:"budget"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Metadata map[string]string `json:"metadata"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Title string `json:"title"`
	JSON  struct {
		ID                       respjson.Field
		Content                  respjson.Field
		Type                     respjson.Field
		ProcessedAt              respjson.Field
		SessionThreadID          respjson.Field
		Result                   respjson.Field
		ToolUseID                respjson.Field
		DenyMessage              respjson.Field
		CustomToolUseID          respjson.Field
		IsError                  respjson.Field
		Input                    respjson.Field
		Name                     respjson.Field
		MCPServerName            respjson.Field
		EvaluatedPermission      respjson.Field
		MCPToolUseID             respjson.Field
		FromSessionThreadID      respjson.Field
		FromAgentName            respjson.Field
		ToSessionThreadID        respjson.Field
		ToAgentName              respjson.Field
		Error                    respjson.Field
		StopReason               respjson.Field
		AgentName                respjson.Field
		Iteration                respjson.Field
		OutcomeID                respjson.Field
		Explanation              respjson.Field
		OutcomeEvaluationStartID respjson.Field
		Usage                    respjson.Field
		ModelRequestStartID      respjson.Field
		ModelUsage               respjson.Field
		Description              respjson.Field
		MaxIterations            respjson.Field
		Rubric                   respjson.Field
		Agent                    respjson.Field
		Budget                   respjson.Field
		Metadata                 respjson.Field
		Title                    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionEventUnion contains all possible properties and values from BetaManagedAgentsUserMessageEvent, BetaManagedAgentsUserInterruptEvent, BetaManagedAgentsUserToolConfirmationEvent, BetaManagedAgentsUserCustomToolResultEvent, BetaManagedAgentsAgentCustomToolUseEvent, BetaManagedAgentsAgentMessageEvent, BetaManagedAgentsAgentThinkingEvent, BetaManagedAgentsAgentMCPToolUseEvent, BetaManagedAgentsAgentMCPToolResultEvent, BetaManagedAgentsAgentToolUseEvent, BetaManagedAgentsAgentToolResultEvent, BetaManagedAgentsAgentThreadMessageReceivedEvent, BetaManagedAgentsAgentThreadMessageSentEvent, BetaManagedAgentsAgentThreadContextCompactedEvent, BetaManagedAgentsSessionErrorEvent, BetaManagedAgentsSessionStatusRescheduledEvent, BetaManagedAgentsSessionStatusRunningEvent, BetaManagedAgentsSessionStatusIdleEvent, BetaManagedAgentsSessionStatusTerminatedEvent, BetaManagedAgentsSessionThreadCreatedEvent, BetaManagedAgentsSpanOutcomeEvaluationStartEvent, BetaManagedAgentsSpanOutcomeEvaluationEndEvent, BetaManagedAgentsSpanModelRequestStartEvent, BetaManagedAgentsSpanModelRequestEndEvent, BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent, BetaManagedAgentsUserDefineOutcomeEvent, BetaManagedAgentsSessionDeletedEvent, BetaManagedAgentsSessionThreadStatusRunningEvent, BetaManagedAgentsSessionThreadStatusIdleEvent, BetaManagedAgentsSessionThreadStatusTerminatedEvent, BetaManagedAgentsUserToolResultEvent, BetaManagedAgentsSessionThreadStatusRescheduledEvent, BetaManagedAgentsSessionUpdatedEvent, BetaManagedAgentsSystemMessageEvent, BetaManagedAgentsSessionUsageEvent.

Use the BetaManagedAgentsSessionEventUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionEventUnion) AsAgentCustomToolUse

func (BetaManagedAgentsSessionEventUnion) AsAgentMCPToolResult

func (BetaManagedAgentsSessionEventUnion) AsAgentMCPToolUse

func (BetaManagedAgentsSessionEventUnion) AsAgentMessage

func (BetaManagedAgentsSessionEventUnion) AsAgentThinking

func (BetaManagedAgentsSessionEventUnion) AsAgentThreadContextCompacted

func (BetaManagedAgentsSessionEventUnion) AsAgentThreadMessageReceived

func (BetaManagedAgentsSessionEventUnion) AsAgentThreadMessageSent

func (BetaManagedAgentsSessionEventUnion) AsAgentToolResult

func (BetaManagedAgentsSessionEventUnion) AsAgentToolUse

func (BetaManagedAgentsSessionEventUnion) AsAny

func (u BetaManagedAgentsSessionEventUnion) AsAny() anyBetaManagedAgentsSessionEvent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionEventUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsUserMessageEvent:
case Juglow.BetaManagedAgentsUserInterruptEvent:
case Juglow.BetaManagedAgentsUserToolConfirmationEvent:
case Juglow.BetaManagedAgentsUserCustomToolResultEvent:
case Juglow.BetaManagedAgentsAgentCustomToolUseEvent:
case Juglow.BetaManagedAgentsAgentMessageEvent:
case Juglow.BetaManagedAgentsAgentThinkingEvent:
case Juglow.BetaManagedAgentsAgentMCPToolUseEvent:
case Juglow.BetaManagedAgentsAgentMCPToolResultEvent:
case Juglow.BetaManagedAgentsAgentToolUseEvent:
case Juglow.BetaManagedAgentsAgentToolResultEvent:
case Juglow.BetaManagedAgentsAgentThreadMessageReceivedEvent:
case Juglow.BetaManagedAgentsAgentThreadMessageSentEvent:
case Juglow.BetaManagedAgentsAgentThreadContextCompactedEvent:
case Juglow.BetaManagedAgentsSessionErrorEvent:
case Juglow.BetaManagedAgentsSessionStatusRescheduledEvent:
case Juglow.BetaManagedAgentsSessionStatusRunningEvent:
case Juglow.BetaManagedAgentsSessionStatusIdleEvent:
case Juglow.BetaManagedAgentsSessionStatusTerminatedEvent:
case Juglow.BetaManagedAgentsSessionThreadCreatedEvent:
case Juglow.BetaManagedAgentsSpanOutcomeEvaluationStartEvent:
case Juglow.BetaManagedAgentsSpanOutcomeEvaluationEndEvent:
case Juglow.BetaManagedAgentsSpanModelRequestStartEvent:
case Juglow.BetaManagedAgentsSpanModelRequestEndEvent:
case Juglow.BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent:
case Juglow.BetaManagedAgentsUserDefineOutcomeEvent:
case Juglow.BetaManagedAgentsSessionDeletedEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusRunningEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusIdleEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusTerminatedEvent:
case Juglow.BetaManagedAgentsUserToolResultEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusRescheduledEvent:
case Juglow.BetaManagedAgentsSessionUpdatedEvent:
case Juglow.BetaManagedAgentsSystemMessageEvent:
case Juglow.BetaManagedAgentsSessionUsageEvent:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionEventUnion) AsSessionDeleted

func (BetaManagedAgentsSessionEventUnion) AsSessionError

func (BetaManagedAgentsSessionEventUnion) AsSessionStatusIdle

func (BetaManagedAgentsSessionEventUnion) AsSessionStatusRescheduled

func (BetaManagedAgentsSessionEventUnion) AsSessionStatusRunning

func (BetaManagedAgentsSessionEventUnion) AsSessionStatusTerminated

func (BetaManagedAgentsSessionEventUnion) AsSessionThreadCreated

func (BetaManagedAgentsSessionEventUnion) AsSessionThreadStatusIdle

func (BetaManagedAgentsSessionEventUnion) AsSessionThreadStatusRescheduled

func (BetaManagedAgentsSessionEventUnion) AsSessionThreadStatusRunning

func (BetaManagedAgentsSessionEventUnion) AsSessionThreadStatusTerminated

func (BetaManagedAgentsSessionEventUnion) AsSessionUpdated

func (BetaManagedAgentsSessionEventUnion) AsSessionUsage

func (BetaManagedAgentsSessionEventUnion) AsSpanModelRequestEnd

func (BetaManagedAgentsSessionEventUnion) AsSpanModelRequestStart

func (BetaManagedAgentsSessionEventUnion) AsSpanOutcomeEvaluationEnd

func (BetaManagedAgentsSessionEventUnion) AsSpanOutcomeEvaluationOngoing

func (BetaManagedAgentsSessionEventUnion) AsSpanOutcomeEvaluationStart

func (BetaManagedAgentsSessionEventUnion) AsSystemMessage

func (BetaManagedAgentsSessionEventUnion) AsUserCustomToolResult

func (BetaManagedAgentsSessionEventUnion) AsUserDefineOutcome

func (BetaManagedAgentsSessionEventUnion) AsUserInterrupt

func (BetaManagedAgentsSessionEventUnion) AsUserMessage

func (BetaManagedAgentsSessionEventUnion) AsUserToolConfirmation

func (BetaManagedAgentsSessionEventUnion) AsUserToolResult

func (BetaManagedAgentsSessionEventUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionEventUnion) UnmarshalJSON

func (r *BetaManagedAgentsSessionEventUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionEventUnionContent

type BetaManagedAgentsSessionEventUnionContent struct {
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserMessageEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserMessageEventContentArray []BetaManagedAgentsUserMessageEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserCustomToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserCustomToolResultEventContentArray []BetaManagedAgentsUserCustomToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentMessageEventContentUnion] instead of an object.
	OfBetaManagedAgentsAgentMessageEventContentArray []BetaManagedAgentsAgentMessageEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentMCPToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsAgentMCPToolResultEventContentArray []BetaManagedAgentsAgentMCPToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsAgentToolResultEventContentArray []BetaManagedAgentsAgentToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion] instead of an
	// object.
	OfBetaManagedAgentsAgentThreadMessageReceivedEventContentArray []BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentThreadMessageSentEventContentUnion] instead of an
	// object.
	OfBetaManagedAgentsAgentThreadMessageSentEventContentArray []BetaManagedAgentsAgentThreadMessageSentEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserToolResultEventContentArray []BetaManagedAgentsUserToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsSystemContentBlock] instead of an object.
	OfBetaManagedAgentsSystemContentBlockArray []BetaManagedAgentsSystemContentBlock `json:",inline"`
	JSON                                       struct {
		OfBetaManagedAgentsUserMessageEventContentArray                respjson.Field
		OfBetaManagedAgentsUserCustomToolResultEventContentArray       respjson.Field
		OfBetaManagedAgentsAgentMessageEventContentArray               respjson.Field
		OfBetaManagedAgentsAgentMCPToolResultEventContentArray         respjson.Field
		OfBetaManagedAgentsAgentToolResultEventContentArray            respjson.Field
		OfBetaManagedAgentsAgentThreadMessageReceivedEventContentArray respjson.Field
		OfBetaManagedAgentsAgentThreadMessageSentEventContentArray     respjson.Field
		OfBetaManagedAgentsUserToolResultEventContentArray             respjson.Field
		OfBetaManagedAgentsSystemContentBlockArray                     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionEventUnionContent is an implicit subunion of BetaManagedAgentsSessionEventUnion. BetaManagedAgentsSessionEventUnionContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionEventUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaManagedAgentsUserMessageEventContentArray OfBetaManagedAgentsUserCustomToolResultEventContentArray OfBetaManagedAgentsAgentMessageEventContentArray OfBetaManagedAgentsAgentMCPToolResultEventContentArray OfBetaManagedAgentsAgentToolResultEventContentArray OfBetaManagedAgentsAgentThreadMessageReceivedEventContentArray OfBetaManagedAgentsAgentThreadMessageSentEventContentArray OfBetaManagedAgentsUserToolResultEventContentArray OfBetaManagedAgentsSystemContentBlockArray]

func (*BetaManagedAgentsSessionEventUnionContent) UnmarshalJSON

func (r *BetaManagedAgentsSessionEventUnionContent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionEventUnionStopReason

type BetaManagedAgentsSessionEventUnionStopReason struct {
	Type string `json:"type"`
	// This field is from variant
	// [BetaManagedAgentsSessionStatusIdleEventStopReasonUnion],
	// [BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion].
	EventIDs []string `json:"event_ids"`
	JSON     struct {
		Type     respjson.Field
		EventIDs respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionEventUnionStopReason is an implicit subunion of BetaManagedAgentsSessionEventUnion. BetaManagedAgentsSessionEventUnionStopReason provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionEventUnion.

func (*BetaManagedAgentsSessionEventUnionStopReason) UnmarshalJSON

func (r *BetaManagedAgentsSessionEventUnionStopReason) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionEventUnionUsage

type BetaManagedAgentsSessionEventUnionUsage struct {
	// This field is from variant [BetaManagedAgentsSpanModelUsage].
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens"`
	CacheReadInputTokens     int64 `json:"cache_read_input_tokens"`
	InputTokens              int64 `json:"input_tokens"`
	OutputTokens             int64 `json:"output_tokens"`
	// This field is from variant [BetaManagedAgentsSpanModelUsage].
	Speed BetaManagedAgentsSpanModelUsageSpeed `json:"speed"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	ActiveSeconds float64 `json:"active_seconds"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	CacheCreation BetaManagedAgentsCacheCreationUsage `json:"cache_creation"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	ListCost BetaMonetaryAmount `json:"list_cost"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	ServerToolUse BetaManagedAgentsServerToolUsage `json:"server_tool_use"`
	JSON          struct {
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		OutputTokens             respjson.Field
		Speed                    respjson.Field
		ActiveSeconds            respjson.Field
		CacheCreation            respjson.Field
		ListCost                 respjson.Field
		ServerToolUse            respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionEventUnionUsage is an implicit subunion of BetaManagedAgentsSessionEventUnion. BetaManagedAgentsSessionEventUnionUsage provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionEventUnion.

func (*BetaManagedAgentsSessionEventUnionUsage) UnmarshalJSON

func (r *BetaManagedAgentsSessionEventUnionUsage) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionMultiagentCoordinator

type BetaManagedAgentsSessionMultiagentCoordinator struct {
	// Full `agent` definitions the coordinator may spawn as session threads.
	Agents []BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion `json:"agents" api:"required"`
	// Any of "coordinator".
	Type BetaManagedAgentsSessionMultiagentCoordinatorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Agents      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolved coordinator topology with full agent definitions for each roster member.

func (BetaManagedAgentsSessionMultiagentCoordinator) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionMultiagentCoordinator) UnmarshalJSON

func (r *BetaManagedAgentsSessionMultiagentCoordinator) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion

type BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion struct {
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	ID string `json:"id"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	MCPServers []BetaManagedAgentsMCPServerURLDefinition `json:"mcp_servers"`
	// This field is a union of [BetaManagedAgentsModelConfig], [string]
	Model BetaManagedAgentsSessionMultiagentCoordinatorAgentUnionModel `json:"model"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Name string `json:"name"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Tracks []BetaManagedAgentsSessionThreadAgentTrackUnion `json:"tracks"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	System string `json:"system"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Tools []BetaManagedAgentsSessionThreadAgentToolUnion `json:"tools"`
	// Any of "agent", "advisor".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Version int64 `json:"version"`
	JSON    struct {
		ID          respjson.Field
		Description respjson.Field
		MCPServers  respjson.Field
		Model       respjson.Field
		Name        respjson.Field
		Tracks      respjson.Field
		System      respjson.Field
		Tools       respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion contains all possible properties and values from BetaManagedAgentsSessionThreadAgent, BetaManagedAgentsAdvisor.

Use the BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion) AsAdvisor

func (BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion) AsAgent

func (BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion) AsAny

func (u BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion) AsAny() anyBetaManagedAgentsSessionMultiagentCoordinatorAgent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsSessionThreadAgent:
case Juglow.BetaManagedAgentsAdvisor:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion) UnmarshalJSON

type BetaManagedAgentsSessionMultiagentCoordinatorAgentUnionModel

type BetaManagedAgentsSessionMultiagentCoordinatorAgentUnionModel struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field is from variant [BetaManagedAgentsModelConfig].
	ID BetaManagedAgentsModel `json:"id"`
	// This field is from variant [BetaManagedAgentsModelConfig].
	Effort BetaManagedAgentsModelConfigEffortUnion `json:"effort"`
	// This field is from variant [BetaManagedAgentsModelConfig].
	InferenceGeo string `json:"inference_geo"`
	// This field is from variant [BetaManagedAgentsModelConfig].
	Speed BetaManagedAgentsModelConfigSpeed `json:"speed"`
	JSON  struct {
		OfString     respjson.Field
		ID           respjson.Field
		Effort       respjson.Field
		InferenceGeo respjson.Field
		Speed        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionMultiagentCoordinatorAgentUnionModel is an implicit subunion of BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion. BetaManagedAgentsSessionMultiagentCoordinatorAgentUnionModel provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionMultiagentCoordinatorAgentUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString]

func (*BetaManagedAgentsSessionMultiagentCoordinatorAgentUnionModel) UnmarshalJSON

type BetaManagedAgentsSessionMultiagentCoordinatorType

type BetaManagedAgentsSessionMultiagentCoordinatorType string
const (
	BetaManagedAgentsSessionMultiagentCoordinatorTypeCoordinator BetaManagedAgentsSessionMultiagentCoordinatorType = "coordinator"
)

type BetaManagedAgentsSessionRateLimitedRunError

type BetaManagedAgentsSessionRateLimitedRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "session_rate_limited_error".
	Type BetaManagedAgentsSessionRateLimitedRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Session creation was rejected due to rate limiting. The schedule keeps firing; subsequent runs may succeed.

func (BetaManagedAgentsSessionRateLimitedRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionRateLimitedRunError) UnmarshalJSON

func (r *BetaManagedAgentsSessionRateLimitedRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionRateLimitedRunErrorType

type BetaManagedAgentsSessionRateLimitedRunErrorType string
const (
	BetaManagedAgentsSessionRateLimitedRunErrorTypeSessionRateLimitedError BetaManagedAgentsSessionRateLimitedRunErrorType = "session_rate_limited_error"
)

type BetaManagedAgentsSessionRequiresAction

type BetaManagedAgentsSessionRequiresAction struct {
	// The ids of events the agent is blocked on. Resolving fewer than all re-emits
	// `session.status_idle` with the remainder.
	EventIDs []string `json:"event_ids" api:"required"`
	// Any of "requires_action".
	Type BetaManagedAgentsSessionRequiresActionType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EventIDs    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The agent is idle waiting on one or more blocking user-input events (tool confirmation, custom tool result, etc.). Resolving all of them transitions the session back to running.

func (BetaManagedAgentsSessionRequiresAction) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionRequiresAction) UnmarshalJSON

func (r *BetaManagedAgentsSessionRequiresAction) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionRequiresActionType

type BetaManagedAgentsSessionRequiresActionType string
const (
	BetaManagedAgentsSessionRequiresActionTypeRequiresAction BetaManagedAgentsSessionRequiresActionType = "requires_action"
)

type BetaManagedAgentsSessionResourceConfigUnion

type BetaManagedAgentsSessionResourceConfigUnion struct {
	// Any of "github_repository", "file", "memory_store".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsGitHubRepositoryResourceConfig].
	URL string `json:"url"`
	// This field is from variant [BetaManagedAgentsGitHubRepositoryResourceConfig].
	Checkout  BetaManagedAgentsGitHubRepositoryResourceConfigCheckoutUnion `json:"checkout"`
	MountPath string                                                       `json:"mount_path"`
	// This field is from variant [BetaManagedAgentsFileResourceConfig].
	FileID string `json:"file_id"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResourceConfig].
	MemoryStoreID string `json:"memory_store_id"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResourceConfig].
	Access BetaManagedAgentsMemoryStoreResourceConfigAccess `json:"access"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResourceConfig].
	Instructions string `json:"instructions"`
	JSON         struct {
		Type          respjson.Field
		URL           respjson.Field
		Checkout      respjson.Field
		MountPath     respjson.Field
		FileID        respjson.Field
		MemoryStoreID respjson.Field
		Access        respjson.Field
		Instructions  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionResourceConfigUnion contains all possible properties and values from BetaManagedAgentsGitHubRepositoryResourceConfig, BetaManagedAgentsFileResourceConfig, BetaManagedAgentsMemoryStoreResourceConfig.

Use the BetaManagedAgentsSessionResourceConfigUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionResourceConfigUnion) AsAny

func (u BetaManagedAgentsSessionResourceConfigUnion) AsAny() anyBetaManagedAgentsSessionResourceConfig

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionResourceConfigUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsGitHubRepositoryResourceConfig:
case Juglow.BetaManagedAgentsFileResourceConfig:
case Juglow.BetaManagedAgentsMemoryStoreResourceConfig:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionResourceConfigUnion) AsFile

func (BetaManagedAgentsSessionResourceConfigUnion) AsGitHubRepository

func (BetaManagedAgentsSessionResourceConfigUnion) AsMemoryStore

func (BetaManagedAgentsSessionResourceConfigUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionResourceConfigUnion) UnmarshalJSON

func (r *BetaManagedAgentsSessionResourceConfigUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError

type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError struct {
	// Any of "session_resource_not_found_error".
	Type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A referenced resource no longer exists and its kind was not reported.

func (BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType

type BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorTypeSessionResourceNotFoundError BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonErrorType = "session_resource_not_found_error"
)

type BetaManagedAgentsSessionResourceNotFoundRunError

type BetaManagedAgentsSessionResourceNotFoundRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "session_resource_not_found_error".
	Type BetaManagedAgentsSessionResourceNotFoundRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A referenced resource no longer exists and its kind was not reported.

func (BetaManagedAgentsSessionResourceNotFoundRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionResourceNotFoundRunError) UnmarshalJSON

type BetaManagedAgentsSessionResourceNotFoundRunErrorType

type BetaManagedAgentsSessionResourceNotFoundRunErrorType string
const (
	BetaManagedAgentsSessionResourceNotFoundRunErrorTypeSessionResourceNotFoundError BetaManagedAgentsSessionResourceNotFoundRunErrorType = "session_resource_not_found_error"
)

type BetaManagedAgentsSessionResourceUnion

type BetaManagedAgentsSessionResourceUnion struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	MountPath string    `json:"mount_path"`
	// Any of "github_repository", "file", "memory_store".
	Type      string    `json:"type"`
	UpdatedAt time.Time `json:"updated_at"`
	// This field is from variant [BetaManagedAgentsGitHubRepositoryResource].
	URL string `json:"url"`
	// This field is from variant [BetaManagedAgentsGitHubRepositoryResource].
	Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion `json:"checkout"`
	// This field is from variant [BetaManagedAgentsFileResource].
	FileID string `json:"file_id"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	MemoryStoreID string `json:"memory_store_id"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Access BetaManagedAgentsMemoryStoreResourceAccess `json:"access"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Instructions string `json:"instructions"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Name string `json:"name"`
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		MountPath     respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		URL           respjson.Field
		Checkout      respjson.Field
		FileID        respjson.Field
		MemoryStoreID respjson.Field
		Access        respjson.Field
		Description   respjson.Field
		Instructions  respjson.Field
		Name          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionResourceUnion contains all possible properties and values from BetaManagedAgentsGitHubRepositoryResource, BetaManagedAgentsFileResource, BetaManagedAgentsMemoryStoreResource.

Use the BetaManagedAgentsSessionResourceUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionResourceUnion) AsAny

func (u BetaManagedAgentsSessionResourceUnion) AsAny() anyBetaManagedAgentsSessionResource

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionResourceUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsGitHubRepositoryResource:
case Juglow.BetaManagedAgentsFileResource:
case Juglow.BetaManagedAgentsMemoryStoreResource:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionResourceUnion) AsFile

func (BetaManagedAgentsSessionResourceUnion) AsGitHubRepository

func (BetaManagedAgentsSessionResourceUnion) AsMemoryStore

func (BetaManagedAgentsSessionResourceUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionResourceUnion) UnmarshalJSON

func (r *BetaManagedAgentsSessionResourceUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionRetriesExhausted

type BetaManagedAgentsSessionRetriesExhausted struct {
	// Any of "retries_exhausted".
	Type BetaManagedAgentsSessionRetriesExhaustedType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The turn ended because repeated errors exhausted the retry budget or an error escalated to `retry_status: 'exhausted'`.

func (BetaManagedAgentsSessionRetriesExhausted) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionRetriesExhausted) UnmarshalJSON

func (r *BetaManagedAgentsSessionRetriesExhausted) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionRetriesExhaustedType

type BetaManagedAgentsSessionRetriesExhaustedType string
const (
	BetaManagedAgentsSessionRetriesExhaustedTypeRetriesExhausted BetaManagedAgentsSessionRetriesExhaustedType = "retries_exhausted"
)

type BetaManagedAgentsSessionStats

type BetaManagedAgentsSessionStats struct {
	// Cumulative time in seconds the session spent in running status. Excludes idle
	// time.
	ActiveSeconds float64 `json:"active_seconds"`
	// Elapsed time since session creation in seconds. For terminated sessions, frozen
	// at the final update.
	DurationSeconds float64 `json:"duration_seconds"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActiveSeconds   respjson.Field
		DurationSeconds respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Timing statistics for a session.

func (BetaManagedAgentsSessionStats) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionStats) UnmarshalJSON

func (r *BetaManagedAgentsSessionStats) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionStatus

type BetaManagedAgentsSessionStatus string

SessionStatus enum

const (
	BetaManagedAgentsSessionStatusRescheduling BetaManagedAgentsSessionStatus = "rescheduling"
	BetaManagedAgentsSessionStatusRunning      BetaManagedAgentsSessionStatus = "running"
	BetaManagedAgentsSessionStatusIdle         BetaManagedAgentsSessionStatus = "idle"
	BetaManagedAgentsSessionStatusTerminated   BetaManagedAgentsSessionStatus = "terminated"
)

type BetaManagedAgentsSessionStatusIdleEvent

type BetaManagedAgentsSessionStatusIdleEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// The agent completed its turn naturally and is ready for the next user message.
	StopReason BetaManagedAgentsSessionStatusIdleEventStopReasonUnion `json:"stop_reason" api:"required"`
	// Any of "session.status_idle".
	Type BetaManagedAgentsSessionStatusIdleEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		StopReason  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates the agent has paused and is awaiting user input.

func (BetaManagedAgentsSessionStatusIdleEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionStatusIdleEvent) UnmarshalJSON

func (r *BetaManagedAgentsSessionStatusIdleEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionStatusIdleEventStopReasonUnion

type BetaManagedAgentsSessionStatusIdleEventStopReasonUnion struct {
	// Any of "end_turn", "requires_action", "retries_exhausted", "budget_reached".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsSessionRequiresAction].
	EventIDs []string `json:"event_ids"`
	JSON     struct {
		Type     respjson.Field
		EventIDs respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionStatusIdleEventStopReasonUnion contains all possible properties and values from BetaManagedAgentsSessionEndTurn, BetaManagedAgentsSessionRequiresAction, BetaManagedAgentsSessionRetriesExhausted, BetaManagedAgentsSessionBudgetReached.

Use the BetaManagedAgentsSessionStatusIdleEventStopReasonUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionStatusIdleEventStopReasonUnion) AsAny

func (u BetaManagedAgentsSessionStatusIdleEventStopReasonUnion) AsAny() anyBetaManagedAgentsSessionStatusIdleEventStopReason

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionStatusIdleEventStopReasonUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsSessionEndTurn:
case Juglow.BetaManagedAgentsSessionRequiresAction:
case Juglow.BetaManagedAgentsSessionRetriesExhausted:
case Juglow.BetaManagedAgentsSessionBudgetReached:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionStatusIdleEventStopReasonUnion) AsBudgetReached

func (BetaManagedAgentsSessionStatusIdleEventStopReasonUnion) AsEndTurn

func (BetaManagedAgentsSessionStatusIdleEventStopReasonUnion) AsRequiresAction

func (BetaManagedAgentsSessionStatusIdleEventStopReasonUnion) AsRetriesExhausted

func (BetaManagedAgentsSessionStatusIdleEventStopReasonUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionStatusIdleEventStopReasonUnion) UnmarshalJSON

type BetaManagedAgentsSessionStatusIdleEventType

type BetaManagedAgentsSessionStatusIdleEventType string
const (
	BetaManagedAgentsSessionStatusIdleEventTypeSessionStatusIdle BetaManagedAgentsSessionStatusIdleEventType = "session.status_idle"
)

type BetaManagedAgentsSessionStatusRescheduledEvent

type BetaManagedAgentsSessionStatusRescheduledEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "session.status_rescheduled".
	Type BetaManagedAgentsSessionStatusRescheduledEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates the session is recovering from an error state and is rescheduled for execution.

func (BetaManagedAgentsSessionStatusRescheduledEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionStatusRescheduledEvent) UnmarshalJSON

type BetaManagedAgentsSessionStatusRescheduledEventType

type BetaManagedAgentsSessionStatusRescheduledEventType string
const (
	BetaManagedAgentsSessionStatusRescheduledEventTypeSessionStatusRescheduled BetaManagedAgentsSessionStatusRescheduledEventType = "session.status_rescheduled"
)

type BetaManagedAgentsSessionStatusRunningEvent

type BetaManagedAgentsSessionStatusRunningEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "session.status_running".
	Type BetaManagedAgentsSessionStatusRunningEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates the session is actively running and the agent is working.

func (BetaManagedAgentsSessionStatusRunningEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionStatusRunningEvent) UnmarshalJSON

func (r *BetaManagedAgentsSessionStatusRunningEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionStatusRunningEventType

type BetaManagedAgentsSessionStatusRunningEventType string
const (
	BetaManagedAgentsSessionStatusRunningEventTypeSessionStatusRunning BetaManagedAgentsSessionStatusRunningEventType = "session.status_running"
)

type BetaManagedAgentsSessionStatusTerminatedEvent

type BetaManagedAgentsSessionStatusTerminatedEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "session.status_terminated".
	Type BetaManagedAgentsSessionStatusTerminatedEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates the session has terminated, either due to an error or completion.

func (BetaManagedAgentsSessionStatusTerminatedEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionStatusTerminatedEvent) UnmarshalJSON

func (r *BetaManagedAgentsSessionStatusTerminatedEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionStatusTerminatedEventType

type BetaManagedAgentsSessionStatusTerminatedEventType string
const (
	BetaManagedAgentsSessionStatusTerminatedEventTypeSessionStatusTerminated BetaManagedAgentsSessionStatusTerminatedEventType = "session.status_terminated"
)

type BetaManagedAgentsSessionThread

type BetaManagedAgentsSessionThread struct {
	// Unique identifier for this thread.
	ID string `json:"id" api:"required"`
	// A session-resolved multiagent roster entry.
	Agent BetaManagedAgentsSessionThreadAgentUnion `json:"agent" api:"required"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Parent thread that spawned this thread. Null for the primary thread.
	ParentThreadID string `json:"parent_thread_id" api:"required"`
	// The session this thread belongs to.
	SessionID string `json:"session_id" api:"required"`
	// Timing statistics for a session thread.
	Stats BetaManagedAgentsSessionThreadStats `json:"stats" api:"required"`
	// SessionThreadStatus enum
	//
	// Any of "running", "idle", "rescheduling", "terminated".
	Status BetaManagedAgentsSessionThreadStatus `json:"status" api:"required"`
	// Any of "session_thread".
	Type BetaManagedAgentsSessionThreadType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Cumulative token usage for a session thread across all turns.
	Usage BetaManagedAgentsSessionThreadUsage `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Agent          respjson.Field
		ArchivedAt     respjson.Field
		CreatedAt      respjson.Field
		ParentThreadID respjson.Field
		SessionID      respjson.Field
		Stats          respjson.Field
		Status         respjson.Field
		Type           respjson.Field
		UpdatedAt      respjson.Field
		Usage          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An execution thread within a `session`. Each session has one primary thread plus zero or more child threads spawned by the coordinator.

func (BetaManagedAgentsSessionThread) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThread) UnmarshalJSON

func (r *BetaManagedAgentsSessionThread) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionThreadAgent

type BetaManagedAgentsSessionThreadAgent struct {
	ID          string                                    `json:"id" api:"required"`
	Description string                                    `json:"description" api:"required"`
	MCPServers  []BetaManagedAgentsMCPServerURLDefinition `json:"mcp_servers" api:"required"`
	// Model identifier and configuration.
	Model  BetaManagedAgentsModelConfig                    `json:"model" api:"required"`
	Name   string                                          `json:"name" api:"required"`
	Tracks []BetaManagedAgentsSessionThreadAgentTrackUnion `json:"tracks" api:"required"`
	System string                                          `json:"system" api:"required"`
	Tools  []BetaManagedAgentsSessionThreadAgentToolUnion  `json:"tools" api:"required"`
	// Any of "agent".
	Type    BetaManagedAgentsSessionThreadAgentType `json:"type" api:"required"`
	Version int64                                   `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Description respjson.Field
		MCPServers  respjson.Field
		Model       respjson.Field
		Name        respjson.Field
		Tracks      respjson.Field
		System      respjson.Field
		Tools       respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolved `agent` definition for a single `session_thread`. Snapshot of the agent at thread creation time. The multiagent roster is not repeated here; read it from `Session.agent`.

func (BetaManagedAgentsSessionThreadAgent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadAgent) UnmarshalJSON

func (r *BetaManagedAgentsSessionThreadAgent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionThreadAgentToolUnion

type BetaManagedAgentsSessionThreadAgentToolUnion struct {
	// This field is a union of [[]BetaManagedAgentsAgentToolConfig],
	// [[]BetaManagedAgentsMCPToolConfig]
	Configs BetaManagedAgentsSessionThreadAgentToolUnionConfigs `json:"configs"`
	// This field is a union of [BetaManagedAgentsAgentToolsetDefaultConfig],
	// [BetaManagedAgentsMCPToolsetDefaultConfig]
	DefaultConfig BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfig `json:"default_config"`
	// Any of "agent_toolset_20260401", "mcp_toolset", "custom".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsMCPToolset].
	MCPServerName string `json:"mcp_server_name"`
	// This field is from variant [BetaManagedAgentsCustomTool].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsCustomTool].
	InputSchema BetaManagedAgentsCustomToolInputSchema `json:"input_schema"`
	// This field is from variant [BetaManagedAgentsCustomTool].
	Name string `json:"name"`
	JSON struct {
		Configs       respjson.Field
		DefaultConfig respjson.Field
		Type          respjson.Field
		MCPServerName respjson.Field
		Description   respjson.Field
		InputSchema   respjson.Field
		Name          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionThreadAgentToolUnion contains all possible properties and values from BetaManagedAgentsAgentToolset20260401, BetaManagedAgentsMCPToolset, BetaManagedAgentsCustomTool.

Use the BetaManagedAgentsSessionThreadAgentToolUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionThreadAgentToolUnion) AsAgentToolset20260401

func (BetaManagedAgentsSessionThreadAgentToolUnion) AsAny

func (u BetaManagedAgentsSessionThreadAgentToolUnion) AsAny() anyBetaManagedAgentsSessionThreadAgentTool

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionThreadAgentToolUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsAgentToolset20260401:
case Juglow.BetaManagedAgentsMCPToolset:
case Juglow.BetaManagedAgentsCustomTool:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionThreadAgentToolUnion) AsCustom

func (BetaManagedAgentsSessionThreadAgentToolUnion) AsMCPToolset

func (BetaManagedAgentsSessionThreadAgentToolUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadAgentToolUnion) UnmarshalJSON

func (r *BetaManagedAgentsSessionThreadAgentToolUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionThreadAgentToolUnionConfigs

type BetaManagedAgentsSessionThreadAgentToolUnionConfigs struct {
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentToolConfig] instead of an object.
	OfBetaManagedAgentsAgentToolConfigArray []BetaManagedAgentsAgentToolConfig `json:",inline"`
	// This field will be present if the value is a [[]BetaManagedAgentsMCPToolConfig]
	// instead of an object.
	OfBetaManagedAgentsMCPToolConfigArray []BetaManagedAgentsMCPToolConfig `json:",inline"`
	JSON                                  struct {
		OfBetaManagedAgentsAgentToolConfigArray respjson.Field
		OfBetaManagedAgentsMCPToolConfigArray   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionThreadAgentToolUnionConfigs is an implicit subunion of BetaManagedAgentsSessionThreadAgentToolUnion. BetaManagedAgentsSessionThreadAgentToolUnionConfigs provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionThreadAgentToolUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaManagedAgentsAgentToolConfigArray OfBetaManagedAgentsMCPToolConfigArray]

func (*BetaManagedAgentsSessionThreadAgentToolUnionConfigs) UnmarshalJSON

type BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfig

type BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfig struct {
	Enabled bool `json:"enabled"`
	// This field is a union of
	// [BetaManagedAgentsAgentToolsetDefaultConfigPermissionPolicyUnion],
	// [BetaManagedAgentsMCPToolsetDefaultConfigPermissionPolicyUnion]
	PermissionPolicy BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfigPermissionPolicy `json:"permission_policy"`
	JSON             struct {
		Enabled          respjson.Field
		PermissionPolicy respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfig is an implicit subunion of BetaManagedAgentsSessionThreadAgentToolUnion. BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfig provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionThreadAgentToolUnion.

func (*BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfig) UnmarshalJSON

type BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfigPermissionPolicy

type BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfigPermissionPolicy struct {
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfigPermissionPolicy is an implicit subunion of BetaManagedAgentsSessionThreadAgentToolUnion. BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfigPermissionPolicy provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionThreadAgentToolUnion.

func (*BetaManagedAgentsSessionThreadAgentToolUnionDefaultConfigPermissionPolicy) UnmarshalJSON

type BetaManagedAgentsSessionThreadAgentTrackUnion added in v1.71.2

type BetaManagedAgentsSessionThreadAgentTrackUnion struct {
	TrackID string `json:"track_id"`
	// Any of "Juglow", "custom".
	Type    string `json:"type"`
	Version string `json:"version"`
	JSON    struct {
		TrackID respjson.Field
		Type    respjson.Field
		Version respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionThreadAgentTrackUnion contains all possible properties and values from BetaManagedAgentsJuglowTrack, BetaManagedAgentsCustomTrack.

Use the BetaManagedAgentsSessionThreadAgentTrackUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionThreadAgentTrackUnion) AsAny added in v1.71.2

func (u BetaManagedAgentsSessionThreadAgentTrackUnion) AsAny() anyBetaManagedAgentsSessionThreadAgentTrack

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionThreadAgentTrackUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsJuglowTrack:
case Juglow.BetaManagedAgentsCustomTrack:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionThreadAgentTrackUnion) AsCustom added in v1.71.2

func (BetaManagedAgentsSessionThreadAgentTrackUnion) AsJuglow added in v1.71.2

func (BetaManagedAgentsSessionThreadAgentTrackUnion) RawJSON added in v1.71.2

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadAgentTrackUnion) UnmarshalJSON added in v1.71.2

func (r *BetaManagedAgentsSessionThreadAgentTrackUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionThreadAgentType

type BetaManagedAgentsSessionThreadAgentType string
const (
	BetaManagedAgentsSessionThreadAgentTypeAgent BetaManagedAgentsSessionThreadAgentType = "agent"
)

type BetaManagedAgentsSessionThreadAgentUnion

type BetaManagedAgentsSessionThreadAgentUnion struct {
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	ID string `json:"id"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	MCPServers []BetaManagedAgentsMCPServerURLDefinition `json:"mcp_servers"`
	// This field is a union of [BetaManagedAgentsModelConfig], [string]
	Model BetaManagedAgentsSessionThreadAgentUnionModel `json:"model"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Name string `json:"name"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Tracks []BetaManagedAgentsSessionThreadAgentTrackUnion `json:"tracks"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	System string `json:"system"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Tools []BetaManagedAgentsSessionThreadAgentToolUnion `json:"tools"`
	// Any of "agent", "advisor".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsSessionThreadAgent].
	Version int64 `json:"version"`
	JSON    struct {
		ID          respjson.Field
		Description respjson.Field
		MCPServers  respjson.Field
		Model       respjson.Field
		Name        respjson.Field
		Tracks      respjson.Field
		System      respjson.Field
		Tools       respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionThreadAgentUnion contains all possible properties and values from BetaManagedAgentsSessionThreadAgent, BetaManagedAgentsAdvisor.

Use the BetaManagedAgentsSessionThreadAgentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionThreadAgentUnion) AsAdvisor

func (BetaManagedAgentsSessionThreadAgentUnion) AsAgent

func (BetaManagedAgentsSessionThreadAgentUnion) AsAny

func (u BetaManagedAgentsSessionThreadAgentUnion) AsAny() anyBetaManagedAgentsSessionThreadAgent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionThreadAgentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsSessionThreadAgent:
case Juglow.BetaManagedAgentsAdvisor:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionThreadAgentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadAgentUnion) UnmarshalJSON

func (r *BetaManagedAgentsSessionThreadAgentUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionThreadAgentUnionModel

type BetaManagedAgentsSessionThreadAgentUnionModel struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field is from variant [BetaManagedAgentsModelConfig].
	ID BetaManagedAgentsModel `json:"id"`
	// This field is from variant [BetaManagedAgentsModelConfig].
	Effort BetaManagedAgentsModelConfigEffortUnion `json:"effort"`
	// This field is from variant [BetaManagedAgentsModelConfig].
	InferenceGeo string `json:"inference_geo"`
	// This field is from variant [BetaManagedAgentsModelConfig].
	Speed BetaManagedAgentsModelConfigSpeed `json:"speed"`
	JSON  struct {
		OfString     respjson.Field
		ID           respjson.Field
		Effort       respjson.Field
		InferenceGeo respjson.Field
		Speed        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionThreadAgentUnionModel is an implicit subunion of BetaManagedAgentsSessionThreadAgentUnion. BetaManagedAgentsSessionThreadAgentUnionModel provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsSessionThreadAgentUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString]

func (*BetaManagedAgentsSessionThreadAgentUnionModel) UnmarshalJSON

func (r *BetaManagedAgentsSessionThreadAgentUnionModel) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionThreadCreatedEvent

type BetaManagedAgentsSessionThreadCreatedEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Name of the callable agent the thread runs.
	AgentName string `json:"agent_name" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Public `sthr_` ID of the newly created thread.
	SessionThreadID string `json:"session_thread_id" api:"required"`
	// Any of "session.thread_created".
	Type BetaManagedAgentsSessionThreadCreatedEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		AgentName       respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Emitted when a subagent is spawned as a new thread. Written to the parent thread's output stream so clients observing the session see child creation.

func (BetaManagedAgentsSessionThreadCreatedEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadCreatedEvent) UnmarshalJSON

func (r *BetaManagedAgentsSessionThreadCreatedEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionThreadCreatedEventType

type BetaManagedAgentsSessionThreadCreatedEventType string
const (
	BetaManagedAgentsSessionThreadCreatedEventTypeSessionThreadCreated BetaManagedAgentsSessionThreadCreatedEventType = "session.thread_created"
)

type BetaManagedAgentsSessionThreadStats

type BetaManagedAgentsSessionThreadStats struct {
	// Cumulative time in seconds the thread spent actively running. Excludes idle
	// time.
	ActiveSeconds float64 `json:"active_seconds"`
	// Elapsed time since thread creation in seconds. For archived threads, frozen at
	// the final update.
	DurationSeconds float64 `json:"duration_seconds"`
	// Time in seconds for the thread to begin running. Zero for child threads, which
	// start immediately.
	StartupSeconds float64 `json:"startup_seconds"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActiveSeconds   respjson.Field
		DurationSeconds respjson.Field
		StartupSeconds  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Timing statistics for a session thread.

func (BetaManagedAgentsSessionThreadStats) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadStats) UnmarshalJSON

func (r *BetaManagedAgentsSessionThreadStats) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionThreadStatus

type BetaManagedAgentsSessionThreadStatus string

SessionThreadStatus enum

const (
	BetaManagedAgentsSessionThreadStatusRunning      BetaManagedAgentsSessionThreadStatus = "running"
	BetaManagedAgentsSessionThreadStatusIdle         BetaManagedAgentsSessionThreadStatus = "idle"
	BetaManagedAgentsSessionThreadStatusRescheduling BetaManagedAgentsSessionThreadStatus = "rescheduling"
	BetaManagedAgentsSessionThreadStatusTerminated   BetaManagedAgentsSessionThreadStatus = "terminated"
)

type BetaManagedAgentsSessionThreadStatusIdleEvent

type BetaManagedAgentsSessionThreadStatusIdleEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Name of the agent the thread runs.
	AgentName string `json:"agent_name" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Public sthr\_ ID of the thread that went idle.
	SessionThreadID string `json:"session_thread_id" api:"required"`
	// The agent completed its turn naturally and is ready for the next user message.
	StopReason BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion `json:"stop_reason" api:"required"`
	// Any of "session.thread_status_idle".
	Type BetaManagedAgentsSessionThreadStatusIdleEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		AgentName       respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		StopReason      respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A session thread has yielded and is awaiting input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

func (BetaManagedAgentsSessionThreadStatusIdleEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadStatusIdleEvent) UnmarshalJSON

func (r *BetaManagedAgentsSessionThreadStatusIdleEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion

type BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion struct {
	// Any of "end_turn", "requires_action", "retries_exhausted", "budget_reached".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsSessionRequiresAction].
	EventIDs []string `json:"event_ids"`
	JSON     struct {
		Type     respjson.Field
		EventIDs respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion contains all possible properties and values from BetaManagedAgentsSessionEndTurn, BetaManagedAgentsSessionRequiresAction, BetaManagedAgentsSessionRetriesExhausted, BetaManagedAgentsSessionBudgetReached.

Use the BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion) AsAny

func (u BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion) AsAny() anyBetaManagedAgentsSessionThreadStatusIdleEventStopReason

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsSessionEndTurn:
case Juglow.BetaManagedAgentsSessionRequiresAction:
case Juglow.BetaManagedAgentsSessionRetriesExhausted:
case Juglow.BetaManagedAgentsSessionBudgetReached:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion) AsBudgetReached

func (BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion) AsEndTurn

func (BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion) AsRequiresAction

func (BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion) AsRetriesExhausted

func (BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion) UnmarshalJSON

type BetaManagedAgentsSessionThreadStatusIdleEventType

type BetaManagedAgentsSessionThreadStatusIdleEventType string
const (
	BetaManagedAgentsSessionThreadStatusIdleEventTypeSessionThreadStatusIdle BetaManagedAgentsSessionThreadStatusIdleEventType = "session.thread_status_idle"
)

type BetaManagedAgentsSessionThreadStatusRescheduledEvent

type BetaManagedAgentsSessionThreadStatusRescheduledEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Name of the agent the thread runs.
	AgentName string `json:"agent_name" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Public sthr\_ ID of the thread that is retrying.
	SessionThreadID string `json:"session_thread_id" api:"required"`
	// Any of "session.thread_status_rescheduled".
	Type BetaManagedAgentsSessionThreadStatusRescheduledEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		AgentName       respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A session thread hit a transient error and is retrying automatically. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

func (BetaManagedAgentsSessionThreadStatusRescheduledEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadStatusRescheduledEvent) UnmarshalJSON

type BetaManagedAgentsSessionThreadStatusRescheduledEventType

type BetaManagedAgentsSessionThreadStatusRescheduledEventType string
const (
	BetaManagedAgentsSessionThreadStatusRescheduledEventTypeSessionThreadStatusRescheduled BetaManagedAgentsSessionThreadStatusRescheduledEventType = "session.thread_status_rescheduled"
)

type BetaManagedAgentsSessionThreadStatusRunningEvent

type BetaManagedAgentsSessionThreadStatusRunningEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Name of the agent the thread runs.
	AgentName string `json:"agent_name" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Public sthr\_ ID of the thread that started running.
	SessionThreadID string `json:"session_thread_id" api:"required"`
	// Any of "session.thread_status_running".
	Type BetaManagedAgentsSessionThreadStatusRunningEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		AgentName       respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A session thread has begun executing. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

func (BetaManagedAgentsSessionThreadStatusRunningEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadStatusRunningEvent) UnmarshalJSON

type BetaManagedAgentsSessionThreadStatusRunningEventType

type BetaManagedAgentsSessionThreadStatusRunningEventType string
const (
	BetaManagedAgentsSessionThreadStatusRunningEventTypeSessionThreadStatusRunning BetaManagedAgentsSessionThreadStatusRunningEventType = "session.thread_status_running"
)

type BetaManagedAgentsSessionThreadStatusTerminatedEvent

type BetaManagedAgentsSessionThreadStatusTerminatedEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Name of the agent the thread runs.
	AgentName string `json:"agent_name" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Public sthr\_ ID of the thread that terminated.
	SessionThreadID string `json:"session_thread_id" api:"required"`
	// Any of "session.thread_status_terminated".
	Type BetaManagedAgentsSessionThreadStatusTerminatedEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		AgentName       respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A session thread has terminated and will accept no further input. Emitted on the thread's own stream and cross-posted to the primary stream for child threads.

func (BetaManagedAgentsSessionThreadStatusTerminatedEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadStatusTerminatedEvent) UnmarshalJSON

type BetaManagedAgentsSessionThreadStatusTerminatedEventType

type BetaManagedAgentsSessionThreadStatusTerminatedEventType string
const (
	BetaManagedAgentsSessionThreadStatusTerminatedEventTypeSessionThreadStatusTerminated BetaManagedAgentsSessionThreadStatusTerminatedEventType = "session.thread_status_terminated"
)

type BetaManagedAgentsSessionThreadType

type BetaManagedAgentsSessionThreadType string
const (
	BetaManagedAgentsSessionThreadTypeSessionThread BetaManagedAgentsSessionThreadType = "session_thread"
)

type BetaManagedAgentsSessionThreadUsage

type BetaManagedAgentsSessionThreadUsage struct {
	// Cumulative time in seconds this thread spent in running status. Equal to
	// `stats.active_seconds`; surfaced here so a thread's usage carries every quantity
	// its cost is priced on.
	ActiveSeconds float64 `json:"active_seconds"`
	// Prompt-cache creation token usage broken down by cache lifetime.
	CacheCreation BetaManagedAgentsCacheCreationUsage `json:"cache_creation"`
	// Total tokens read from prompt cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens"`
	// Total input tokens consumed across all turns.
	InputTokens int64 `json:"input_tokens"`
	// A monetary amount in a specific currency.
	ListCost BetaMonetaryAmount `json:"list_cost" api:"nullable"`
	// Total output tokens generated across all turns.
	OutputTokens int64 `json:"output_tokens"`
	// Cumulative count of server-executed tool invocations, broken down by tool.
	ServerToolUse BetaManagedAgentsServerToolUsage `json:"server_tool_use" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActiveSeconds        respjson.Field
		CacheCreation        respjson.Field
		CacheReadInputTokens respjson.Field
		InputTokens          respjson.Field
		ListCost             respjson.Field
		OutputTokens         respjson.Field
		ServerToolUse        respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cumulative token usage for a session thread across all turns.

func (BetaManagedAgentsSessionThreadUsage) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionThreadUsage) UnmarshalJSON

func (r *BetaManagedAgentsSessionThreadUsage) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionType

type BetaManagedAgentsSessionType string
const (
	BetaManagedAgentsSessionTypeSession BetaManagedAgentsSessionType = "session"
)

type BetaManagedAgentsSessionUpdatedEvent

type BetaManagedAgentsSessionUpdatedEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "session.updated".
	Type BetaManagedAgentsSessionUpdatedEventType `json:"type" api:"required"`
	// Resolved `agent` definition for a `session`. Snapshot of the `agent` at
	// `session` creation time.
	Agent BetaManagedAgentsSessionAgent `json:"agent" api:"nullable"`
	// A hard spend ceiling. The session stops issuing new model requests once the
	// tracked list cost reaches `max_list_cost`.
	Budget BetaManagedAgentsBudgetLimit `json:"budget" api:"nullable"`
	// The session's full metadata bag after the update. Present when the update set
	// non-empty metadata; absent when metadata was unchanged or cleared to empty.
	Metadata map[string]string `json:"metadata"`
	// The session's new title. Present only when the update changed it.
	Title string `json:"title" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		Agent       respjson.Field
		Budget      respjson.Field
		Metadata    respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Emitted when an UpdateSession request changed at least one field. Carries only the fields that changed; absent fields were not part of the update. The new configuration applies from the next turn.

func (BetaManagedAgentsSessionUpdatedEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionUpdatedEvent) UnmarshalJSON

func (r *BetaManagedAgentsSessionUpdatedEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionUpdatedEventType

type BetaManagedAgentsSessionUpdatedEventType string
const (
	BetaManagedAgentsSessionUpdatedEventTypeSessionUpdated BetaManagedAgentsSessionUpdatedEventType = "session.updated"
)

type BetaManagedAgentsSessionUsage

type BetaManagedAgentsSessionUsage struct {
	// Cumulative time in seconds during which the session had at least one thread in
	// running status. Overlapping activity from concurrent threads is counted once,
	// unlike `stats.active_seconds`, which sums each thread's own active time. This is
	// the duration the session's runtime cost is priced on.
	ActiveSeconds float64 `json:"active_seconds"`
	// Prompt-cache creation token usage broken down by cache lifetime.
	CacheCreation BetaManagedAgentsCacheCreationUsage `json:"cache_creation"`
	// Total tokens read from prompt cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens"`
	// Total input tokens consumed across all turns.
	InputTokens int64 `json:"input_tokens"`
	// A monetary amount in a specific currency.
	ListCost BetaMonetaryAmount `json:"list_cost" api:"nullable"`
	// Total output tokens generated across all turns.
	OutputTokens int64 `json:"output_tokens"`
	// Cumulative count of server-executed tool invocations, broken down by tool.
	ServerToolUse BetaManagedAgentsServerToolUsage `json:"server_tool_use" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActiveSeconds        respjson.Field
		CacheCreation        respjson.Field
		CacheReadInputTokens respjson.Field
		InputTokens          respjson.Field
		ListCost             respjson.Field
		OutputTokens         respjson.Field
		ServerToolUse        respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cumulative token usage for a session across all turns.

func (BetaManagedAgentsSessionUsage) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionUsage) UnmarshalJSON

func (r *BetaManagedAgentsSessionUsage) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionUsageEvent

type BetaManagedAgentsSessionUsageEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "session.usage".
	Type BetaManagedAgentsSessionUsageEventType `json:"type" api:"required"`
	// Point-in-time snapshot of a session's cumulative usage.
	Usage BetaManagedAgentsSessionUsageSnapshot `json:"usage" api:"required"`
	// A hard spend ceiling. The session stops issuing new model requests once the
	// tracked list cost reaches `max_list_cost`.
	Budget BetaManagedAgentsBudgetLimit `json:"budget" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		Usage       respjson.Field
		Budget      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Periodic snapshot of the session's cumulative usage and tracked list cost.

func (BetaManagedAgentsSessionUsageEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionUsageEvent) UnmarshalJSON

func (r *BetaManagedAgentsSessionUsageEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSessionUsageEventType

type BetaManagedAgentsSessionUsageEventType string
const (
	BetaManagedAgentsSessionUsageEventTypeSessionUsage BetaManagedAgentsSessionUsageEventType = "session.usage"
)

type BetaManagedAgentsSessionUsageSnapshot

type BetaManagedAgentsSessionUsageSnapshot struct {
	// Cumulative time in seconds during which the session had at least one thread in
	// running status. Overlapping activity from concurrent threads is counted once.
	// This is the duration the session's runtime cost is priced on.
	ActiveSeconds float64 `json:"active_seconds"`
	// Prompt-cache creation token usage broken down by cache lifetime.
	CacheCreation BetaManagedAgentsCacheCreationUsage `json:"cache_creation"`
	// Total tokens read from prompt cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens"`
	// Total input tokens consumed across all turns.
	InputTokens int64 `json:"input_tokens"`
	// A monetary amount in a specific currency.
	ListCost BetaMonetaryAmount `json:"list_cost"`
	// Total output tokens generated across all turns.
	OutputTokens int64 `json:"output_tokens"`
	// Cumulative count of server-executed tool invocations, broken down by tool.
	ServerToolUse BetaManagedAgentsServerToolUsage `json:"server_tool_use"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActiveSeconds        respjson.Field
		CacheCreation        respjson.Field
		CacheReadInputTokens respjson.Field
		InputTokens          respjson.Field
		ListCost             respjson.Field
		OutputTokens         respjson.Field
		ServerToolUse        respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Point-in-time snapshot of a session's cumulative usage.

func (BetaManagedAgentsSessionUsageSnapshot) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSessionUsageSnapshot) UnmarshalJSON

func (r *BetaManagedAgentsSessionUsageSnapshot) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSpanModelRequestEndEvent

type BetaManagedAgentsSpanModelRequestEndEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Whether the model request resulted in an error.
	IsError bool `json:"is_error" api:"required"`
	// The id of the corresponding `span.model_request_start` event.
	ModelRequestStartID string `json:"model_request_start_id" api:"required"`
	// Token usage for a single model request.
	ModelUsage BetaManagedAgentsSpanModelUsage `json:"model_usage" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "span.model_request_end".
	Type BetaManagedAgentsSpanModelRequestEndEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		IsError             respjson.Field
		ModelRequestStartID respjson.Field
		ModelUsage          respjson.Field
		ProcessedAt         respjson.Field
		Type                respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Emitted when a model request completes.

func (BetaManagedAgentsSpanModelRequestEndEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSpanModelRequestEndEvent) UnmarshalJSON

func (r *BetaManagedAgentsSpanModelRequestEndEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSpanModelRequestEndEventType

type BetaManagedAgentsSpanModelRequestEndEventType string
const (
	BetaManagedAgentsSpanModelRequestEndEventTypeSpanModelRequestEnd BetaManagedAgentsSpanModelRequestEndEventType = "span.model_request_end"
)

type BetaManagedAgentsSpanModelRequestStartEvent

type BetaManagedAgentsSpanModelRequestStartEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "span.model_request_start".
	Type BetaManagedAgentsSpanModelRequestStartEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Emitted when a model request is initiated by the agent.

func (BetaManagedAgentsSpanModelRequestStartEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSpanModelRequestStartEvent) UnmarshalJSON

func (r *BetaManagedAgentsSpanModelRequestStartEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSpanModelRequestStartEventType

type BetaManagedAgentsSpanModelRequestStartEventType string
const (
	BetaManagedAgentsSpanModelRequestStartEventTypeSpanModelRequestStart BetaManagedAgentsSpanModelRequestStartEventType = "span.model_request_start"
)

type BetaManagedAgentsSpanModelUsage

type BetaManagedAgentsSpanModelUsage struct {
	// Tokens used to create prompt cache in this request.
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// Tokens read from prompt cache in this request.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// Input tokens consumed by this request.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// Output tokens generated by this request.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed BetaManagedAgentsSpanModelUsageSpeed `json:"speed" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		OutputTokens             respjson.Field
		Speed                    respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token usage for a single model request.

func (BetaManagedAgentsSpanModelUsage) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSpanModelUsage) UnmarshalJSON

func (r *BetaManagedAgentsSpanModelUsage) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSpanModelUsageSpeed

type BetaManagedAgentsSpanModelUsageSpeed string

Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

const (
	BetaManagedAgentsSpanModelUsageSpeedStandard BetaManagedAgentsSpanModelUsageSpeed = "standard"
	BetaManagedAgentsSpanModelUsageSpeedFast     BetaManagedAgentsSpanModelUsageSpeed = "fast"
)

type BetaManagedAgentsSpanOutcomeEvaluationEndEvent

type BetaManagedAgentsSpanOutcomeEvaluationEndEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Human-readable explanation of the verdict. For `needs_revision`, describes which
	// criteria failed and why.
	Explanation string `json:"explanation" api:"required"`
	// 0-indexed revision cycle, matching the corresponding
	// `span.outcome_evaluation_start`.
	Iteration int64 `json:"iteration" api:"required"`
	// The id of the corresponding `span.outcome_evaluation_start` event.
	OutcomeEvaluationStartID string `json:"outcome_evaluation_start_id" api:"required"`
	// The `outc_` ID of the outcome being evaluated.
	OutcomeID string `json:"outcome_id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Evaluation verdict. 'satisfied': criteria met, session goes idle.
	// 'needs_revision': criteria not met, another revision cycle follows.
	// 'max_iterations_reached': evaluation budget exhausted with criteria still unmet
	// — one final acknowledgment turn follows before the session goes idle, but no
	// further evaluation runs. 'failed': grader determined the rubric does not apply
	// to the deliverables. 'interrupted': user sent an interrupt while evaluation was
	// in progress.
	Result string `json:"result" api:"required"`
	// Any of "span.outcome_evaluation_end".
	Type BetaManagedAgentsSpanOutcomeEvaluationEndEventType `json:"type" api:"required"`
	// Token usage for a single model request.
	Usage BetaManagedAgentsSpanModelUsage `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                       respjson.Field
		Explanation              respjson.Field
		Iteration                respjson.Field
		OutcomeEvaluationStartID respjson.Field
		OutcomeID                respjson.Field
		ProcessedAt              respjson.Field
		Result                   respjson.Field
		Type                     respjson.Field
		Usage                    respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Emitted when an outcome evaluation cycle completes. Carries the verdict and aggregate token usage. A verdict of `needs_revision` means another evaluation cycle follows; `satisfied`, `max_iterations_reached`, `failed`, or `interrupted` are terminal — no further evaluation cycles follow.

func (BetaManagedAgentsSpanOutcomeEvaluationEndEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSpanOutcomeEvaluationEndEvent) UnmarshalJSON

type BetaManagedAgentsSpanOutcomeEvaluationEndEventType

type BetaManagedAgentsSpanOutcomeEvaluationEndEventType string
const (
	BetaManagedAgentsSpanOutcomeEvaluationEndEventTypeSpanOutcomeEvaluationEnd BetaManagedAgentsSpanOutcomeEvaluationEndEventType = "span.outcome_evaluation_end"
)

type BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent

type BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// 0-indexed revision cycle, matching the corresponding
	// `span.outcome_evaluation_start`.
	Iteration int64 `json:"iteration" api:"required"`
	// The `outc_` ID of the outcome being evaluated.
	OutcomeID string `json:"outcome_id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "span.outcome_evaluation_ongoing".
	Type BetaManagedAgentsSpanOutcomeEvaluationOngoingEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Iteration   respjson.Field
		OutcomeID   respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Periodic heartbeat emitted while an outcome evaluation cycle is in progress. Distinguishes 'evaluation is actively running' from 'evaluation is stuck' between the corresponding `span.outcome_evaluation_start` and `span.outcome_evaluation_end` events.

func (BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent) UnmarshalJSON

type BetaManagedAgentsSpanOutcomeEvaluationOngoingEventType

type BetaManagedAgentsSpanOutcomeEvaluationOngoingEventType string
const (
	BetaManagedAgentsSpanOutcomeEvaluationOngoingEventTypeSpanOutcomeEvaluationOngoing BetaManagedAgentsSpanOutcomeEvaluationOngoingEventType = "span.outcome_evaluation_ongoing"
)

type BetaManagedAgentsSpanOutcomeEvaluationStartEvent

type BetaManagedAgentsSpanOutcomeEvaluationStartEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// 0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation
	// after the first revision; etc.
	Iteration int64 `json:"iteration" api:"required"`
	// The `outc_` ID of the outcome being evaluated.
	OutcomeID string `json:"outcome_id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Any of "span.outcome_evaluation_start".
	Type BetaManagedAgentsSpanOutcomeEvaluationStartEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Iteration   respjson.Field
		OutcomeID   respjson.Field
		ProcessedAt respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Emitted when an outcome evaluation cycle begins.

func (BetaManagedAgentsSpanOutcomeEvaluationStartEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSpanOutcomeEvaluationStartEvent) UnmarshalJSON

type BetaManagedAgentsSpanOutcomeEvaluationStartEventType

type BetaManagedAgentsSpanOutcomeEvaluationStartEventType string
const (
	BetaManagedAgentsSpanOutcomeEvaluationStartEventTypeSpanOutcomeEvaluationStart BetaManagedAgentsSpanOutcomeEvaluationStartEventType = "span.outcome_evaluation_start"
)

type BetaManagedAgentsStartEvent

type BetaManagedAgentsStartEvent struct {
	// The previewed event's type and id. The event type determines which delta types
	// the preview's event_delta events carry: agent.message events stream
	// content_delta fragments; agent.thinking previews are start-only — no deltas
	// follow, and the buffered agent.thinking with the same id concludes them.
	Event BetaManagedAgentsStartEventPreviewUnion `json:"event" api:"required"`
	// Any of "event_start".
	Type BetaManagedAgentsStartEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Event       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Opens a preview of a buffered event. Carries the previewed event's type and id only. Followed by zero or more event_delta events with the same event id, normally concluded by the buffered event carrying that id. If the producing model request ends without that event (an error or interrupt mid-stream), its terminal span.model_request_end closes the preview. Only sent on stream connections that opt in via event_deltas; never appears in event history.

func (BetaManagedAgentsStartEvent) RawJSON

func (r BetaManagedAgentsStartEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsStartEvent) UnmarshalJSON

func (r *BetaManagedAgentsStartEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsStartEventPreviewUnion

type BetaManagedAgentsStartEventPreviewUnion struct {
	ID string `json:"id"`
	// Any of "agent.message", "agent.thinking".
	Type string `json:"type"`
	JSON struct {
		ID   respjson.Field
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsStartEventPreviewUnion contains all possible properties and values from BetaManagedAgentsAgentMessagePreview, BetaManagedAgentsAgentThinkingPreview.

Use the BetaManagedAgentsStartEventPreviewUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsStartEventPreviewUnion) AsAgentMessage

func (BetaManagedAgentsStartEventPreviewUnion) AsAgentThinking

func (BetaManagedAgentsStartEventPreviewUnion) AsAny

func (u BetaManagedAgentsStartEventPreviewUnion) AsAny() anyBetaManagedAgentsStartEventPreview

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsStartEventPreviewUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsAgentMessagePreview:
case Juglow.BetaManagedAgentsAgentThinkingPreview:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsStartEventPreviewUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsStartEventPreviewUnion) UnmarshalJSON

func (r *BetaManagedAgentsStartEventPreviewUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsStartEventType

type BetaManagedAgentsStartEventType string
const (
	BetaManagedAgentsStartEventTypeEventStart BetaManagedAgentsStartEventType = "event_start"
)

type BetaManagedAgentsStaticBearerAuthResponse

type BetaManagedAgentsStaticBearerAuthResponse struct {
	// URL of the MCP server this credential authenticates against.
	MCPServerURL string `json:"mcp_server_url" api:"required"`
	// Any of "static_bearer".
	Type BetaManagedAgentsStaticBearerAuthResponseType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MCPServerURL respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Static bearer token credential details for an MCP server.

func (BetaManagedAgentsStaticBearerAuthResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsStaticBearerAuthResponse) UnmarshalJSON

func (r *BetaManagedAgentsStaticBearerAuthResponse) UnmarshalJSON(data []byte) error

type BetaManagedAgentsStaticBearerAuthResponseType

type BetaManagedAgentsStaticBearerAuthResponseType string
const (
	BetaManagedAgentsStaticBearerAuthResponseTypeStaticBearer BetaManagedAgentsStaticBearerAuthResponseType = "static_bearer"
)

type BetaManagedAgentsStaticBearerCreateParams

type BetaManagedAgentsStaticBearerCreateParams struct {
	// Static bearer token value.
	Token string `json:"token" api:"required"`
	// URL of the MCP server this credential authenticates against.
	MCPServerURL string `json:"mcp_server_url" api:"required"`
	// Any of "static_bearer".
	Type BetaManagedAgentsStaticBearerCreateParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Parameters for creating a static bearer token credential.

The properties Token, MCPServerURL, Type are required.

func (BetaManagedAgentsStaticBearerCreateParams) MarshalJSON

func (r BetaManagedAgentsStaticBearerCreateParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsStaticBearerCreateParams) UnmarshalJSON

func (r *BetaManagedAgentsStaticBearerCreateParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsStaticBearerCreateParamsType

type BetaManagedAgentsStaticBearerCreateParamsType string
const (
	BetaManagedAgentsStaticBearerCreateParamsTypeStaticBearer BetaManagedAgentsStaticBearerCreateParamsType = "static_bearer"
)

type BetaManagedAgentsStaticBearerUpdateParams

type BetaManagedAgentsStaticBearerUpdateParams struct {
	// Any of "static_bearer".
	Type BetaManagedAgentsStaticBearerUpdateParamsType `json:"type,omitzero" api:"required"`
	// Updated static bearer token value.
	Token param.Opt[string] `json:"token,omitzero"`
	// contains filtered or unexported fields
}

Parameters for updating a static bearer token credential. The `mcp_server_url` is immutable.

The property Type is required.

func (BetaManagedAgentsStaticBearerUpdateParams) MarshalJSON

func (r BetaManagedAgentsStaticBearerUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsStaticBearerUpdateParams) UnmarshalJSON

func (r *BetaManagedAgentsStaticBearerUpdateParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsStaticBearerUpdateParamsType

type BetaManagedAgentsStaticBearerUpdateParamsType string
const (
	BetaManagedAgentsStaticBearerUpdateParamsTypeStaticBearer BetaManagedAgentsStaticBearerUpdateParamsType = "static_bearer"
)

type BetaManagedAgentsStreamSessionEventsUnion

type BetaManagedAgentsStreamSessionEventsUnion struct {
	ID string `json:"id"`
	// This field is a union of [[]BetaManagedAgentsUserMessageEventContentUnion],
	// [[]BetaManagedAgentsUserCustomToolResultEventContentUnion],
	// [[]BetaManagedAgentsAgentMessageEventContentUnion],
	// [[]BetaManagedAgentsAgentMCPToolResultEventContentUnion],
	// [[]BetaManagedAgentsAgentToolResultEventContentUnion],
	// [[]BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion],
	// [[]BetaManagedAgentsAgentThreadMessageSentEventContentUnion],
	// [[]BetaManagedAgentsUserToolResultEventContentUnion],
	// [[]BetaManagedAgentsSystemContentBlock]
	Content BetaManagedAgentsStreamSessionEventsUnionContent `json:"content"`
	// Any of "user.message", "user.interrupt", "user.tool_confirmation",
	// "user.custom_tool_result", "agent.custom_tool_use", "agent.message",
	// "agent.thinking", "agent.mcp_tool_use", "agent.mcp_tool_result",
	// "agent.tool_use", "agent.tool_result", "agent.thread_message_received",
	// "agent.thread_message_sent", "agent.thread_context_compacted", "session.error",
	// "session.status_rescheduled", "session.status_running", "session.status_idle",
	// "session.status_terminated", "session.thread_created",
	// "span.outcome_evaluation_start", "span.outcome_evaluation_end",
	// "span.model_request_start", "span.model_request_end",
	// "span.outcome_evaluation_ongoing", "user.define_outcome", "session.deleted",
	// "session.thread_status_running", "session.thread_status_idle",
	// "session.thread_status_terminated", "user.tool_result",
	// "session.thread_status_rescheduled", "session.updated", "event_start",
	// "event_delta", "system.message", "session.usage".
	Type            string    `json:"type"`
	ProcessedAt     time.Time `json:"processed_at"`
	SessionThreadID string    `json:"session_thread_id"`
	Result          string    `json:"result"`
	ToolUseID       string    `json:"tool_use_id"`
	// This field is from variant [BetaManagedAgentsUserToolConfirmationEvent].
	DenyMessage string `json:"deny_message"`
	// This field is from variant [BetaManagedAgentsUserCustomToolResultEvent].
	CustomToolUseID string `json:"custom_tool_use_id"`
	IsError         bool   `json:"is_error"`
	Input           any    `json:"input"`
	Name            string `json:"name"`
	// This field is from variant [BetaManagedAgentsAgentMCPToolUseEvent].
	MCPServerName       string `json:"mcp_server_name"`
	EvaluatedPermission string `json:"evaluated_permission"`
	// This field is from variant [BetaManagedAgentsAgentMCPToolResultEvent].
	MCPToolUseID string `json:"mcp_tool_use_id"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageReceivedEvent].
	FromSessionThreadID string `json:"from_session_thread_id"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageReceivedEvent].
	FromAgentName string `json:"from_agent_name"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageSentEvent].
	ToSessionThreadID string `json:"to_session_thread_id"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageSentEvent].
	ToAgentName string `json:"to_agent_name"`
	// This field is from variant [BetaManagedAgentsSessionErrorEvent].
	Error BetaManagedAgentsSessionErrorEventErrorUnion `json:"error"`
	// This field is a union of
	// [BetaManagedAgentsSessionStatusIdleEventStopReasonUnion],
	// [BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion]
	StopReason BetaManagedAgentsStreamSessionEventsUnionStopReason `json:"stop_reason"`
	AgentName  string                                              `json:"agent_name"`
	Iteration  int64                                               `json:"iteration"`
	OutcomeID  string                                              `json:"outcome_id"`
	// This field is from variant [BetaManagedAgentsSpanOutcomeEvaluationEndEvent].
	Explanation string `json:"explanation"`
	// This field is from variant [BetaManagedAgentsSpanOutcomeEvaluationEndEvent].
	OutcomeEvaluationStartID string `json:"outcome_evaluation_start_id"`
	// This field is a union of [BetaManagedAgentsSpanModelUsage],
	// [BetaManagedAgentsSessionUsageSnapshot]
	Usage BetaManagedAgentsStreamSessionEventsUnionUsage `json:"usage"`
	// This field is from variant [BetaManagedAgentsSpanModelRequestEndEvent].
	ModelRequestStartID string `json:"model_request_start_id"`
	// This field is from variant [BetaManagedAgentsSpanModelRequestEndEvent].
	ModelUsage BetaManagedAgentsSpanModelUsage `json:"model_usage"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	MaxIterations int64 `json:"max_iterations"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion `json:"rubric"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Agent BetaManagedAgentsSessionAgent `json:"agent"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Budget BetaManagedAgentsBudgetLimit `json:"budget"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Metadata map[string]string `json:"metadata"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Title string `json:"title"`
	// This field is from variant [BetaManagedAgentsStartEvent].
	Event BetaManagedAgentsStartEventPreviewUnion `json:"event"`
	// This field is from variant [BetaManagedAgentsDeltaEvent].
	Delta BetaManagedAgentsDeltaContent `json:"delta"`
	// This field is from variant [BetaManagedAgentsDeltaEvent].
	EventID string `json:"event_id"`
	JSON    struct {
		ID                       respjson.Field
		Content                  respjson.Field
		Type                     respjson.Field
		ProcessedAt              respjson.Field
		SessionThreadID          respjson.Field
		Result                   respjson.Field
		ToolUseID                respjson.Field
		DenyMessage              respjson.Field
		CustomToolUseID          respjson.Field
		IsError                  respjson.Field
		Input                    respjson.Field
		Name                     respjson.Field
		MCPServerName            respjson.Field
		EvaluatedPermission      respjson.Field
		MCPToolUseID             respjson.Field
		FromSessionThreadID      respjson.Field
		FromAgentName            respjson.Field
		ToSessionThreadID        respjson.Field
		ToAgentName              respjson.Field
		Error                    respjson.Field
		StopReason               respjson.Field
		AgentName                respjson.Field
		Iteration                respjson.Field
		OutcomeID                respjson.Field
		Explanation              respjson.Field
		OutcomeEvaluationStartID respjson.Field
		Usage                    respjson.Field
		ModelRequestStartID      respjson.Field
		ModelUsage               respjson.Field
		Description              respjson.Field
		MaxIterations            respjson.Field
		Rubric                   respjson.Field
		Agent                    respjson.Field
		Budget                   respjson.Field
		Metadata                 respjson.Field
		Title                    respjson.Field
		Event                    respjson.Field
		Delta                    respjson.Field
		EventID                  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsStreamSessionEventsUnion contains all possible properties and values from BetaManagedAgentsUserMessageEvent, BetaManagedAgentsUserInterruptEvent, BetaManagedAgentsUserToolConfirmationEvent, BetaManagedAgentsUserCustomToolResultEvent, BetaManagedAgentsAgentCustomToolUseEvent, BetaManagedAgentsAgentMessageEvent, BetaManagedAgentsAgentThinkingEvent, BetaManagedAgentsAgentMCPToolUseEvent, BetaManagedAgentsAgentMCPToolResultEvent, BetaManagedAgentsAgentToolUseEvent, BetaManagedAgentsAgentToolResultEvent, BetaManagedAgentsAgentThreadMessageReceivedEvent, BetaManagedAgentsAgentThreadMessageSentEvent, BetaManagedAgentsAgentThreadContextCompactedEvent, BetaManagedAgentsSessionErrorEvent, BetaManagedAgentsSessionStatusRescheduledEvent, BetaManagedAgentsSessionStatusRunningEvent, BetaManagedAgentsSessionStatusIdleEvent, BetaManagedAgentsSessionStatusTerminatedEvent, BetaManagedAgentsSessionThreadCreatedEvent, BetaManagedAgentsSpanOutcomeEvaluationStartEvent, BetaManagedAgentsSpanOutcomeEvaluationEndEvent, BetaManagedAgentsSpanModelRequestStartEvent, BetaManagedAgentsSpanModelRequestEndEvent, BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent, BetaManagedAgentsUserDefineOutcomeEvent, BetaManagedAgentsSessionDeletedEvent, BetaManagedAgentsSessionThreadStatusRunningEvent, BetaManagedAgentsSessionThreadStatusIdleEvent, BetaManagedAgentsSessionThreadStatusTerminatedEvent, BetaManagedAgentsUserToolResultEvent, BetaManagedAgentsSessionThreadStatusRescheduledEvent, BetaManagedAgentsSessionUpdatedEvent, BetaManagedAgentsStartEvent, BetaManagedAgentsDeltaEvent, BetaManagedAgentsSystemMessageEvent, BetaManagedAgentsSessionUsageEvent.

Use the BetaManagedAgentsStreamSessionEventsUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentCustomToolUse

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentMCPToolResult

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentMCPToolUse

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentMessage

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentThinking

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentThreadContextCompacted

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentThreadMessageReceived

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentThreadMessageSent

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentToolResult

func (BetaManagedAgentsStreamSessionEventsUnion) AsAgentToolUse

func (BetaManagedAgentsStreamSessionEventsUnion) AsAny

func (u BetaManagedAgentsStreamSessionEventsUnion) AsAny() anyBetaManagedAgentsStreamSessionEvents

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsStreamSessionEventsUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsUserMessageEvent:
case Juglow.BetaManagedAgentsUserInterruptEvent:
case Juglow.BetaManagedAgentsUserToolConfirmationEvent:
case Juglow.BetaManagedAgentsUserCustomToolResultEvent:
case Juglow.BetaManagedAgentsAgentCustomToolUseEvent:
case Juglow.BetaManagedAgentsAgentMessageEvent:
case Juglow.BetaManagedAgentsAgentThinkingEvent:
case Juglow.BetaManagedAgentsAgentMCPToolUseEvent:
case Juglow.BetaManagedAgentsAgentMCPToolResultEvent:
case Juglow.BetaManagedAgentsAgentToolUseEvent:
case Juglow.BetaManagedAgentsAgentToolResultEvent:
case Juglow.BetaManagedAgentsAgentThreadMessageReceivedEvent:
case Juglow.BetaManagedAgentsAgentThreadMessageSentEvent:
case Juglow.BetaManagedAgentsAgentThreadContextCompactedEvent:
case Juglow.BetaManagedAgentsSessionErrorEvent:
case Juglow.BetaManagedAgentsSessionStatusRescheduledEvent:
case Juglow.BetaManagedAgentsSessionStatusRunningEvent:
case Juglow.BetaManagedAgentsSessionStatusIdleEvent:
case Juglow.BetaManagedAgentsSessionStatusTerminatedEvent:
case Juglow.BetaManagedAgentsSessionThreadCreatedEvent:
case Juglow.BetaManagedAgentsSpanOutcomeEvaluationStartEvent:
case Juglow.BetaManagedAgentsSpanOutcomeEvaluationEndEvent:
case Juglow.BetaManagedAgentsSpanModelRequestStartEvent:
case Juglow.BetaManagedAgentsSpanModelRequestEndEvent:
case Juglow.BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent:
case Juglow.BetaManagedAgentsUserDefineOutcomeEvent:
case Juglow.BetaManagedAgentsSessionDeletedEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusRunningEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusIdleEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusTerminatedEvent:
case Juglow.BetaManagedAgentsUserToolResultEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusRescheduledEvent:
case Juglow.BetaManagedAgentsSessionUpdatedEvent:
case Juglow.BetaManagedAgentsStartEvent:
case Juglow.BetaManagedAgentsDeltaEvent:
case Juglow.BetaManagedAgentsSystemMessageEvent:
case Juglow.BetaManagedAgentsSessionUsageEvent:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsStreamSessionEventsUnion) AsEventDelta

func (BetaManagedAgentsStreamSessionEventsUnion) AsEventStart

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionDeleted

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionError

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionStatusIdle

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionStatusRescheduled

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionStatusRunning

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionStatusTerminated

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionThreadCreated

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionThreadStatusIdle

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionThreadStatusRescheduled

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionThreadStatusRunning

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionThreadStatusTerminated

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionUpdated

func (BetaManagedAgentsStreamSessionEventsUnion) AsSessionUsage

func (BetaManagedAgentsStreamSessionEventsUnion) AsSpanModelRequestEnd

func (BetaManagedAgentsStreamSessionEventsUnion) AsSpanModelRequestStart

func (BetaManagedAgentsStreamSessionEventsUnion) AsSpanOutcomeEvaluationEnd

func (BetaManagedAgentsStreamSessionEventsUnion) AsSpanOutcomeEvaluationOngoing

func (BetaManagedAgentsStreamSessionEventsUnion) AsSpanOutcomeEvaluationStart

func (BetaManagedAgentsStreamSessionEventsUnion) AsSystemMessage

func (BetaManagedAgentsStreamSessionEventsUnion) AsUserCustomToolResult

func (BetaManagedAgentsStreamSessionEventsUnion) AsUserDefineOutcome

func (BetaManagedAgentsStreamSessionEventsUnion) AsUserInterrupt

func (BetaManagedAgentsStreamSessionEventsUnion) AsUserMessage

func (BetaManagedAgentsStreamSessionEventsUnion) AsUserToolConfirmation

func (BetaManagedAgentsStreamSessionEventsUnion) AsUserToolResult

func (BetaManagedAgentsStreamSessionEventsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsStreamSessionEventsUnion) UnmarshalJSON

func (r *BetaManagedAgentsStreamSessionEventsUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsStreamSessionEventsUnionContent

type BetaManagedAgentsStreamSessionEventsUnionContent struct {
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserMessageEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserMessageEventContentArray []BetaManagedAgentsUserMessageEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserCustomToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserCustomToolResultEventContentArray []BetaManagedAgentsUserCustomToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentMessageEventContentUnion] instead of an object.
	OfBetaManagedAgentsAgentMessageEventContentArray []BetaManagedAgentsAgentMessageEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentMCPToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsAgentMCPToolResultEventContentArray []BetaManagedAgentsAgentMCPToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsAgentToolResultEventContentArray []BetaManagedAgentsAgentToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion] instead of an
	// object.
	OfBetaManagedAgentsAgentThreadMessageReceivedEventContentArray []BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentThreadMessageSentEventContentUnion] instead of an
	// object.
	OfBetaManagedAgentsAgentThreadMessageSentEventContentArray []BetaManagedAgentsAgentThreadMessageSentEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserToolResultEventContentArray []BetaManagedAgentsUserToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsSystemContentBlock] instead of an object.
	OfBetaManagedAgentsSystemContentBlockArray []BetaManagedAgentsSystemContentBlock `json:",inline"`
	JSON                                       struct {
		OfBetaManagedAgentsUserMessageEventContentArray                respjson.Field
		OfBetaManagedAgentsUserCustomToolResultEventContentArray       respjson.Field
		OfBetaManagedAgentsAgentMessageEventContentArray               respjson.Field
		OfBetaManagedAgentsAgentMCPToolResultEventContentArray         respjson.Field
		OfBetaManagedAgentsAgentToolResultEventContentArray            respjson.Field
		OfBetaManagedAgentsAgentThreadMessageReceivedEventContentArray respjson.Field
		OfBetaManagedAgentsAgentThreadMessageSentEventContentArray     respjson.Field
		OfBetaManagedAgentsUserToolResultEventContentArray             respjson.Field
		OfBetaManagedAgentsSystemContentBlockArray                     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsStreamSessionEventsUnionContent is an implicit subunion of BetaManagedAgentsStreamSessionEventsUnion. BetaManagedAgentsStreamSessionEventsUnionContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsStreamSessionEventsUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaManagedAgentsUserMessageEventContentArray OfBetaManagedAgentsUserCustomToolResultEventContentArray OfBetaManagedAgentsAgentMessageEventContentArray OfBetaManagedAgentsAgentMCPToolResultEventContentArray OfBetaManagedAgentsAgentToolResultEventContentArray OfBetaManagedAgentsAgentThreadMessageReceivedEventContentArray OfBetaManagedAgentsAgentThreadMessageSentEventContentArray OfBetaManagedAgentsUserToolResultEventContentArray OfBetaManagedAgentsSystemContentBlockArray]

func (*BetaManagedAgentsStreamSessionEventsUnionContent) UnmarshalJSON

type BetaManagedAgentsStreamSessionEventsUnionStopReason

type BetaManagedAgentsStreamSessionEventsUnionStopReason struct {
	Type string `json:"type"`
	// This field is from variant
	// [BetaManagedAgentsSessionStatusIdleEventStopReasonUnion],
	// [BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion].
	EventIDs []string `json:"event_ids"`
	JSON     struct {
		Type     respjson.Field
		EventIDs respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsStreamSessionEventsUnionStopReason is an implicit subunion of BetaManagedAgentsStreamSessionEventsUnion. BetaManagedAgentsStreamSessionEventsUnionStopReason provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsStreamSessionEventsUnion.

func (*BetaManagedAgentsStreamSessionEventsUnionStopReason) UnmarshalJSON

type BetaManagedAgentsStreamSessionEventsUnionUsage

type BetaManagedAgentsStreamSessionEventsUnionUsage struct {
	// This field is from variant [BetaManagedAgentsSpanModelUsage].
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens"`
	CacheReadInputTokens     int64 `json:"cache_read_input_tokens"`
	InputTokens              int64 `json:"input_tokens"`
	OutputTokens             int64 `json:"output_tokens"`
	// This field is from variant [BetaManagedAgentsSpanModelUsage].
	Speed BetaManagedAgentsSpanModelUsageSpeed `json:"speed"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	ActiveSeconds float64 `json:"active_seconds"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	CacheCreation BetaManagedAgentsCacheCreationUsage `json:"cache_creation"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	ListCost BetaMonetaryAmount `json:"list_cost"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	ServerToolUse BetaManagedAgentsServerToolUsage `json:"server_tool_use"`
	JSON          struct {
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		OutputTokens             respjson.Field
		Speed                    respjson.Field
		ActiveSeconds            respjson.Field
		CacheCreation            respjson.Field
		ListCost                 respjson.Field
		ServerToolUse            respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsStreamSessionEventsUnionUsage is an implicit subunion of BetaManagedAgentsStreamSessionEventsUnion. BetaManagedAgentsStreamSessionEventsUnionUsage provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsStreamSessionEventsUnion.

func (*BetaManagedAgentsStreamSessionEventsUnionUsage) UnmarshalJSON

type BetaManagedAgentsStreamSessionThreadEventsUnion

type BetaManagedAgentsStreamSessionThreadEventsUnion struct {
	ID string `json:"id"`
	// This field is a union of [[]BetaManagedAgentsUserMessageEventContentUnion],
	// [[]BetaManagedAgentsUserCustomToolResultEventContentUnion],
	// [[]BetaManagedAgentsAgentMessageEventContentUnion],
	// [[]BetaManagedAgentsAgentMCPToolResultEventContentUnion],
	// [[]BetaManagedAgentsAgentToolResultEventContentUnion],
	// [[]BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion],
	// [[]BetaManagedAgentsAgentThreadMessageSentEventContentUnion],
	// [[]BetaManagedAgentsUserToolResultEventContentUnion],
	// [[]BetaManagedAgentsSystemContentBlock]
	Content BetaManagedAgentsStreamSessionThreadEventsUnionContent `json:"content"`
	// Any of "user.message", "user.interrupt", "user.tool_confirmation",
	// "user.custom_tool_result", "agent.custom_tool_use", "agent.message",
	// "agent.thinking", "agent.mcp_tool_use", "agent.mcp_tool_result",
	// "agent.tool_use", "agent.tool_result", "agent.thread_message_received",
	// "agent.thread_message_sent", "agent.thread_context_compacted", "session.error",
	// "session.status_rescheduled", "session.status_running", "session.status_idle",
	// "session.status_terminated", "session.thread_created",
	// "span.outcome_evaluation_start", "span.outcome_evaluation_end",
	// "span.model_request_start", "span.model_request_end",
	// "span.outcome_evaluation_ongoing", "user.define_outcome", "session.deleted",
	// "session.thread_status_running", "session.thread_status_idle",
	// "session.thread_status_terminated", "user.tool_result",
	// "session.thread_status_rescheduled", "session.updated", "event_start",
	// "event_delta", "system.message", "session.usage".
	Type            string    `json:"type"`
	ProcessedAt     time.Time `json:"processed_at"`
	SessionThreadID string    `json:"session_thread_id"`
	Result          string    `json:"result"`
	ToolUseID       string    `json:"tool_use_id"`
	// This field is from variant [BetaManagedAgentsUserToolConfirmationEvent].
	DenyMessage string `json:"deny_message"`
	// This field is from variant [BetaManagedAgentsUserCustomToolResultEvent].
	CustomToolUseID string `json:"custom_tool_use_id"`
	IsError         bool   `json:"is_error"`
	Input           any    `json:"input"`
	Name            string `json:"name"`
	// This field is from variant [BetaManagedAgentsAgentMCPToolUseEvent].
	MCPServerName       string `json:"mcp_server_name"`
	EvaluatedPermission string `json:"evaluated_permission"`
	// This field is from variant [BetaManagedAgentsAgentMCPToolResultEvent].
	MCPToolUseID string `json:"mcp_tool_use_id"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageReceivedEvent].
	FromSessionThreadID string `json:"from_session_thread_id"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageReceivedEvent].
	FromAgentName string `json:"from_agent_name"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageSentEvent].
	ToSessionThreadID string `json:"to_session_thread_id"`
	// This field is from variant [BetaManagedAgentsAgentThreadMessageSentEvent].
	ToAgentName string `json:"to_agent_name"`
	// This field is from variant [BetaManagedAgentsSessionErrorEvent].
	Error BetaManagedAgentsSessionErrorEventErrorUnion `json:"error"`
	// This field is a union of
	// [BetaManagedAgentsSessionStatusIdleEventStopReasonUnion],
	// [BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion]
	StopReason BetaManagedAgentsStreamSessionThreadEventsUnionStopReason `json:"stop_reason"`
	AgentName  string                                                    `json:"agent_name"`
	Iteration  int64                                                     `json:"iteration"`
	OutcomeID  string                                                    `json:"outcome_id"`
	// This field is from variant [BetaManagedAgentsSpanOutcomeEvaluationEndEvent].
	Explanation string `json:"explanation"`
	// This field is from variant [BetaManagedAgentsSpanOutcomeEvaluationEndEvent].
	OutcomeEvaluationStartID string `json:"outcome_evaluation_start_id"`
	// This field is a union of [BetaManagedAgentsSpanModelUsage],
	// [BetaManagedAgentsSessionUsageSnapshot]
	Usage BetaManagedAgentsStreamSessionThreadEventsUnionUsage `json:"usage"`
	// This field is from variant [BetaManagedAgentsSpanModelRequestEndEvent].
	ModelRequestStartID string `json:"model_request_start_id"`
	// This field is from variant [BetaManagedAgentsSpanModelRequestEndEvent].
	ModelUsage BetaManagedAgentsSpanModelUsage `json:"model_usage"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	MaxIterations int64 `json:"max_iterations"`
	// This field is from variant [BetaManagedAgentsUserDefineOutcomeEvent].
	Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion `json:"rubric"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Agent BetaManagedAgentsSessionAgent `json:"agent"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Budget BetaManagedAgentsBudgetLimit `json:"budget"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Metadata map[string]string `json:"metadata"`
	// This field is from variant [BetaManagedAgentsSessionUpdatedEvent].
	Title string `json:"title"`
	// This field is from variant [BetaManagedAgentsStartEvent].
	Event BetaManagedAgentsStartEventPreviewUnion `json:"event"`
	// This field is from variant [BetaManagedAgentsDeltaEvent].
	Delta BetaManagedAgentsDeltaContent `json:"delta"`
	// This field is from variant [BetaManagedAgentsDeltaEvent].
	EventID string `json:"event_id"`
	JSON    struct {
		ID                       respjson.Field
		Content                  respjson.Field
		Type                     respjson.Field
		ProcessedAt              respjson.Field
		SessionThreadID          respjson.Field
		Result                   respjson.Field
		ToolUseID                respjson.Field
		DenyMessage              respjson.Field
		CustomToolUseID          respjson.Field
		IsError                  respjson.Field
		Input                    respjson.Field
		Name                     respjson.Field
		MCPServerName            respjson.Field
		EvaluatedPermission      respjson.Field
		MCPToolUseID             respjson.Field
		FromSessionThreadID      respjson.Field
		FromAgentName            respjson.Field
		ToSessionThreadID        respjson.Field
		ToAgentName              respjson.Field
		Error                    respjson.Field
		StopReason               respjson.Field
		AgentName                respjson.Field
		Iteration                respjson.Field
		OutcomeID                respjson.Field
		Explanation              respjson.Field
		OutcomeEvaluationStartID respjson.Field
		Usage                    respjson.Field
		ModelRequestStartID      respjson.Field
		ModelUsage               respjson.Field
		Description              respjson.Field
		MaxIterations            respjson.Field
		Rubric                   respjson.Field
		Agent                    respjson.Field
		Budget                   respjson.Field
		Metadata                 respjson.Field
		Title                    respjson.Field
		Event                    respjson.Field
		Delta                    respjson.Field
		EventID                  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsStreamSessionThreadEventsUnion contains all possible properties and values from BetaManagedAgentsUserMessageEvent, BetaManagedAgentsUserInterruptEvent, BetaManagedAgentsUserToolConfirmationEvent, BetaManagedAgentsUserCustomToolResultEvent, BetaManagedAgentsAgentCustomToolUseEvent, BetaManagedAgentsAgentMessageEvent, BetaManagedAgentsAgentThinkingEvent, BetaManagedAgentsAgentMCPToolUseEvent, BetaManagedAgentsAgentMCPToolResultEvent, BetaManagedAgentsAgentToolUseEvent, BetaManagedAgentsAgentToolResultEvent, BetaManagedAgentsAgentThreadMessageReceivedEvent, BetaManagedAgentsAgentThreadMessageSentEvent, BetaManagedAgentsAgentThreadContextCompactedEvent, BetaManagedAgentsSessionErrorEvent, BetaManagedAgentsSessionStatusRescheduledEvent, BetaManagedAgentsSessionStatusRunningEvent, BetaManagedAgentsSessionStatusIdleEvent, BetaManagedAgentsSessionStatusTerminatedEvent, BetaManagedAgentsSessionThreadCreatedEvent, BetaManagedAgentsSpanOutcomeEvaluationStartEvent, BetaManagedAgentsSpanOutcomeEvaluationEndEvent, BetaManagedAgentsSpanModelRequestStartEvent, BetaManagedAgentsSpanModelRequestEndEvent, BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent, BetaManagedAgentsUserDefineOutcomeEvent, BetaManagedAgentsSessionDeletedEvent, BetaManagedAgentsSessionThreadStatusRunningEvent, BetaManagedAgentsSessionThreadStatusIdleEvent, BetaManagedAgentsSessionThreadStatusTerminatedEvent, BetaManagedAgentsUserToolResultEvent, BetaManagedAgentsSessionThreadStatusRescheduledEvent, BetaManagedAgentsSessionUpdatedEvent, BetaManagedAgentsStartEvent, BetaManagedAgentsDeltaEvent, BetaManagedAgentsSystemMessageEvent, BetaManagedAgentsSessionUsageEvent.

Use the BetaManagedAgentsStreamSessionThreadEventsUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentCustomToolUse

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentMCPToolResult

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentMCPToolUse

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentMessage

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentThinking

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentThreadContextCompacted

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentThreadMessageReceived

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentThreadMessageSent

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentToolResult

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAgentToolUse

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsAny

func (u BetaManagedAgentsStreamSessionThreadEventsUnion) AsAny() anyBetaManagedAgentsStreamSessionThreadEvents

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsStreamSessionThreadEventsUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsUserMessageEvent:
case Juglow.BetaManagedAgentsUserInterruptEvent:
case Juglow.BetaManagedAgentsUserToolConfirmationEvent:
case Juglow.BetaManagedAgentsUserCustomToolResultEvent:
case Juglow.BetaManagedAgentsAgentCustomToolUseEvent:
case Juglow.BetaManagedAgentsAgentMessageEvent:
case Juglow.BetaManagedAgentsAgentThinkingEvent:
case Juglow.BetaManagedAgentsAgentMCPToolUseEvent:
case Juglow.BetaManagedAgentsAgentMCPToolResultEvent:
case Juglow.BetaManagedAgentsAgentToolUseEvent:
case Juglow.BetaManagedAgentsAgentToolResultEvent:
case Juglow.BetaManagedAgentsAgentThreadMessageReceivedEvent:
case Juglow.BetaManagedAgentsAgentThreadMessageSentEvent:
case Juglow.BetaManagedAgentsAgentThreadContextCompactedEvent:
case Juglow.BetaManagedAgentsSessionErrorEvent:
case Juglow.BetaManagedAgentsSessionStatusRescheduledEvent:
case Juglow.BetaManagedAgentsSessionStatusRunningEvent:
case Juglow.BetaManagedAgentsSessionStatusIdleEvent:
case Juglow.BetaManagedAgentsSessionStatusTerminatedEvent:
case Juglow.BetaManagedAgentsSessionThreadCreatedEvent:
case Juglow.BetaManagedAgentsSpanOutcomeEvaluationStartEvent:
case Juglow.BetaManagedAgentsSpanOutcomeEvaluationEndEvent:
case Juglow.BetaManagedAgentsSpanModelRequestStartEvent:
case Juglow.BetaManagedAgentsSpanModelRequestEndEvent:
case Juglow.BetaManagedAgentsSpanOutcomeEvaluationOngoingEvent:
case Juglow.BetaManagedAgentsUserDefineOutcomeEvent:
case Juglow.BetaManagedAgentsSessionDeletedEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusRunningEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusIdleEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusTerminatedEvent:
case Juglow.BetaManagedAgentsUserToolResultEvent:
case Juglow.BetaManagedAgentsSessionThreadStatusRescheduledEvent:
case Juglow.BetaManagedAgentsSessionUpdatedEvent:
case Juglow.BetaManagedAgentsStartEvent:
case Juglow.BetaManagedAgentsDeltaEvent:
case Juglow.BetaManagedAgentsSystemMessageEvent:
case Juglow.BetaManagedAgentsSessionUsageEvent:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsEventDelta

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsEventStart

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionDeleted

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionError

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionStatusIdle

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionStatusRescheduled

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionStatusRunning

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionStatusTerminated

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionThreadCreated

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionThreadStatusIdle

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionThreadStatusRescheduled

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionThreadStatusRunning

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionThreadStatusTerminated

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionUpdated

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSessionUsage

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSpanModelRequestEnd

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSpanModelRequestStart

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSpanOutcomeEvaluationEnd

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSpanOutcomeEvaluationOngoing

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSpanOutcomeEvaluationStart

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsSystemMessage

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsUserCustomToolResult

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsUserDefineOutcome

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsUserInterrupt

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsUserMessage

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsUserToolConfirmation

func (BetaManagedAgentsStreamSessionThreadEventsUnion) AsUserToolResult

func (BetaManagedAgentsStreamSessionThreadEventsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsStreamSessionThreadEventsUnion) UnmarshalJSON

type BetaManagedAgentsStreamSessionThreadEventsUnionContent

type BetaManagedAgentsStreamSessionThreadEventsUnionContent struct {
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserMessageEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserMessageEventContentArray []BetaManagedAgentsUserMessageEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserCustomToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserCustomToolResultEventContentArray []BetaManagedAgentsUserCustomToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentMessageEventContentUnion] instead of an object.
	OfBetaManagedAgentsAgentMessageEventContentArray []BetaManagedAgentsAgentMessageEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentMCPToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsAgentMCPToolResultEventContentArray []BetaManagedAgentsAgentMCPToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsAgentToolResultEventContentArray []BetaManagedAgentsAgentToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion] instead of an
	// object.
	OfBetaManagedAgentsAgentThreadMessageReceivedEventContentArray []BetaManagedAgentsAgentThreadMessageReceivedEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsAgentThreadMessageSentEventContentUnion] instead of an
	// object.
	OfBetaManagedAgentsAgentThreadMessageSentEventContentArray []BetaManagedAgentsAgentThreadMessageSentEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsUserToolResultEventContentUnion] instead of an object.
	OfBetaManagedAgentsUserToolResultEventContentArray []BetaManagedAgentsUserToolResultEventContentUnion `json:",inline"`
	// This field will be present if the value is a
	// [[]BetaManagedAgentsSystemContentBlock] instead of an object.
	OfBetaManagedAgentsSystemContentBlockArray []BetaManagedAgentsSystemContentBlock `json:",inline"`
	JSON                                       struct {
		OfBetaManagedAgentsUserMessageEventContentArray                respjson.Field
		OfBetaManagedAgentsUserCustomToolResultEventContentArray       respjson.Field
		OfBetaManagedAgentsAgentMessageEventContentArray               respjson.Field
		OfBetaManagedAgentsAgentMCPToolResultEventContentArray         respjson.Field
		OfBetaManagedAgentsAgentToolResultEventContentArray            respjson.Field
		OfBetaManagedAgentsAgentThreadMessageReceivedEventContentArray respjson.Field
		OfBetaManagedAgentsAgentThreadMessageSentEventContentArray     respjson.Field
		OfBetaManagedAgentsUserToolResultEventContentArray             respjson.Field
		OfBetaManagedAgentsSystemContentBlockArray                     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsStreamSessionThreadEventsUnionContent is an implicit subunion of BetaManagedAgentsStreamSessionThreadEventsUnion. BetaManagedAgentsStreamSessionThreadEventsUnionContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsStreamSessionThreadEventsUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaManagedAgentsUserMessageEventContentArray OfBetaManagedAgentsUserCustomToolResultEventContentArray OfBetaManagedAgentsAgentMessageEventContentArray OfBetaManagedAgentsAgentMCPToolResultEventContentArray OfBetaManagedAgentsAgentToolResultEventContentArray OfBetaManagedAgentsAgentThreadMessageReceivedEventContentArray OfBetaManagedAgentsAgentThreadMessageSentEventContentArray OfBetaManagedAgentsUserToolResultEventContentArray OfBetaManagedAgentsSystemContentBlockArray]

func (*BetaManagedAgentsStreamSessionThreadEventsUnionContent) UnmarshalJSON

type BetaManagedAgentsStreamSessionThreadEventsUnionStopReason

type BetaManagedAgentsStreamSessionThreadEventsUnionStopReason struct {
	Type string `json:"type"`
	// This field is from variant
	// [BetaManagedAgentsSessionStatusIdleEventStopReasonUnion],
	// [BetaManagedAgentsSessionThreadStatusIdleEventStopReasonUnion].
	EventIDs []string `json:"event_ids"`
	JSON     struct {
		Type     respjson.Field
		EventIDs respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsStreamSessionThreadEventsUnionStopReason is an implicit subunion of BetaManagedAgentsStreamSessionThreadEventsUnion. BetaManagedAgentsStreamSessionThreadEventsUnionStopReason provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsStreamSessionThreadEventsUnion.

func (*BetaManagedAgentsStreamSessionThreadEventsUnionStopReason) UnmarshalJSON

type BetaManagedAgentsStreamSessionThreadEventsUnionUsage

type BetaManagedAgentsStreamSessionThreadEventsUnionUsage struct {
	// This field is from variant [BetaManagedAgentsSpanModelUsage].
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens"`
	CacheReadInputTokens     int64 `json:"cache_read_input_tokens"`
	InputTokens              int64 `json:"input_tokens"`
	OutputTokens             int64 `json:"output_tokens"`
	// This field is from variant [BetaManagedAgentsSpanModelUsage].
	Speed BetaManagedAgentsSpanModelUsageSpeed `json:"speed"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	ActiveSeconds float64 `json:"active_seconds"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	CacheCreation BetaManagedAgentsCacheCreationUsage `json:"cache_creation"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	ListCost BetaMonetaryAmount `json:"list_cost"`
	// This field is from variant [BetaManagedAgentsSessionUsageSnapshot].
	ServerToolUse BetaManagedAgentsServerToolUsage `json:"server_tool_use"`
	JSON          struct {
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		OutputTokens             respjson.Field
		Speed                    respjson.Field
		ActiveSeconds            respjson.Field
		CacheCreation            respjson.Field
		ListCost                 respjson.Field
		ServerToolUse            respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsStreamSessionThreadEventsUnionUsage is an implicit subunion of BetaManagedAgentsStreamSessionThreadEventsUnion. BetaManagedAgentsStreamSessionThreadEventsUnionUsage provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsStreamSessionThreadEventsUnion.

func (*BetaManagedAgentsStreamSessionThreadEventsUnionUsage) UnmarshalJSON

type BetaManagedAgentsSystemContentBlock

type BetaManagedAgentsSystemContentBlock struct {
	// The text content.
	Text string `json:"text" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsSystemContentBlockType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Regular text content.

func (BetaManagedAgentsSystemContentBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsSystemContentBlock) ToParam

ToParam converts this BetaManagedAgentsSystemContentBlock to a BetaManagedAgentsSystemContentBlockParam.

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 BetaManagedAgentsSystemContentBlockParam.Overrides()

func (*BetaManagedAgentsSystemContentBlock) UnmarshalJSON

func (r *BetaManagedAgentsSystemContentBlock) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSystemContentBlockParam

type BetaManagedAgentsSystemContentBlockParam struct {
	// The text content.
	Text string `json:"text" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsSystemContentBlockType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Regular text content.

The properties Text, Type are required.

func (BetaManagedAgentsSystemContentBlockParam) MarshalJSON

func (r BetaManagedAgentsSystemContentBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsSystemContentBlockParam) UnmarshalJSON

func (r *BetaManagedAgentsSystemContentBlockParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSystemContentBlockType

type BetaManagedAgentsSystemContentBlockType string
const (
	BetaManagedAgentsSystemContentBlockTypeText BetaManagedAgentsSystemContentBlockType = "text"
)

type BetaManagedAgentsSystemMessageEvent

type BetaManagedAgentsSystemMessageEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// System content blocks. Text-only.
	Content []BetaManagedAgentsSystemContentBlock `json:"content" api:"required"`
	// Any of "system.message".
	Type BetaManagedAgentsSystemMessageEventType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Content     respjson.Field
		Type        respjson.Field
		ProcessedAt respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A mid-conversation system message event. Carries system-role content that is appended to the session as a `role: "system"` turn.

func (BetaManagedAgentsSystemMessageEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsSystemMessageEvent) UnmarshalJSON

func (r *BetaManagedAgentsSystemMessageEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSystemMessageEventParams

type BetaManagedAgentsSystemMessageEventParams struct {
	// System content blocks to append. Text-only.
	Content []BetaManagedAgentsSystemContentBlockParam `json:"content,omitzero" api:"required"`
	// Any of "system.message".
	Type BetaManagedAgentsSystemMessageEventParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Privileged context for the accompanying turn and all subsequent turns, appended to the session's system context as a `role: "system"` turn rather than replacing the top-level system prompt. At most one per request: it must be the final event and immediately follow the `user.message`, `user.tool_result`, or `user.custom_tool_result` it accompanies. Only supported on models that accept mid-conversation system messages.

The properties Content, Type are required.

func (BetaManagedAgentsSystemMessageEventParams) MarshalJSON

func (r BetaManagedAgentsSystemMessageEventParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsSystemMessageEventParams) UnmarshalJSON

func (r *BetaManagedAgentsSystemMessageEventParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsSystemMessageEventParamsType

type BetaManagedAgentsSystemMessageEventParamsType string
const (
	BetaManagedAgentsSystemMessageEventParamsTypeSystemMessage BetaManagedAgentsSystemMessageEventParamsType = "system.message"
)

type BetaManagedAgentsSystemMessageEventType

type BetaManagedAgentsSystemMessageEventType string
const (
	BetaManagedAgentsSystemMessageEventTypeSystemMessage BetaManagedAgentsSystemMessageEventType = "system.message"
)

type BetaManagedAgentsTextBlock

type BetaManagedAgentsTextBlock struct {
	// The text content.
	Text string `json:"text" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsTextBlockType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Regular text content.

func (BetaManagedAgentsTextBlock) RawJSON

func (r BetaManagedAgentsTextBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaManagedAgentsTextBlock) ToParam

ToParam converts this BetaManagedAgentsTextBlock to a BetaManagedAgentsTextBlockParam.

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 BetaManagedAgentsTextBlockParam.Overrides()

func (*BetaManagedAgentsTextBlock) UnmarshalJSON

func (r *BetaManagedAgentsTextBlock) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTextBlockParam

type BetaManagedAgentsTextBlockParam struct {
	// The text content.
	Text string `json:"text" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsTextBlockType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Regular text content.

The properties Text, Type are required.

func (BetaManagedAgentsTextBlockParam) MarshalJSON

func (r BetaManagedAgentsTextBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsTextBlockParam) UnmarshalJSON

func (r *BetaManagedAgentsTextBlockParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTextBlockType

type BetaManagedAgentsTextBlockType string
const (
	BetaManagedAgentsTextBlockTypeText BetaManagedAgentsTextBlockType = "text"
)

type BetaManagedAgentsTextRubric

type BetaManagedAgentsTextRubric struct {
	// Rubric content. Plain text or markdown — the grader treats it as freeform text.
	Content string `json:"content" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsTextRubricType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Rubric content provided inline as text.

func (BetaManagedAgentsTextRubric) RawJSON

func (r BetaManagedAgentsTextRubric) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsTextRubric) UnmarshalJSON

func (r *BetaManagedAgentsTextRubric) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTextRubricParams

type BetaManagedAgentsTextRubricParams struct {
	// Rubric content. Plain text or markdown — the grader treats it as freeform text.
	// Maximum 262144 characters.
	Content string `json:"content" api:"required"`
	// Any of "text".
	Type BetaManagedAgentsTextRubricParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Rubric content provided inline as text.

The properties Content, Type are required.

func (BetaManagedAgentsTextRubricParams) MarshalJSON

func (r BetaManagedAgentsTextRubricParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsTextRubricParams) UnmarshalJSON

func (r *BetaManagedAgentsTextRubricParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTextRubricParamsType

type BetaManagedAgentsTextRubricParamsType string
const (
	BetaManagedAgentsTextRubricParamsTypeText BetaManagedAgentsTextRubricParamsType = "text"
)

type BetaManagedAgentsTextRubricType

type BetaManagedAgentsTextRubricType string
const (
	BetaManagedAgentsTextRubricTypeText BetaManagedAgentsTextRubricType = "text"
)

type BetaManagedAgentsTokenEndpointAuthBasicParam

type BetaManagedAgentsTokenEndpointAuthBasicParam struct {
	// OAuth client secret.
	ClientSecret string `json:"client_secret" api:"required"`
	// Any of "client_secret_basic".
	Type BetaManagedAgentsTokenEndpointAuthBasicParamType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Token endpoint uses HTTP Basic authentication with client credentials.

The properties ClientSecret, Type are required.

func (BetaManagedAgentsTokenEndpointAuthBasicParam) MarshalJSON

func (r BetaManagedAgentsTokenEndpointAuthBasicParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsTokenEndpointAuthBasicParam) UnmarshalJSON

func (r *BetaManagedAgentsTokenEndpointAuthBasicParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTokenEndpointAuthBasicParamType

type BetaManagedAgentsTokenEndpointAuthBasicParamType string
const (
	BetaManagedAgentsTokenEndpointAuthBasicParamTypeClientSecretBasic BetaManagedAgentsTokenEndpointAuthBasicParamType = "client_secret_basic"
)

type BetaManagedAgentsTokenEndpointAuthBasicResponse

type BetaManagedAgentsTokenEndpointAuthBasicResponse struct {
	// Any of "client_secret_basic".
	Type BetaManagedAgentsTokenEndpointAuthBasicResponseType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token endpoint uses HTTP Basic authentication with client credentials.

func (BetaManagedAgentsTokenEndpointAuthBasicResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsTokenEndpointAuthBasicResponse) UnmarshalJSON

type BetaManagedAgentsTokenEndpointAuthBasicResponseType

type BetaManagedAgentsTokenEndpointAuthBasicResponseType string
const (
	BetaManagedAgentsTokenEndpointAuthBasicResponseTypeClientSecretBasic BetaManagedAgentsTokenEndpointAuthBasicResponseType = "client_secret_basic"
)

type BetaManagedAgentsTokenEndpointAuthBasicUpdateParam

type BetaManagedAgentsTokenEndpointAuthBasicUpdateParam struct {
	// Any of "client_secret_basic".
	Type BetaManagedAgentsTokenEndpointAuthBasicUpdateParamType `json:"type,omitzero" api:"required"`
	// Updated OAuth client secret.
	ClientSecret param.Opt[string] `json:"client_secret,omitzero"`
	// contains filtered or unexported fields
}

Updated HTTP Basic authentication parameters for the token endpoint.

The property Type is required.

func (BetaManagedAgentsTokenEndpointAuthBasicUpdateParam) MarshalJSON

func (r BetaManagedAgentsTokenEndpointAuthBasicUpdateParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsTokenEndpointAuthBasicUpdateParam) UnmarshalJSON

type BetaManagedAgentsTokenEndpointAuthBasicUpdateParamType

type BetaManagedAgentsTokenEndpointAuthBasicUpdateParamType string
const (
	BetaManagedAgentsTokenEndpointAuthBasicUpdateParamTypeClientSecretBasic BetaManagedAgentsTokenEndpointAuthBasicUpdateParamType = "client_secret_basic"
)

type BetaManagedAgentsTokenEndpointAuthNoneParam

type BetaManagedAgentsTokenEndpointAuthNoneParam struct {
	// Any of "none".
	Type BetaManagedAgentsTokenEndpointAuthNoneParamType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Token endpoint requires no client authentication.

The property Type is required.

func (BetaManagedAgentsTokenEndpointAuthNoneParam) MarshalJSON

func (r BetaManagedAgentsTokenEndpointAuthNoneParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsTokenEndpointAuthNoneParam) UnmarshalJSON

func (r *BetaManagedAgentsTokenEndpointAuthNoneParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTokenEndpointAuthNoneParamType

type BetaManagedAgentsTokenEndpointAuthNoneParamType string
const (
	BetaManagedAgentsTokenEndpointAuthNoneParamTypeNone BetaManagedAgentsTokenEndpointAuthNoneParamType = "none"
)

type BetaManagedAgentsTokenEndpointAuthNoneResponse

type BetaManagedAgentsTokenEndpointAuthNoneResponse struct {
	// Any of "none".
	Type BetaManagedAgentsTokenEndpointAuthNoneResponseType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token endpoint requires no client authentication.

func (BetaManagedAgentsTokenEndpointAuthNoneResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsTokenEndpointAuthNoneResponse) UnmarshalJSON

type BetaManagedAgentsTokenEndpointAuthNoneResponseType

type BetaManagedAgentsTokenEndpointAuthNoneResponseType string
const (
	BetaManagedAgentsTokenEndpointAuthNoneResponseTypeNone BetaManagedAgentsTokenEndpointAuthNoneResponseType = "none"
)

type BetaManagedAgentsTokenEndpointAuthPostParam

type BetaManagedAgentsTokenEndpointAuthPostParam struct {
	// OAuth client secret.
	ClientSecret string `json:"client_secret" api:"required"`
	// Any of "client_secret_post".
	Type BetaManagedAgentsTokenEndpointAuthPostParamType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Token endpoint uses POST body authentication with client credentials.

The properties ClientSecret, Type are required.

func (BetaManagedAgentsTokenEndpointAuthPostParam) MarshalJSON

func (r BetaManagedAgentsTokenEndpointAuthPostParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsTokenEndpointAuthPostParam) UnmarshalJSON

func (r *BetaManagedAgentsTokenEndpointAuthPostParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTokenEndpointAuthPostParamType

type BetaManagedAgentsTokenEndpointAuthPostParamType string
const (
	BetaManagedAgentsTokenEndpointAuthPostParamTypeClientSecretPost BetaManagedAgentsTokenEndpointAuthPostParamType = "client_secret_post"
)

type BetaManagedAgentsTokenEndpointAuthPostResponse

type BetaManagedAgentsTokenEndpointAuthPostResponse struct {
	// Any of "client_secret_post".
	Type BetaManagedAgentsTokenEndpointAuthPostResponseType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token endpoint uses POST body authentication with client credentials.

func (BetaManagedAgentsTokenEndpointAuthPostResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsTokenEndpointAuthPostResponse) UnmarshalJSON

type BetaManagedAgentsTokenEndpointAuthPostResponseType

type BetaManagedAgentsTokenEndpointAuthPostResponseType string
const (
	BetaManagedAgentsTokenEndpointAuthPostResponseTypeClientSecretPost BetaManagedAgentsTokenEndpointAuthPostResponseType = "client_secret_post"
)

type BetaManagedAgentsTokenEndpointAuthPostUpdateParam

type BetaManagedAgentsTokenEndpointAuthPostUpdateParam struct {
	// Any of "client_secret_post".
	Type BetaManagedAgentsTokenEndpointAuthPostUpdateParamType `json:"type,omitzero" api:"required"`
	// Updated OAuth client secret.
	ClientSecret param.Opt[string] `json:"client_secret,omitzero"`
	// contains filtered or unexported fields
}

Updated POST body authentication parameters for the token endpoint.

The property Type is required.

func (BetaManagedAgentsTokenEndpointAuthPostUpdateParam) MarshalJSON

func (r BetaManagedAgentsTokenEndpointAuthPostUpdateParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsTokenEndpointAuthPostUpdateParam) UnmarshalJSON

type BetaManagedAgentsTokenEndpointAuthPostUpdateParamType

type BetaManagedAgentsTokenEndpointAuthPostUpdateParamType string
const (
	BetaManagedAgentsTokenEndpointAuthPostUpdateParamTypeClientSecretPost BetaManagedAgentsTokenEndpointAuthPostUpdateParamType = "client_secret_post"
)

type BetaManagedAgentsTrackNotFoundDeploymentPausedReasonError added in v1.71.2

type BetaManagedAgentsTrackNotFoundDeploymentPausedReasonError struct {
	// Any of "track_not_found_error".
	Type BetaManagedAgentsTrackNotFoundDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A track referenced by the deployment's agent no longer exists.

func (BetaManagedAgentsTrackNotFoundDeploymentPausedReasonError) RawJSON added in v1.71.2

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsTrackNotFoundDeploymentPausedReasonError) UnmarshalJSON added in v1.71.2

type BetaManagedAgentsTrackNotFoundDeploymentPausedReasonErrorType added in v1.71.2

type BetaManagedAgentsTrackNotFoundDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsTrackNotFoundDeploymentPausedReasonErrorTypeTrackNotFoundError BetaManagedAgentsTrackNotFoundDeploymentPausedReasonErrorType = "track_not_found_error"
)

type BetaManagedAgentsTrackNotFoundRunError added in v1.71.2

type BetaManagedAgentsTrackNotFoundRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "track_not_found_error".
	Type BetaManagedAgentsTrackNotFoundRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A track referenced by the deployment's agent no longer exists.

func (BetaManagedAgentsTrackNotFoundRunError) RawJSON added in v1.71.2

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsTrackNotFoundRunError) UnmarshalJSON added in v1.71.2

func (r *BetaManagedAgentsTrackNotFoundRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTrackNotFoundRunErrorType added in v1.71.2

type BetaManagedAgentsTrackNotFoundRunErrorType string
const (
	BetaManagedAgentsTrackNotFoundRunErrorTypeTrackNotFoundError BetaManagedAgentsTrackNotFoundRunErrorType = "track_not_found_error"
)

type BetaManagedAgentsTrackParamsUnion added in v1.71.2

type BetaManagedAgentsTrackParamsUnion struct {
	OfJuglow *BetaManagedAgentsJuglowTrackParams `json:",omitzero,inline"`
	OfCustom *BetaManagedAgentsCustomTrackParams `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 BetaManagedAgentsTrackParamsOfCustom added in v1.71.2

func BetaManagedAgentsTrackParamsOfCustom(trackID string) BetaManagedAgentsTrackParamsUnion

func BetaManagedAgentsTrackParamsOfJuglow added in v1.71.2

func BetaManagedAgentsTrackParamsOfJuglow(trackID string) BetaManagedAgentsTrackParamsUnion

func (BetaManagedAgentsTrackParamsUnion) GetTrackID added in v1.71.2

func (u BetaManagedAgentsTrackParamsUnion) GetTrackID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsTrackParamsUnion) GetType added in v1.71.2

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsTrackParamsUnion) GetVersion added in v1.71.2

func (u BetaManagedAgentsTrackParamsUnion) GetVersion() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsTrackParamsUnion) MarshalJSON added in v1.71.2

func (u BetaManagedAgentsTrackParamsUnion) MarshalJSON() ([]byte, error)

func (*BetaManagedAgentsTrackParamsUnion) UnmarshalJSON added in v1.71.2

func (u *BetaManagedAgentsTrackParamsUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTriggerContextUnion

type BetaManagedAgentsTriggerContextUnion struct {
	// This field is from variant [BetaManagedAgentsScheduleTriggerContext].
	ScheduledAt time.Time `json:"scheduled_at"`
	// Any of "schedule", "manual".
	Type string `json:"type"`
	JSON struct {
		ScheduledAt respjson.Field
		Type        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsTriggerContextUnion contains all possible properties and values from BetaManagedAgentsScheduleTriggerContext, BetaManagedAgentsManualTriggerContext.

Use the BetaManagedAgentsTriggerContextUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsTriggerContextUnion) AsAny

func (u BetaManagedAgentsTriggerContextUnion) AsAny() anyBetaManagedAgentsTriggerContext

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsTriggerContextUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsScheduleTriggerContext:
case Juglow.BetaManagedAgentsManualTriggerContext:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsTriggerContextUnion) AsManual

func (BetaManagedAgentsTriggerContextUnion) AsSchedule

func (BetaManagedAgentsTriggerContextUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsTriggerContextUnion) UnmarshalJSON

func (r *BetaManagedAgentsTriggerContextUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsTriggerType

type BetaManagedAgentsTriggerType string

What triggered a deployment run.

const (
	BetaManagedAgentsTriggerTypeSchedule BetaManagedAgentsTriggerType = "schedule"
	BetaManagedAgentsTriggerTypeManual   BetaManagedAgentsTriggerType = "manual"
)

type BetaManagedAgentsURLDocumentSource

type BetaManagedAgentsURLDocumentSource struct {
	// Any of "url".
	Type BetaManagedAgentsURLDocumentSourceType `json:"type" api:"required"`
	// URL of the document to fetch.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Document referenced by URL.

func (BetaManagedAgentsURLDocumentSource) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsURLDocumentSource) ToParam

ToParam converts this BetaManagedAgentsURLDocumentSource to a BetaManagedAgentsURLDocumentSourceParam.

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 BetaManagedAgentsURLDocumentSourceParam.Overrides()

func (*BetaManagedAgentsURLDocumentSource) UnmarshalJSON

func (r *BetaManagedAgentsURLDocumentSource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsURLDocumentSourceParam

type BetaManagedAgentsURLDocumentSourceParam struct {
	// Any of "url".
	Type BetaManagedAgentsURLDocumentSourceType `json:"type,omitzero" api:"required"`
	// URL of the document to fetch.
	URL string `json:"url" api:"required"`
	// contains filtered or unexported fields
}

Document referenced by URL.

The properties Type, URL are required.

func (BetaManagedAgentsURLDocumentSourceParam) MarshalJSON

func (r BetaManagedAgentsURLDocumentSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsURLDocumentSourceParam) UnmarshalJSON

func (r *BetaManagedAgentsURLDocumentSourceParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsURLDocumentSourceType

type BetaManagedAgentsURLDocumentSourceType string
const (
	BetaManagedAgentsURLDocumentSourceTypeURL BetaManagedAgentsURLDocumentSourceType = "url"
)

type BetaManagedAgentsURLImageSource

type BetaManagedAgentsURLImageSource struct {
	// Any of "url".
	Type BetaManagedAgentsURLImageSourceType `json:"type" api:"required"`
	// URL of the image to fetch.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Image referenced by URL.

func (BetaManagedAgentsURLImageSource) RawJSON

Returns the unmodified JSON received from the API

func (BetaManagedAgentsURLImageSource) ToParam

ToParam converts this BetaManagedAgentsURLImageSource to a BetaManagedAgentsURLImageSourceParam.

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 BetaManagedAgentsURLImageSourceParam.Overrides()

func (*BetaManagedAgentsURLImageSource) UnmarshalJSON

func (r *BetaManagedAgentsURLImageSource) UnmarshalJSON(data []byte) error

type BetaManagedAgentsURLImageSourceParam

type BetaManagedAgentsURLImageSourceParam struct {
	// Any of "url".
	Type BetaManagedAgentsURLImageSourceType `json:"type,omitzero" api:"required"`
	// URL of the image to fetch.
	URL string `json:"url" api:"required"`
	// contains filtered or unexported fields
}

Image referenced by URL.

The properties Type, URL are required.

func (BetaManagedAgentsURLImageSourceParam) MarshalJSON

func (r BetaManagedAgentsURLImageSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsURLImageSourceParam) UnmarshalJSON

func (r *BetaManagedAgentsURLImageSourceParam) UnmarshalJSON(data []byte) error

type BetaManagedAgentsURLImageSourceType

type BetaManagedAgentsURLImageSourceType string
const (
	BetaManagedAgentsURLImageSourceTypeURL BetaManagedAgentsURLImageSourceType = "url"
)

type BetaManagedAgentsURLMCPServerParams

type BetaManagedAgentsURLMCPServerParams struct {
	// Unique name for this server, referenced by mcp_toolset configurations. 1-255
	// characters.
	Name string `json:"name" api:"required"`
	// Any of "url".
	Type BetaManagedAgentsURLMCPServerParamsType `json:"type,omitzero" api:"required"`
	// Endpoint URL for the MCP server.
	URL string `json:"url" api:"required"`
	// contains filtered or unexported fields
}

URL-based MCP server connection.

The properties Name, Type, URL are required.

func (BetaManagedAgentsURLMCPServerParams) MarshalJSON

func (r BetaManagedAgentsURLMCPServerParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsURLMCPServerParams) UnmarshalJSON

func (r *BetaManagedAgentsURLMCPServerParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsURLMCPServerParamsType

type BetaManagedAgentsURLMCPServerParamsType string
const (
	BetaManagedAgentsURLMCPServerParamsTypeURL BetaManagedAgentsURLMCPServerParamsType = "url"
)

type BetaManagedAgentsUnknownDeploymentPausedReasonError

type BetaManagedAgentsUnknownDeploymentPausedReasonError struct {
	// Any of "unknown_error".
	Type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An unrecognized error auto-paused the deployment. A fallback variant; matches a run whose `error.type` is `unknown_error`.

func (BetaManagedAgentsUnknownDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUnknownDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType

type BetaManagedAgentsUnknownDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsUnknownDeploymentPausedReasonErrorTypeUnknownError BetaManagedAgentsUnknownDeploymentPausedReasonErrorType = "unknown_error"
)

type BetaManagedAgentsUnknownError

type BetaManagedAgentsUnknownError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// What the client should do next in response to this error.
	RetryStatus BetaManagedAgentsUnknownErrorRetryStatusUnion `json:"retry_status" api:"required"`
	// Any of "unknown_error".
	Type BetaManagedAgentsUnknownErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		RetryStatus respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An unknown or unexpected error occurred during session execution. A fallback variant; clients that don't recognize a new error code can match on `retry_status` and `message` alone.

func (BetaManagedAgentsUnknownError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUnknownError) UnmarshalJSON

func (r *BetaManagedAgentsUnknownError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUnknownErrorRetryStatusUnion

type BetaManagedAgentsUnknownErrorRetryStatusUnion struct {
	// Any of "retrying", "exhausted", "terminal".
	Type string `json:"type"`
	JSON struct {
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsUnknownErrorRetryStatusUnion contains all possible properties and values from BetaManagedAgentsRetryStatusRetrying, BetaManagedAgentsRetryStatusExhausted, BetaManagedAgentsRetryStatusTerminal.

Use the BetaManagedAgentsUnknownErrorRetryStatusUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsUnknownErrorRetryStatusUnion) AsAny

func (u BetaManagedAgentsUnknownErrorRetryStatusUnion) AsAny() anyBetaManagedAgentsUnknownErrorRetryStatus

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsUnknownErrorRetryStatusUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsRetryStatusRetrying:
case Juglow.BetaManagedAgentsRetryStatusExhausted:
case Juglow.BetaManagedAgentsRetryStatusTerminal:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsUnknownErrorRetryStatusUnion) AsExhausted

func (BetaManagedAgentsUnknownErrorRetryStatusUnion) AsRetrying

func (BetaManagedAgentsUnknownErrorRetryStatusUnion) AsTerminal

func (BetaManagedAgentsUnknownErrorRetryStatusUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUnknownErrorRetryStatusUnion) UnmarshalJSON

func (r *BetaManagedAgentsUnknownErrorRetryStatusUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUnknownErrorType

type BetaManagedAgentsUnknownErrorType string
const (
	BetaManagedAgentsUnknownErrorTypeUnknownError BetaManagedAgentsUnknownErrorType = "unknown_error"
)

type BetaManagedAgentsUnknownRunError

type BetaManagedAgentsUnknownRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "unknown_error".
	Type BetaManagedAgentsUnknownRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An unknown or unexpected error caused the run to fail. A fallback variant; clients that do not recognize a new error type can match on message alone.

func (BetaManagedAgentsUnknownRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUnknownRunError) UnmarshalJSON

func (r *BetaManagedAgentsUnknownRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUnknownRunErrorType

type BetaManagedAgentsUnknownRunErrorType string
const (
	BetaManagedAgentsUnknownRunErrorTypeUnknownError BetaManagedAgentsUnknownRunErrorType = "unknown_error"
)

type BetaManagedAgentsUnrestrictedCredentialNetworkingParams

type BetaManagedAgentsUnrestrictedCredentialNetworkingParams struct {
	// Any of "unrestricted".
	Type BetaManagedAgentsUnrestrictedCredentialNetworkingParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Substitute the secret on any host the session's Environment network policy permits egress to. The Environment's network policy is the only boundary on where the secret can reach.

The property Type is required.

func (BetaManagedAgentsUnrestrictedCredentialNetworkingParams) MarshalJSON

func (*BetaManagedAgentsUnrestrictedCredentialNetworkingParams) UnmarshalJSON

type BetaManagedAgentsUnrestrictedCredentialNetworkingParamsType

type BetaManagedAgentsUnrestrictedCredentialNetworkingParamsType string
const (
	BetaManagedAgentsUnrestrictedCredentialNetworkingParamsTypeUnrestricted BetaManagedAgentsUnrestrictedCredentialNetworkingParamsType = "unrestricted"
)

type BetaManagedAgentsUnrestrictedCredentialNetworkingResponse

type BetaManagedAgentsUnrestrictedCredentialNetworkingResponse struct {
	// Any of "unrestricted".
	Type BetaManagedAgentsUnrestrictedCredentialNetworkingResponseType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The secret is substituted on any host the session's Environment network policy permits egress to.

func (BetaManagedAgentsUnrestrictedCredentialNetworkingResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUnrestrictedCredentialNetworkingResponse) UnmarshalJSON

type BetaManagedAgentsUnrestrictedCredentialNetworkingResponseType

type BetaManagedAgentsUnrestrictedCredentialNetworkingResponseType string
const (
	BetaManagedAgentsUnrestrictedCredentialNetworkingResponseTypeUnrestricted BetaManagedAgentsUnrestrictedCredentialNetworkingResponseType = "unrestricted"
)

type BetaManagedAgentsUserActor

type BetaManagedAgentsUserActor struct {
	// Any of "user_actor".
	Type BetaManagedAgentsUserActorType `json:"type" api:"required"`
	// ID of the user who performed the write (a `user_...` value).
	UserID string `json:"user_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		UserID      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Attribution for a write made by a human user through the Juglow Console.

func (BetaManagedAgentsUserActor) RawJSON

func (r BetaManagedAgentsUserActor) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserActor) UnmarshalJSON

func (r *BetaManagedAgentsUserActor) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserActorType

type BetaManagedAgentsUserActorType string
const (
	BetaManagedAgentsUserActorTypeUserActor BetaManagedAgentsUserActorType = "user_actor"
)

type BetaManagedAgentsUserCustomToolResultEvent

type BetaManagedAgentsUserCustomToolResultEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// The id of the `agent.custom_tool_use` event this result corresponds to, which
	// can be found in the last `session.status_idle`
	// [event's](https://platform.haijun.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids)
	// `stop_reason.event_ids` field.
	CustomToolUseID string `json:"custom_tool_use_id" api:"required"`
	// Any of "user.custom_tool_result".
	Type BetaManagedAgentsUserCustomToolResultEventType `json:"type" api:"required"`
	// The result content returned by the tool.
	Content []BetaManagedAgentsUserCustomToolResultEventContentUnion `json:"content"`
	// Whether the tool execution resulted in an error.
	IsError bool `json:"is_error" api:"nullable"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// Routes this result to a subagent thread. Copy from the `agent.custom_tool_use`
	// event's `session_thread_id`.
	SessionThreadID string `json:"session_thread_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		CustomToolUseID respjson.Field
		Type            respjson.Field
		Content         respjson.Field
		IsError         respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event sent by the client providing the result of a custom tool execution.

func (BetaManagedAgentsUserCustomToolResultEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserCustomToolResultEvent) UnmarshalJSON

func (r *BetaManagedAgentsUserCustomToolResultEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserCustomToolResultEventContentUnion

type BetaManagedAgentsUserCustomToolResultEventContentUnion struct {
	// This field is from variant [BetaManagedAgentsTextBlock].
	Text string `json:"text"`
	// Any of "text", "image", "document", "search_result".
	Type string `json:"type"`
	// This field is a union of [BetaManagedAgentsImageBlockSourceUnion],
	// [BetaManagedAgentsDocumentBlockSourceUnion], [string]
	Source BetaManagedAgentsUserCustomToolResultEventContentUnionSource `json:"source"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Context string `json:"context"`
	Title   string `json:"title"`
	// This field is from variant [BetaManagedAgentsSearchResultBlock].
	Citations BetaManagedAgentsSearchResultCitations `json:"citations"`
	// This field is from variant [BetaManagedAgentsSearchResultBlock].
	Content []BetaManagedAgentsSearchResultContent `json:"content"`
	JSON    struct {
		Text      respjson.Field
		Type      respjson.Field
		Source    respjson.Field
		Context   respjson.Field
		Title     respjson.Field
		Citations respjson.Field
		Content   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsUserCustomToolResultEventContentUnion contains all possible properties and values from BetaManagedAgentsTextBlock, BetaManagedAgentsImageBlock, BetaManagedAgentsDocumentBlock, BetaManagedAgentsSearchResultBlock.

Use the BetaManagedAgentsUserCustomToolResultEventContentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsUserCustomToolResultEventContentUnion) AsAny

func (u BetaManagedAgentsUserCustomToolResultEventContentUnion) AsAny() anyBetaManagedAgentsUserCustomToolResultEventContent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsUserCustomToolResultEventContentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTextBlock:
case Juglow.BetaManagedAgentsImageBlock:
case Juglow.BetaManagedAgentsDocumentBlock:
case Juglow.BetaManagedAgentsSearchResultBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsUserCustomToolResultEventContentUnion) AsDocument

func (BetaManagedAgentsUserCustomToolResultEventContentUnion) AsImage

func (BetaManagedAgentsUserCustomToolResultEventContentUnion) AsSearchResult

func (BetaManagedAgentsUserCustomToolResultEventContentUnion) AsText

func (BetaManagedAgentsUserCustomToolResultEventContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserCustomToolResultEventContentUnion) UnmarshalJSON

type BetaManagedAgentsUserCustomToolResultEventContentUnionSource

type BetaManagedAgentsUserCustomToolResultEventContentUnionSource struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString  string `json:",inline"`
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	FileID    string `json:"file_id"`
	JSON      struct {
		OfString  respjson.Field
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsUserCustomToolResultEventContentUnionSource is an implicit subunion of BetaManagedAgentsUserCustomToolResultEventContentUnion. BetaManagedAgentsUserCustomToolResultEventContentUnionSource provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsUserCustomToolResultEventContentUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString]

func (*BetaManagedAgentsUserCustomToolResultEventContentUnionSource) UnmarshalJSON

type BetaManagedAgentsUserCustomToolResultEventParams

type BetaManagedAgentsUserCustomToolResultEventParams struct {
	// The id of the `agent.custom_tool_use` event this result corresponds to, which
	// can be found in the last `session.status_idle`
	// [event's](https://platform.haijun.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids)
	// `stop_reason.event_ids` field.
	CustomToolUseID string `json:"custom_tool_use_id" api:"required"`
	// Any of "user.custom_tool_result".
	Type BetaManagedAgentsUserCustomToolResultEventParamsType `json:"type,omitzero" api:"required"`
	// Whether the tool execution resulted in an error.
	IsError param.Opt[bool] `json:"is_error,omitzero"`
	// The result content returned by the tool.
	Content []BetaManagedAgentsUserCustomToolResultEventParamsContentUnion `json:"content,omitzero"`
	// contains filtered or unexported fields
}

Parameters for providing the result of a custom tool execution.

The properties CustomToolUseID, Type are required.

func (BetaManagedAgentsUserCustomToolResultEventParams) MarshalJSON

func (r BetaManagedAgentsUserCustomToolResultEventParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsUserCustomToolResultEventParams) UnmarshalJSON

type BetaManagedAgentsUserCustomToolResultEventParamsContentUnion

type BetaManagedAgentsUserCustomToolResultEventParamsContentUnion struct {
	OfText         *BetaManagedAgentsTextBlockParam         `json:",omitzero,inline"`
	OfImage        *BetaManagedAgentsImageBlockParam        `json:",omitzero,inline"`
	OfDocument     *BetaManagedAgentsDocumentBlockParam     `json:",omitzero,inline"`
	OfSearchResult *BetaManagedAgentsSearchResultBlockParam `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 (BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) GetCitations

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) GetContext

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) GetSource

func (u BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) GetSource() (res betaManagedAgentsUserCustomToolResultEventParamsContentUnionSource)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) GetText

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) GetTitle

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) MarshalJSON

func (*BetaManagedAgentsUserCustomToolResultEventParamsContentUnion) UnmarshalJSON

type BetaManagedAgentsUserCustomToolResultEventParamsType

type BetaManagedAgentsUserCustomToolResultEventParamsType string
const (
	BetaManagedAgentsUserCustomToolResultEventParamsTypeUserCustomToolResult BetaManagedAgentsUserCustomToolResultEventParamsType = "user.custom_tool_result"
)

type BetaManagedAgentsUserCustomToolResultEventType

type BetaManagedAgentsUserCustomToolResultEventType string
const (
	BetaManagedAgentsUserCustomToolResultEventTypeUserCustomToolResult BetaManagedAgentsUserCustomToolResultEventType = "user.custom_tool_result"
)

type BetaManagedAgentsUserDefineOutcomeEvent

type BetaManagedAgentsUserDefineOutcomeEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// What the agent should produce. Copied from the input event.
	Description string `json:"description" api:"required"`
	// Evaluate-then-revise cycles before giving up. Default 3, max 20.
	MaxIterations int64 `json:"max_iterations" api:"required"`
	// Server-generated `outc_` ID for this outcome. Referenced by
	// `span.outcome_evaluation_*` events and the session's `outcome_evaluations` list.
	OutcomeID string `json:"outcome_id" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"required" format:"date-time"`
	// Rubric for grading the quality of an outcome.
	Rubric BetaManagedAgentsUserDefineOutcomeEventRubricUnion `json:"rubric" api:"required"`
	// Any of "user.define_outcome".
	Type BetaManagedAgentsUserDefineOutcomeEventType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Description   respjson.Field
		MaxIterations respjson.Field
		OutcomeID     respjson.Field
		ProcessedAt   respjson.Field
		Rubric        respjson.Field
		Type          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Echo of a `user.define_outcome` input event. Carries the server-generated `outcome_id` that subsequent `span.outcome_evaluation_*` events reference.

func (BetaManagedAgentsUserDefineOutcomeEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserDefineOutcomeEvent) UnmarshalJSON

func (r *BetaManagedAgentsUserDefineOutcomeEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserDefineOutcomeEventParams

type BetaManagedAgentsUserDefineOutcomeEventParams struct {
	// What the agent should produce. This is the task specification.
	Description string `json:"description" api:"required"`
	// Rubric for grading the quality of an outcome.
	Rubric BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion `json:"rubric,omitzero" api:"required"`
	// Any of "user.define_outcome".
	Type BetaManagedAgentsUserDefineOutcomeEventParamsType `json:"type,omitzero" api:"required"`
	// Eval→revision cycles before giving up. Default 3, max 20.
	MaxIterations param.Opt[int64] `json:"max_iterations,omitzero"`
	// contains filtered or unexported fields
}

Parameters for defining an outcome the agent should work toward. The agent begins work on receipt.

The properties Description, Rubric, Type are required.

func (BetaManagedAgentsUserDefineOutcomeEventParams) MarshalJSON

func (r BetaManagedAgentsUserDefineOutcomeEventParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsUserDefineOutcomeEventParams) UnmarshalJSON

func (r *BetaManagedAgentsUserDefineOutcomeEventParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion

type BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion struct {
	OfFile *BetaManagedAgentsFileRubricParams `json:",omitzero,inline"`
	OfText *BetaManagedAgentsTextRubricParams `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 (BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion) GetFileID

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion) MarshalJSON

func (*BetaManagedAgentsUserDefineOutcomeEventParamsRubricUnion) UnmarshalJSON

type BetaManagedAgentsUserDefineOutcomeEventParamsType

type BetaManagedAgentsUserDefineOutcomeEventParamsType string
const (
	BetaManagedAgentsUserDefineOutcomeEventParamsTypeUserDefineOutcome BetaManagedAgentsUserDefineOutcomeEventParamsType = "user.define_outcome"
)

type BetaManagedAgentsUserDefineOutcomeEventRubricUnion

type BetaManagedAgentsUserDefineOutcomeEventRubricUnion struct {
	// This field is from variant [BetaManagedAgentsFileRubric].
	FileID string `json:"file_id"`
	// Any of "file", "text".
	Type string `json:"type"`
	// This field is from variant [BetaManagedAgentsTextRubric].
	Content string `json:"content"`
	JSON    struct {
		FileID  respjson.Field
		Type    respjson.Field
		Content respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsUserDefineOutcomeEventRubricUnion contains all possible properties and values from BetaManagedAgentsFileRubric, BetaManagedAgentsTextRubric.

Use the BetaManagedAgentsUserDefineOutcomeEventRubricUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsUserDefineOutcomeEventRubricUnion) AsAny

func (u BetaManagedAgentsUserDefineOutcomeEventRubricUnion) AsAny() anyBetaManagedAgentsUserDefineOutcomeEventRubric

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsUserDefineOutcomeEventRubricUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsFileRubric:
case Juglow.BetaManagedAgentsTextRubric:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsUserDefineOutcomeEventRubricUnion) AsFile

func (BetaManagedAgentsUserDefineOutcomeEventRubricUnion) AsText

func (BetaManagedAgentsUserDefineOutcomeEventRubricUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserDefineOutcomeEventRubricUnion) UnmarshalJSON

type BetaManagedAgentsUserDefineOutcomeEventType

type BetaManagedAgentsUserDefineOutcomeEventType string
const (
	BetaManagedAgentsUserDefineOutcomeEventTypeUserDefineOutcome BetaManagedAgentsUserDefineOutcomeEventType = "user.define_outcome"
)

type BetaManagedAgentsUserInterruptEvent

type BetaManagedAgentsUserInterruptEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Any of "user.interrupt".
	Type BetaManagedAgentsUserInterruptEventType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// If absent, interrupts every non-archived thread in a multiagent session (or the
	// primary alone in a single-agent session). If present, interrupts only the named
	// thread.
	SessionThreadID string `json:"session_thread_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Type            respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An interrupt event that pauses agent execution and returns control to the user.

func (BetaManagedAgentsUserInterruptEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserInterruptEvent) UnmarshalJSON

func (r *BetaManagedAgentsUserInterruptEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserInterruptEventParams

type BetaManagedAgentsUserInterruptEventParams struct {
	// Any of "user.interrupt".
	Type BetaManagedAgentsUserInterruptEventParamsType `json:"type,omitzero" api:"required"`
	// If absent, interrupts every non-archived thread in a multiagent session (or the
	// primary alone in a single-agent session). If present, interrupts only the named
	// thread.
	SessionThreadID param.Opt[string] `json:"session_thread_id,omitzero"`
	// contains filtered or unexported fields
}

Parameters for sending an interrupt to pause the agent.

The property Type is required.

func (BetaManagedAgentsUserInterruptEventParams) MarshalJSON

func (r BetaManagedAgentsUserInterruptEventParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsUserInterruptEventParams) UnmarshalJSON

func (r *BetaManagedAgentsUserInterruptEventParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserInterruptEventParamsType

type BetaManagedAgentsUserInterruptEventParamsType string
const (
	BetaManagedAgentsUserInterruptEventParamsTypeUserInterrupt BetaManagedAgentsUserInterruptEventParamsType = "user.interrupt"
)

type BetaManagedAgentsUserInterruptEventType

type BetaManagedAgentsUserInterruptEventType string
const (
	BetaManagedAgentsUserInterruptEventTypeUserInterrupt BetaManagedAgentsUserInterruptEventType = "user.interrupt"
)

type BetaManagedAgentsUserMessageEvent

type BetaManagedAgentsUserMessageEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// Array of content blocks comprising the user message.
	Content []BetaManagedAgentsUserMessageEventContentUnion `json:"content" api:"required"`
	// Any of "user.message".
	Type BetaManagedAgentsUserMessageEventType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Content     respjson.Field
		Type        respjson.Field
		ProcessedAt respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A user message event in the session conversation.

func (BetaManagedAgentsUserMessageEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserMessageEvent) UnmarshalJSON

func (r *BetaManagedAgentsUserMessageEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserMessageEventContentUnion

type BetaManagedAgentsUserMessageEventContentUnion struct {
	// This field is from variant [BetaManagedAgentsTextBlock].
	Text string `json:"text"`
	// Any of "text", "image", "document", "redacted".
	Type string `json:"type"`
	// This field is a union of [BetaManagedAgentsImageBlockSourceUnion],
	// [BetaManagedAgentsDocumentBlockSourceUnion]
	Source BetaManagedAgentsUserMessageEventContentUnionSource `json:"source"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Context string `json:"context"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Title string `json:"title"`
	JSON  struct {
		Text    respjson.Field
		Type    respjson.Field
		Source  respjson.Field
		Context respjson.Field
		Title   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsUserMessageEventContentUnion contains all possible properties and values from BetaManagedAgentsTextBlock, BetaManagedAgentsImageBlock, BetaManagedAgentsDocumentBlock, BetaManagedAgentsRedactedBlock.

Use the BetaManagedAgentsUserMessageEventContentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsUserMessageEventContentUnion) AsAny

func (u BetaManagedAgentsUserMessageEventContentUnion) AsAny() anyBetaManagedAgentsUserMessageEventContent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsUserMessageEventContentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTextBlock:
case Juglow.BetaManagedAgentsImageBlock:
case Juglow.BetaManagedAgentsDocumentBlock:
case Juglow.BetaManagedAgentsRedactedBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsUserMessageEventContentUnion) AsDocument

func (BetaManagedAgentsUserMessageEventContentUnion) AsImage

func (BetaManagedAgentsUserMessageEventContentUnion) AsRedacted

func (BetaManagedAgentsUserMessageEventContentUnion) AsText

func (BetaManagedAgentsUserMessageEventContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserMessageEventContentUnion) UnmarshalJSON

func (r *BetaManagedAgentsUserMessageEventContentUnion) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserMessageEventContentUnionSource

type BetaManagedAgentsUserMessageEventContentUnionSource struct {
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	FileID    string `json:"file_id"`
	JSON      struct {
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsUserMessageEventContentUnionSource is an implicit subunion of BetaManagedAgentsUserMessageEventContentUnion. BetaManagedAgentsUserMessageEventContentUnionSource provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsUserMessageEventContentUnion.

func (*BetaManagedAgentsUserMessageEventContentUnionSource) UnmarshalJSON

type BetaManagedAgentsUserMessageEventParams

type BetaManagedAgentsUserMessageEventParams struct {
	// Array of content blocks for the user message.
	Content []BetaManagedAgentsUserMessageEventParamsContentUnion `json:"content,omitzero" api:"required"`
	// Any of "user.message".
	Type BetaManagedAgentsUserMessageEventParamsType `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Parameters for sending a user message to the session.

The properties Content, Type are required.

func (BetaManagedAgentsUserMessageEventParams) MarshalJSON

func (r BetaManagedAgentsUserMessageEventParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsUserMessageEventParams) UnmarshalJSON

func (r *BetaManagedAgentsUserMessageEventParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserMessageEventParamsContentUnion

type BetaManagedAgentsUserMessageEventParamsContentUnion struct {
	OfText     *BetaManagedAgentsTextBlockParam     `json:",omitzero,inline"`
	OfImage    *BetaManagedAgentsImageBlockParam    `json:",omitzero,inline"`
	OfDocument *BetaManagedAgentsDocumentBlockParam `json:",omitzero,inline"`
	OfRedacted *BetaManagedAgentsRedactedBlockParam `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 (BetaManagedAgentsUserMessageEventParamsContentUnion) GetContext

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserMessageEventParamsContentUnion) GetSource

func (u BetaManagedAgentsUserMessageEventParamsContentUnion) GetSource() (res betaManagedAgentsUserMessageEventParamsContentUnionSource)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaManagedAgentsUserMessageEventParamsContentUnion) GetText

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserMessageEventParamsContentUnion) GetTitle

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserMessageEventParamsContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserMessageEventParamsContentUnion) MarshalJSON

func (*BetaManagedAgentsUserMessageEventParamsContentUnion) UnmarshalJSON

type BetaManagedAgentsUserMessageEventParamsType

type BetaManagedAgentsUserMessageEventParamsType string
const (
	BetaManagedAgentsUserMessageEventParamsTypeUserMessage BetaManagedAgentsUserMessageEventParamsType = "user.message"
)

type BetaManagedAgentsUserMessageEventType

type BetaManagedAgentsUserMessageEventType string
const (
	BetaManagedAgentsUserMessageEventTypeUserMessage BetaManagedAgentsUserMessageEventType = "user.message"
)

type BetaManagedAgentsUserToolConfirmationEvent

type BetaManagedAgentsUserToolConfirmationEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// UserToolConfirmationResult enum
	//
	// Any of "allow", "deny".
	Result BetaManagedAgentsUserToolConfirmationEventResult `json:"result" api:"required"`
	// The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result
	// corresponds to, which can be found in the last `session.status_idle`
	// [event's](https://platform.haijun.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids)
	// `stop_reason.event_ids` field.
	ToolUseID string `json:"tool_use_id" api:"required"`
	// Any of "user.tool_confirmation".
	Type BetaManagedAgentsUserToolConfirmationEventType `json:"type" api:"required"`
	// Optional message providing context for a 'deny' decision. Only allowed when
	// result is 'deny'.
	DenyMessage string `json:"deny_message" api:"nullable"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// When set, the confirmation routes to this subagent's thread rather than the
	// primary. Echo this from the `session_thread_id` on the `agent.tool_use` or
	// `agent.mcp_tool_use` event that prompted the approval.
	SessionThreadID string `json:"session_thread_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Result          respjson.Field
		ToolUseID       respjson.Field
		Type            respjson.Field
		DenyMessage     respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A tool confirmation event that approves or denies a pending tool execution.

func (BetaManagedAgentsUserToolConfirmationEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserToolConfirmationEvent) UnmarshalJSON

func (r *BetaManagedAgentsUserToolConfirmationEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserToolConfirmationEventParams

type BetaManagedAgentsUserToolConfirmationEventParams struct {
	// UserToolConfirmationResult enum
	//
	// Any of "allow", "deny".
	Result BetaManagedAgentsUserToolConfirmationEventParamsResult `json:"result,omitzero" api:"required"`
	// The id of the `agent.tool_use` or `agent.mcp_tool_use` event this result
	// corresponds to, which can be found in the last `session.status_idle`
	// [event's](https://platform.haijun.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids)
	// `stop_reason.event_ids` field.
	ToolUseID string `json:"tool_use_id" api:"required"`
	// Any of "user.tool_confirmation".
	Type BetaManagedAgentsUserToolConfirmationEventParamsType `json:"type,omitzero" api:"required"`
	// Optional message providing context for a 'deny' decision. Only allowed when
	// result is 'deny'.
	DenyMessage param.Opt[string] `json:"deny_message,omitzero"`
	// contains filtered or unexported fields
}

Parameters for confirming or denying a tool execution request.

The properties Result, ToolUseID, Type are required.

func (BetaManagedAgentsUserToolConfirmationEventParams) MarshalJSON

func (r BetaManagedAgentsUserToolConfirmationEventParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsUserToolConfirmationEventParams) UnmarshalJSON

type BetaManagedAgentsUserToolConfirmationEventParamsResult

type BetaManagedAgentsUserToolConfirmationEventParamsResult string

UserToolConfirmationResult enum

const (
	BetaManagedAgentsUserToolConfirmationEventParamsResultAllow BetaManagedAgentsUserToolConfirmationEventParamsResult = "allow"
	BetaManagedAgentsUserToolConfirmationEventParamsResultDeny  BetaManagedAgentsUserToolConfirmationEventParamsResult = "deny"
)

type BetaManagedAgentsUserToolConfirmationEventParamsType

type BetaManagedAgentsUserToolConfirmationEventParamsType string
const (
	BetaManagedAgentsUserToolConfirmationEventParamsTypeUserToolConfirmation BetaManagedAgentsUserToolConfirmationEventParamsType = "user.tool_confirmation"
)

type BetaManagedAgentsUserToolConfirmationEventResult

type BetaManagedAgentsUserToolConfirmationEventResult string

UserToolConfirmationResult enum

const (
	BetaManagedAgentsUserToolConfirmationEventResultAllow BetaManagedAgentsUserToolConfirmationEventResult = "allow"
	BetaManagedAgentsUserToolConfirmationEventResultDeny  BetaManagedAgentsUserToolConfirmationEventResult = "deny"
)

type BetaManagedAgentsUserToolConfirmationEventType

type BetaManagedAgentsUserToolConfirmationEventType string
const (
	BetaManagedAgentsUserToolConfirmationEventTypeUserToolConfirmation BetaManagedAgentsUserToolConfirmationEventType = "user.tool_confirmation"
)

type BetaManagedAgentsUserToolResultEvent

type BetaManagedAgentsUserToolResultEvent struct {
	// Unique identifier for this event.
	ID string `json:"id" api:"required"`
	// The id of the `agent.tool_use` event this result corresponds to, which can be
	// found in the last `session.status_idle`
	// [event's](https://platform.haijun.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids)
	// `stop_reason.event_ids` field.
	ToolUseID string `json:"tool_use_id" api:"required"`
	// Any of "user.tool_result".
	Type BetaManagedAgentsUserToolResultEventType `json:"type" api:"required"`
	// The result content returned by the tool.
	Content []BetaManagedAgentsUserToolResultEventContentUnion `json:"content"`
	// Whether the tool execution resulted in an error.
	IsError bool `json:"is_error" api:"nullable"`
	// A timestamp in RFC 3339 format
	ProcessedAt time.Time `json:"processed_at" api:"nullable" format:"date-time"`
	// Routes this result to a subagent thread. Copy from the `agent.tool_use` event's
	// `session_thread_id`.
	SessionThreadID string `json:"session_thread_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ToolUseID       respjson.Field
		Type            respjson.Field
		Content         respjson.Field
		IsError         respjson.Field
		ProcessedAt     respjson.Field
		SessionThreadID respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Event sent by the client providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.

func (BetaManagedAgentsUserToolResultEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserToolResultEvent) UnmarshalJSON

func (r *BetaManagedAgentsUserToolResultEvent) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserToolResultEventContentUnion

type BetaManagedAgentsUserToolResultEventContentUnion struct {
	// This field is from variant [BetaManagedAgentsTextBlock].
	Text string `json:"text"`
	// Any of "text", "image", "document", "search_result".
	Type string `json:"type"`
	// This field is a union of [BetaManagedAgentsImageBlockSourceUnion],
	// [BetaManagedAgentsDocumentBlockSourceUnion], [string]
	Source BetaManagedAgentsUserToolResultEventContentUnionSource `json:"source"`
	// This field is from variant [BetaManagedAgentsDocumentBlock].
	Context string `json:"context"`
	Title   string `json:"title"`
	// This field is from variant [BetaManagedAgentsSearchResultBlock].
	Citations BetaManagedAgentsSearchResultCitations `json:"citations"`
	// This field is from variant [BetaManagedAgentsSearchResultBlock].
	Content []BetaManagedAgentsSearchResultContent `json:"content"`
	JSON    struct {
		Text      respjson.Field
		Type      respjson.Field
		Source    respjson.Field
		Context   respjson.Field
		Title     respjson.Field
		Citations respjson.Field
		Content   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsUserToolResultEventContentUnion contains all possible properties and values from BetaManagedAgentsTextBlock, BetaManagedAgentsImageBlock, BetaManagedAgentsDocumentBlock, BetaManagedAgentsSearchResultBlock.

Use the BetaManagedAgentsUserToolResultEventContentUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaManagedAgentsUserToolResultEventContentUnion) AsAny

func (u BetaManagedAgentsUserToolResultEventContentUnion) AsAny() anyBetaManagedAgentsUserToolResultEventContent

Use the following switch statement to find the correct variant

switch variant := BetaManagedAgentsUserToolResultEventContentUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsTextBlock:
case Juglow.BetaManagedAgentsImageBlock:
case Juglow.BetaManagedAgentsDocumentBlock:
case Juglow.BetaManagedAgentsSearchResultBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaManagedAgentsUserToolResultEventContentUnion) AsDocument

func (BetaManagedAgentsUserToolResultEventContentUnion) AsImage

func (BetaManagedAgentsUserToolResultEventContentUnion) AsSearchResult

func (BetaManagedAgentsUserToolResultEventContentUnion) AsText

func (BetaManagedAgentsUserToolResultEventContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsUserToolResultEventContentUnion) UnmarshalJSON

type BetaManagedAgentsUserToolResultEventContentUnionSource

type BetaManagedAgentsUserToolResultEventContentUnionSource struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString  string `json:",inline"`
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	Type      string `json:"type"`
	URL       string `json:"url"`
	FileID    string `json:"file_id"`
	JSON      struct {
		OfString  respjson.Field
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		URL       respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaManagedAgentsUserToolResultEventContentUnionSource is an implicit subunion of BetaManagedAgentsUserToolResultEventContentUnion. BetaManagedAgentsUserToolResultEventContentUnionSource provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaManagedAgentsUserToolResultEventContentUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString]

func (*BetaManagedAgentsUserToolResultEventContentUnionSource) UnmarshalJSON

type BetaManagedAgentsUserToolResultEventParams

type BetaManagedAgentsUserToolResultEventParams struct {
	// The id of the `agent.tool_use` event this result corresponds to, which can be
	// found in the last `session.status_idle`
	// [event's](https://platform.haijun.com/docs/en/api/beta/sessions/events/list#beta_managed_agents_session_requires_action.event_ids)
	// `stop_reason.event_ids` field.
	ToolUseID string `json:"tool_use_id" api:"required"`
	// Any of "user.tool_result".
	Type BetaManagedAgentsUserToolResultEventParamsType `json:"type,omitzero" api:"required"`
	// Whether the tool execution resulted in an error.
	IsError param.Opt[bool] `json:"is_error,omitzero"`
	// The result content returned by the tool.
	Content []BetaManagedAgentsUserToolResultEventParamsContentUnion `json:"content,omitzero"`
	// contains filtered or unexported fields
}

Parameters for providing the result of an agent-toolset tool execution. Only valid on `self_hosted` environments, where sandbox-routed tools are executed by the client rather than the server.

The properties ToolUseID, Type are required.

func (BetaManagedAgentsUserToolResultEventParams) MarshalJSON

func (r BetaManagedAgentsUserToolResultEventParams) MarshalJSON() (data []byte, err error)

func (*BetaManagedAgentsUserToolResultEventParams) UnmarshalJSON

func (r *BetaManagedAgentsUserToolResultEventParams) UnmarshalJSON(data []byte) error

type BetaManagedAgentsUserToolResultEventParamsContentUnion

type BetaManagedAgentsUserToolResultEventParamsContentUnion struct {
	OfText         *BetaManagedAgentsTextBlockParam         `json:",omitzero,inline"`
	OfImage        *BetaManagedAgentsImageBlockParam        `json:",omitzero,inline"`
	OfDocument     *BetaManagedAgentsDocumentBlockParam     `json:",omitzero,inline"`
	OfSearchResult *BetaManagedAgentsSearchResultBlockParam `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 (BetaManagedAgentsUserToolResultEventParamsContentUnion) GetCitations

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserToolResultEventParamsContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserToolResultEventParamsContentUnion) GetContext

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserToolResultEventParamsContentUnion) GetSource

func (u BetaManagedAgentsUserToolResultEventParamsContentUnion) GetSource() (res betaManagedAgentsUserToolResultEventParamsContentUnionSource)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaManagedAgentsUserToolResultEventParamsContentUnion) GetText

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserToolResultEventParamsContentUnion) GetTitle

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserToolResultEventParamsContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaManagedAgentsUserToolResultEventParamsContentUnion) MarshalJSON

func (*BetaManagedAgentsUserToolResultEventParamsContentUnion) UnmarshalJSON

type BetaManagedAgentsUserToolResultEventParamsType

type BetaManagedAgentsUserToolResultEventParamsType string
const (
	BetaManagedAgentsUserToolResultEventParamsTypeUserToolResult BetaManagedAgentsUserToolResultEventParamsType = "user.tool_result"
)

type BetaManagedAgentsUserToolResultEventType

type BetaManagedAgentsUserToolResultEventType string
const (
	BetaManagedAgentsUserToolResultEventTypeUserToolResult BetaManagedAgentsUserToolResultEventType = "user.tool_result"
)

type BetaManagedAgentsVault

type BetaManagedAgentsVault struct {
	// Unique identifier for the vault.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable name for the vault.
	DisplayName string `json:"display_name" api:"required"`
	// Arbitrary key-value metadata attached to the vault.
	Metadata map[string]string `json:"metadata" api:"required"`
	// Any of "vault".
	Type BetaManagedAgentsVaultType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ArchivedAt  respjson.Field
		CreatedAt   respjson.Field
		DisplayName respjson.Field
		Metadata    respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A vault that stores credentials for use by agents during sessions.

func (BetaManagedAgentsVault) RawJSON

func (r BetaManagedAgentsVault) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsVault) UnmarshalJSON

func (r *BetaManagedAgentsVault) UnmarshalJSON(data []byte) error

type BetaManagedAgentsVaultArchivedDeploymentPausedReasonError

type BetaManagedAgentsVaultArchivedDeploymentPausedReasonError struct {
	// Any of "vault_archived_error".
	Type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A vault referenced by the deployment is archived.

func (BetaManagedAgentsVaultArchivedDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsVaultArchivedDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType

type BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorTypeVaultArchivedError BetaManagedAgentsVaultArchivedDeploymentPausedReasonErrorType = "vault_archived_error"
)

type BetaManagedAgentsVaultArchivedRunError

type BetaManagedAgentsVaultArchivedRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "vault_archived_error".
	Type BetaManagedAgentsVaultArchivedRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A vault referenced by the deployment is archived.

func (BetaManagedAgentsVaultArchivedRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsVaultArchivedRunError) UnmarshalJSON

func (r *BetaManagedAgentsVaultArchivedRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsVaultArchivedRunErrorType

type BetaManagedAgentsVaultArchivedRunErrorType string
const (
	BetaManagedAgentsVaultArchivedRunErrorTypeVaultArchivedError BetaManagedAgentsVaultArchivedRunErrorType = "vault_archived_error"
)

type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError

type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError struct {
	// Any of "vault_not_found_error".
	Type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A vault referenced by the deployment no longer exists.

func (BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType

type BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorTypeVaultNotFoundError BetaManagedAgentsVaultNotFoundDeploymentPausedReasonErrorType = "vault_not_found_error"
)

type BetaManagedAgentsVaultNotFoundRunError

type BetaManagedAgentsVaultNotFoundRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "vault_not_found_error".
	Type BetaManagedAgentsVaultNotFoundRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A vault referenced by the deployment no longer exists.

func (BetaManagedAgentsVaultNotFoundRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsVaultNotFoundRunError) UnmarshalJSON

func (r *BetaManagedAgentsVaultNotFoundRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsVaultNotFoundRunErrorType

type BetaManagedAgentsVaultNotFoundRunErrorType string
const (
	BetaManagedAgentsVaultNotFoundRunErrorTypeVaultNotFoundError BetaManagedAgentsVaultNotFoundRunErrorType = "vault_not_found_error"
)

type BetaManagedAgentsVaultType

type BetaManagedAgentsVaultType string
const (
	BetaManagedAgentsVaultTypeVault BetaManagedAgentsVaultType = "vault"
)

type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError

type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError struct {
	// Any of "workspace_archived_error".
	Type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's workspace was archived.

func (BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError) UnmarshalJSON

type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType

type BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType string
const (
	BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorTypeWorkspaceArchivedError BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonErrorType = "workspace_archived_error"
)

type BetaManagedAgentsWorkspaceArchivedRunError

type BetaManagedAgentsWorkspaceArchivedRunError struct {
	// Human-readable error description.
	Message string `json:"message" api:"required"`
	// Any of "workspace_archived_error".
	Type BetaManagedAgentsWorkspaceArchivedRunErrorType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The deployment's workspace was archived.

func (BetaManagedAgentsWorkspaceArchivedRunError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaManagedAgentsWorkspaceArchivedRunError) UnmarshalJSON

func (r *BetaManagedAgentsWorkspaceArchivedRunError) UnmarshalJSON(data []byte) error

type BetaManagedAgentsWorkspaceArchivedRunErrorType

type BetaManagedAgentsWorkspaceArchivedRunErrorType string
const (
	BetaManagedAgentsWorkspaceArchivedRunErrorTypeWorkspaceArchivedError BetaManagedAgentsWorkspaceArchivedRunErrorType = "workspace_archived_error"
)

type BetaMemoryStoreArchiveParams

type BetaMemoryStoreArchiveParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaMemoryStoreDeleteParams

type BetaMemoryStoreDeleteParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaMemoryStoreGetParams

type BetaMemoryStoreGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaMemoryStoreListParams

type BetaMemoryStoreListParams struct {
	// Return only stores whose `created_at` is at or after this time (inclusive). Sent
	// on the wire as `created_at[gte]`.
	CreatedAtGte param.Opt[time.Time] `query:"created_at[gte],omitzero" format:"date-time" json:"-"`
	// Return only stores whose `created_at` is at or before this time (inclusive).
	// Sent on the wire as `created_at[lte]`.
	CreatedAtLte param.Opt[time.Time] `query:"created_at[lte],omitzero" format:"date-time" json:"-"`
	// When `true`, archived stores are included in the results. Defaults to `false`
	// (archived stores are excluded).
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Maximum number of stores to return per page. Must be between 1 and 100. Defaults
	// to 20 when omitted.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a
	// previous response to fetch the next page; omit for the first page.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreListParams) URLQuery

func (r BetaMemoryStoreListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaMemoryStoreListParams's query parameters as `url.Values`.

type BetaMemoryStoreMemoryDeleteParams

type BetaMemoryStoreMemoryDeleteParams struct {
	MemoryStoreID string `path:"memory_store_id" api:"required" json:"-"`
	// Query parameter for expected_content_sha256
	ExpectedContentSha256 param.Opt[string] `query:"expected_content_sha256,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreMemoryDeleteParams) URLQuery

func (r BetaMemoryStoreMemoryDeleteParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaMemoryStoreMemoryDeleteParams's query parameters as `url.Values`.

type BetaMemoryStoreMemoryGetParams

type BetaMemoryStoreMemoryGetParams struct {
	MemoryStoreID string `path:"memory_store_id" api:"required" json:"-"`
	// Query parameter for view
	//
	// Any of "basic", "full".
	View BetaManagedAgentsMemoryView `query:"view,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreMemoryGetParams) URLQuery

func (r BetaMemoryStoreMemoryGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaMemoryStoreMemoryGetParams's query parameters as `url.Values`.

type BetaMemoryStoreMemoryListParams

type BetaMemoryStoreMemoryListParams struct {
	// `0` (or omitted) returns all descendants below `path_prefix` (recursive). `1`
	// returns immediate children only; deeper entries roll up as `memory_prefix`
	// items. `depth=1` behaves like `ls`; omitting `depth` behaves like `find`.
	Depth param.Opt[int64] `query:"depth,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 when omitted. Capped at 20 when `view=full`. Both `memory` and
	// `memory_prefix` items count toward the limit.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor (a `page_...` value). Pass the `next_page` value from a
	// previous response to fetch the next page; omit for the first page.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional path prefix filter. Must end with `/` (segment-aligned), e.g.,
	// `/notes/`. This value appears in request URLs. Do not include secrets or
	// personally identifiable information.
	PathPrefix param.Opt[string] `query:"path_prefix,omitzero" json:"-"`
	// Which projection of each `memory` to return. Defaults to `basic` (content
	// omitted). `full` populates `content` on each item and caps `limit` at 20; use
	// this as the bulk-read path for export and sync.
	//
	// Any of "basic", "full".
	View BetaManagedAgentsMemoryView `query:"view,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreMemoryListParams) URLQuery

func (r BetaMemoryStoreMemoryListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaMemoryStoreMemoryListParams's query parameters as `url.Values`.

type BetaMemoryStoreMemoryNewParams

type BetaMemoryStoreMemoryNewParams struct {
	// UTF-8 text content for the new memory. Maximum 100 kB (102,400 bytes). Required;
	// pass `""` explicitly to create an empty memory.
	Content param.Opt[string] `json:"content,omitzero" api:"required"`
	// Hierarchical path for the new memory, e.g. `/projects/foo/notes.md`. Must start
	// with `/`, contain at least one non-empty segment, and be at most 1,024 bytes.
	// Must not contain empty segments, `.` or `..` segments, control or format
	// characters, and must be NFC-normalized. Paths are case-sensitive.
	Path string `json:"path" api:"required"`
	// Query parameter for view
	//
	// Any of "basic", "full".
	View BetaManagedAgentsMemoryView `query:"view,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreMemoryNewParams) MarshalJSON

func (r BetaMemoryStoreMemoryNewParams) MarshalJSON() (data []byte, err error)

func (BetaMemoryStoreMemoryNewParams) URLQuery

func (r BetaMemoryStoreMemoryNewParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaMemoryStoreMemoryNewParams's query parameters as `url.Values`.

func (*BetaMemoryStoreMemoryNewParams) UnmarshalJSON

func (r *BetaMemoryStoreMemoryNewParams) UnmarshalJSON(data []byte) error

type BetaMemoryStoreMemoryService

type BetaMemoryStoreMemoryService struct {
	Options []option.RequestOption
}

BetaMemoryStoreMemoryService contains methods and other services that help with interacting with the Juglow 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 NewBetaMemoryStoreMemoryService method instead.

func NewBetaMemoryStoreMemoryService

func NewBetaMemoryStoreMemoryService(opts ...option.RequestOption) (r BetaMemoryStoreMemoryService)

NewBetaMemoryStoreMemoryService 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 (*BetaMemoryStoreMemoryService) Delete

Delete a memory

func (*BetaMemoryStoreMemoryService) Get

Retrieve a memory

func (*BetaMemoryStoreMemoryService) List

List memories

func (*BetaMemoryStoreMemoryService) ListAutoPaging

List memories

func (*BetaMemoryStoreMemoryService) New

Create a memory

func (*BetaMemoryStoreMemoryService) Update

Update a memory

type BetaMemoryStoreMemoryUpdateParams

type BetaMemoryStoreMemoryUpdateParams struct {
	MemoryStoreID string `path:"memory_store_id" api:"required" json:"-"`
	// New UTF-8 text content for the memory. Maximum 100 kB (102,400 bytes). Omit to
	// leave the content unchanged (e.g., for a rename-only update).
	Content param.Opt[string] `json:"content,omitzero"`
	// New path for the memory (a rename). Must start with `/`, contain at least one
	// non-empty segment, and be at most 1,024 bytes. Must not contain empty segments,
	// `.` or `..` segments, control or format characters, and must be NFC-normalized.
	// Paths are case-sensitive. The memory's `id` is preserved across renames. Omit to
	// leave the path unchanged.
	Path param.Opt[string] `json:"path,omitzero"`
	// Query parameter for view
	//
	// Any of "basic", "full".
	View BetaManagedAgentsMemoryView `query:"view,omitzero" json:"-"`
	// Optimistic-concurrency precondition: the update applies only if the memory's
	// stored `content_sha256` equals the supplied value. On mismatch, the request
	// returns `memory_precondition_failed_error` (HTTP 409); re-read the memory and
	// retry against the fresh state. If the precondition fails but the stored state
	// already exactly matches the requested `content` and `path`, the server returns
	// 200 instead of 409.
	Precondition BetaManagedAgentsPreconditionParam `json:"precondition,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreMemoryUpdateParams) MarshalJSON

func (r BetaMemoryStoreMemoryUpdateParams) MarshalJSON() (data []byte, err error)

func (BetaMemoryStoreMemoryUpdateParams) URLQuery

func (r BetaMemoryStoreMemoryUpdateParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaMemoryStoreMemoryUpdateParams's query parameters as `url.Values`.

func (*BetaMemoryStoreMemoryUpdateParams) UnmarshalJSON

func (r *BetaMemoryStoreMemoryUpdateParams) UnmarshalJSON(data []byte) error

type BetaMemoryStoreMemoryVersionGetParams

type BetaMemoryStoreMemoryVersionGetParams struct {
	MemoryStoreID string `path:"memory_store_id" api:"required" json:"-"`
	// Query parameter for view
	//
	// Any of "basic", "full".
	View BetaManagedAgentsMemoryView `query:"view,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreMemoryVersionGetParams) URLQuery

func (r BetaMemoryStoreMemoryVersionGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaMemoryStoreMemoryVersionGetParams's query parameters as `url.Values`.

type BetaMemoryStoreMemoryVersionListParams

type BetaMemoryStoreMemoryVersionListParams struct {
	// Query parameter for api_key_id
	APIKeyID param.Opt[string] `query:"api_key_id,omitzero" json:"-"`
	// Return versions created at or after this time (inclusive).
	CreatedAtGte param.Opt[time.Time] `query:"created_at[gte],omitzero" format:"date-time" json:"-"`
	// Return versions created at or before this time (inclusive).
	CreatedAtLte param.Opt[time.Time] `query:"created_at[lte],omitzero" format:"date-time" json:"-"`
	// Query parameter for limit
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Query parameter for memory_id
	MemoryID param.Opt[string] `query:"memory_id,omitzero" json:"-"`
	// Query parameter for page
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Query parameter for session_id
	SessionID param.Opt[string] `query:"session_id,omitzero" json:"-"`
	// Query parameter for operation
	//
	// Any of "created", "modified", "deleted".
	Operation BetaManagedAgentsMemoryVersionOperation `query:"operation,omitzero" json:"-"`
	// Query parameter for view
	//
	// Any of "basic", "full".
	View BetaManagedAgentsMemoryView `query:"view,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreMemoryVersionListParams) URLQuery

URLQuery serializes BetaMemoryStoreMemoryVersionListParams's query parameters as `url.Values`.

type BetaMemoryStoreMemoryVersionRedactParams

type BetaMemoryStoreMemoryVersionRedactParams struct {
	MemoryStoreID string `path:"memory_store_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaMemoryStoreMemoryVersionService

type BetaMemoryStoreMemoryVersionService struct {
	Options []option.RequestOption
}

BetaMemoryStoreMemoryVersionService contains methods and other services that help with interacting with the Juglow 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 NewBetaMemoryStoreMemoryVersionService method instead.

func NewBetaMemoryStoreMemoryVersionService

func NewBetaMemoryStoreMemoryVersionService(opts ...option.RequestOption) (r BetaMemoryStoreMemoryVersionService)

NewBetaMemoryStoreMemoryVersionService 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 (*BetaMemoryStoreMemoryVersionService) Get

Retrieve a memory version

func (*BetaMemoryStoreMemoryVersionService) List

List memory versions

func (*BetaMemoryStoreMemoryVersionService) ListAutoPaging

List memory versions

func (*BetaMemoryStoreMemoryVersionService) Redact

Redact a memory version

type BetaMemoryStoreNewParams

type BetaMemoryStoreNewParams struct {
	// Human-readable name for the store. Required; 1–255 characters; no control
	// characters. The mount-path slug under `/mnt/memory/` is derived from this name
	// (lowercased, non-alphanumeric runs collapsed to a hyphen). Names need not be
	// unique within a workspace.
	Name string `json:"name" api:"required"`
	// Free-text description of what the store contains, up to 1024 characters.
	// Included in the agent's system prompt when the store is attached, so word it to
	// be useful to the agent.
	Description param.Opt[string] `json:"description,omitzero"`
	// Arbitrary key-value tags for your own bookkeeping (such as the end user a store
	// belongs to). Up to 16 pairs; keys 1–64 characters; values up to 512 characters.
	// Not visible to the agent.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreNewParams) MarshalJSON

func (r BetaMemoryStoreNewParams) MarshalJSON() (data []byte, err error)

func (*BetaMemoryStoreNewParams) UnmarshalJSON

func (r *BetaMemoryStoreNewParams) UnmarshalJSON(data []byte) error

type BetaMemoryStoreService

type BetaMemoryStoreService struct {
	Options        []option.RequestOption
	Memories       BetaMemoryStoreMemoryService
	MemoryVersions BetaMemoryStoreMemoryVersionService
}

BetaMemoryStoreService contains methods and other services that help with interacting with the Juglow 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 NewBetaMemoryStoreService method instead.

func NewBetaMemoryStoreService

func NewBetaMemoryStoreService(opts ...option.RequestOption) (r BetaMemoryStoreService)

NewBetaMemoryStoreService 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 (*BetaMemoryStoreService) Archive

Archive a memory store

func (*BetaMemoryStoreService) Delete

Delete a memory store

func (*BetaMemoryStoreService) Get

Retrieve a memory store

func (*BetaMemoryStoreService) List

List memory stores

func (*BetaMemoryStoreService) ListAutoPaging

List memory stores

func (*BetaMemoryStoreService) New

Create a memory store

func (*BetaMemoryStoreService) Update

Update a memory store

type BetaMemoryStoreUpdateParams

type BetaMemoryStoreUpdateParams struct {
	// New description for the store, up to 1024 characters. Pass an empty string to
	// clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// New human-readable name for the store. 1–255 characters; no control characters.
	// Renaming changes the slug used for the store's `mount_path` in sessions created
	// after the update.
	Name param.Opt[string] `json:"name,omitzero"`
	// Metadata patch. Set a key to a string to upsert it, or to null to delete it.
	// Omit the field to preserve. The stored bag is limited to 16 keys (up to 64 chars
	// each) with values up to 512 chars.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMemoryStoreUpdateParams) MarshalJSON

func (r BetaMemoryStoreUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaMemoryStoreUpdateParams) UnmarshalJSON

func (r *BetaMemoryStoreUpdateParams) UnmarshalJSON(data []byte) error

type BetaMemoryTool20250818CommandUnion

type BetaMemoryTool20250818CommandUnion struct {
	// Any of "view", "create", "str_replace", "insert", "delete", "rename".
	Command string `json:"command"`
	Path    string `json:"path"`
	// This field is from variant [BetaMemoryTool20250818ViewCommand].
	ViewRange []int64 `json:"view_range"`
	// This field is from variant [BetaMemoryTool20250818CreateCommand].
	FileText string `json:"file_text"`
	// This field is from variant [BetaMemoryTool20250818StrReplaceCommand].
	NewStr string `json:"new_str"`
	// This field is from variant [BetaMemoryTool20250818StrReplaceCommand].
	OldStr string `json:"old_str"`
	// This field is from variant [BetaMemoryTool20250818InsertCommand].
	InsertLine int64 `json:"insert_line"`
	// This field is from variant [BetaMemoryTool20250818InsertCommand].
	InsertText string `json:"insert_text"`
	// This field is from variant [BetaMemoryTool20250818RenameCommand].
	NewPath string `json:"new_path"`
	// This field is from variant [BetaMemoryTool20250818RenameCommand].
	OldPath string `json:"old_path"`
	JSON    struct {
		Command    respjson.Field
		Path       respjson.Field
		ViewRange  respjson.Field
		FileText   respjson.Field
		NewStr     respjson.Field
		OldStr     respjson.Field
		InsertLine respjson.Field
		InsertText respjson.Field
		NewPath    respjson.Field
		OldPath    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaMemoryTool20250818CommandUnion contains all possible properties and values from BetaMemoryTool20250818ViewCommand, BetaMemoryTool20250818CreateCommand, BetaMemoryTool20250818StrReplaceCommand, BetaMemoryTool20250818InsertCommand, BetaMemoryTool20250818DeleteCommand, BetaMemoryTool20250818RenameCommand.

Use the BetaMemoryTool20250818CommandUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaMemoryTool20250818CommandUnion) AsAny

func (u BetaMemoryTool20250818CommandUnion) AsAny() anyBetaMemoryTool20250818Command

Use the following switch statement to find the correct variant

switch variant := BetaMemoryTool20250818CommandUnion.AsAny().(type) {
case Juglow.BetaMemoryTool20250818ViewCommand:
case Juglow.BetaMemoryTool20250818CreateCommand:
case Juglow.BetaMemoryTool20250818StrReplaceCommand:
case Juglow.BetaMemoryTool20250818InsertCommand:
case Juglow.BetaMemoryTool20250818DeleteCommand:
case Juglow.BetaMemoryTool20250818RenameCommand:
default:
  fmt.Errorf("no variant present")
}

func (BetaMemoryTool20250818CommandUnion) AsCreate

func (BetaMemoryTool20250818CommandUnion) AsDelete

func (BetaMemoryTool20250818CommandUnion) AsInsert

func (BetaMemoryTool20250818CommandUnion) AsRename

func (BetaMemoryTool20250818CommandUnion) AsStrReplace

func (BetaMemoryTool20250818CommandUnion) AsView

func (BetaMemoryTool20250818CommandUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMemoryTool20250818CommandUnion) UnmarshalJSON

func (r *BetaMemoryTool20250818CommandUnion) UnmarshalJSON(data []byte) error

type BetaMemoryTool20250818CreateCommand

type BetaMemoryTool20250818CreateCommand struct {
	// Command type identifier
	Command constant.Create `json:"command" default:"create"`
	// Content to write to the file
	FileText string `json:"file_text" api:"required"`
	// Path where the file should be created
	Path string `json:"path" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Command     respjson.Field
		FileText    respjson.Field
		Path        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMemoryTool20250818CreateCommand) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMemoryTool20250818CreateCommand) UnmarshalJSON

func (r *BetaMemoryTool20250818CreateCommand) UnmarshalJSON(data []byte) error

type BetaMemoryTool20250818DeleteCommand

type BetaMemoryTool20250818DeleteCommand struct {
	// Command type identifier
	Command constant.Delete `json:"command" default:"delete"`
	// Path to the file or directory to delete
	Path string `json:"path" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Command     respjson.Field
		Path        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMemoryTool20250818DeleteCommand) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMemoryTool20250818DeleteCommand) UnmarshalJSON

func (r *BetaMemoryTool20250818DeleteCommand) UnmarshalJSON(data []byte) error

type BetaMemoryTool20250818InsertCommand

type BetaMemoryTool20250818InsertCommand struct {
	// Command type identifier
	Command constant.Insert `json:"command" default:"insert"`
	// Line number where text should be inserted
	InsertLine int64 `json:"insert_line" api:"required"`
	// Text to insert at the specified line
	InsertText string `json:"insert_text" api:"required"`
	// Path to the file where text should be inserted
	Path string `json:"path" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Command     respjson.Field
		InsertLine  respjson.Field
		InsertText  respjson.Field
		Path        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMemoryTool20250818InsertCommand) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMemoryTool20250818InsertCommand) UnmarshalJSON

func (r *BetaMemoryTool20250818InsertCommand) UnmarshalJSON(data []byte) error

type BetaMemoryTool20250818Param

type BetaMemoryTool20250818Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "memory".
	Name constant.Memory `json:"name" default:"memory"`
	// This field can be elided, and will marshal its zero value as "memory_20250818".
	Type constant.Memory20250818 `json:"type" default:"memory_20250818"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaMemoryTool20250818Param) MarshalJSON

func (r BetaMemoryTool20250818Param) MarshalJSON() (data []byte, err error)

func (*BetaMemoryTool20250818Param) UnmarshalJSON

func (r *BetaMemoryTool20250818Param) UnmarshalJSON(data []byte) error

type BetaMemoryTool20250818RenameCommand

type BetaMemoryTool20250818RenameCommand struct {
	// Command type identifier
	Command constant.Rename `json:"command" default:"rename"`
	// New path for the file or directory
	NewPath string `json:"new_path" api:"required"`
	// Current path of the file or directory
	OldPath string `json:"old_path" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Command     respjson.Field
		NewPath     respjson.Field
		OldPath     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMemoryTool20250818RenameCommand) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMemoryTool20250818RenameCommand) UnmarshalJSON

func (r *BetaMemoryTool20250818RenameCommand) UnmarshalJSON(data []byte) error

type BetaMemoryTool20250818StrReplaceCommand

type BetaMemoryTool20250818StrReplaceCommand struct {
	// Command type identifier
	Command constant.StrReplace `json:"command" default:"str_replace"`
	// Text to replace with
	NewStr string `json:"new_str" api:"required"`
	// Text to search for and replace
	OldStr string `json:"old_str" api:"required"`
	// Path to the file where text should be replaced
	Path string `json:"path" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Command     respjson.Field
		NewStr      respjson.Field
		OldStr      respjson.Field
		Path        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMemoryTool20250818StrReplaceCommand) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMemoryTool20250818StrReplaceCommand) UnmarshalJSON

func (r *BetaMemoryTool20250818StrReplaceCommand) UnmarshalJSON(data []byte) error

type BetaMemoryTool20250818ViewCommand

type BetaMemoryTool20250818ViewCommand struct {
	// Command type identifier
	Command constant.View `json:"command" default:"view"`
	// Path to directory or file to view
	Path string `json:"path" api:"required"`
	// Optional line range for viewing specific lines
	ViewRange []int64 `json:"view_range"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Command     respjson.Field
		Path        respjson.Field
		ViewRange   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMemoryTool20250818ViewCommand) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMemoryTool20250818ViewCommand) UnmarshalJSON

func (r *BetaMemoryTool20250818ViewCommand) UnmarshalJSON(data []byte) error

type BetaMessage

type BetaMessage struct {
	// Unique object identifier.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// Information about the container used in the request (for the code execution
	// tool)
	Container BetaContainer `json:"container" api:"required"`
	// Content generated by the model.
	//
	// This is an array of content blocks, each of which has a `type` that determines
	// its shape.
	//
	// Example:
	//
	// “`json
	// [{ "type": "text", "text": "Hi, I'm haijun." }]
	// “`
	//
	// If the request input `messages` ended with an `assistant` turn, then the
	// response `content` will continue directly from that last turn. You can use this
	// to constrain the model's output.
	//
	// For example, if the input `messages` were:
	//
	// “`json
	// [
	//
	//	{
	//	  "role": "user",
	//	  "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
	//	},
	//	{ "role": "assistant", "content": "The best answer is (" }
	//
	// ]
	// “`
	//
	// Then the response `content` might be:
	//
	// “`json
	// [{ "type": "text", "text": "B)" }]
	// “`
	Content []BetaContentBlockUnion `json:"content" api:"required"`
	// Context management response.
	//
	// Information about context management strategies applied during the request.
	ContextManagement BetaContextManagementResponse `json:"context_management" api:"required"`
	// Response envelope for request-level diagnostics. Present (possibly null)
	// whenever the caller supplied `diagnostics` on the request.
	Diagnostics BetaDiagnostics `json:"diagnostics" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model" api:"required"`
	// Conversational role of the generated message.
	//
	// This will always be `"assistant"`.
	Role constant.Assistant `json:"role" default:"assistant"`
	// Structured information about a refusal.
	StopDetails BetaRefusalStopDetails `json:"stop_details" api:"required"`
	// The reason that we stopped.
	//
	// This may be one the following values:
	//
	//   - `"end_turn"`: the model reached a natural stopping point
	//   - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
	//   - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
	//   - `"tool_use"`: the model invoked one or more tools
	//   - `"pause_turn"`: we paused a long-running turn. You may provide the response
	//     back as-is in a subsequent request to let the model continue.
	//   - `"refusal"`: when streaming classifiers intervene to handle potential policy
	//     violations
	//   - `"model_context_window_exceeded"`: we exceeded the model's context window
	//
	// In non-streaming mode this value is always non-null. In streaming mode, it is
	// null in the `message_start` event and non-null otherwise.
	//
	// Any of "end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn",
	// "compaction", "refusal", "model_context_window_exceeded".
	StopReason BetaStopReason `json:"stop_reason" api:"required"`
	// Which custom stop sequence was generated, if any.
	//
	// This value will be a non-null string if one of your custom stop sequences was
	// generated.
	StopSequence string `json:"stop_sequence" api:"required"`
	// Object type.
	//
	// For Messages, this is always `"message"`.
	Type constant.Message `json:"type" default:"message"`
	// Billing and rate-limit usage.
	//
	// Juglow's API bills and rate-limits by token counts, as tokens represent the
	// underlying cost to our systems.
	//
	// Under the hood, the API transforms requests into a format suitable for the
	// model. The model's output then goes through a parsing stage before becoming an
	// API response. As a result, the token counts in `usage` will not match one-to-one
	// with the exact visible content of an API request or response.
	//
	// For example, `output_tokens` will be non-zero, even for an empty string response
	// from haijun.
	//
	// Total input tokens in a request is the summation of `input_tokens`,
	// `cache_creation_input_tokens`, and `cache_read_input_tokens`.
	Usage BetaUsage `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		Container         respjson.Field
		Content           respjson.Field
		ContextManagement respjson.Field
		Diagnostics       respjson.Field
		Model             respjson.Field
		Role              respjson.Field
		StopDetails       respjson.Field
		StopReason        respjson.Field
		StopSequence      respjson.Field
		Type              respjson.Field
		Usage             respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (*BetaMessage) Accumulate

func (acc *BetaMessage) Accumulate(event BetaRawMessageStreamEventUnion) error

Accumulate builds up the Message incrementally from a MessageStreamEvent. The Message then can be used as any other Message, including the Message.JSON field, which holds the wire JSON with the streamed deltas applied and is complete once message_stop arrives.

message := Juglow.Message{}
for stream.Next() {
	event := stream.Current()
	message.Accumulate(event)
}

func (*BetaMessage) ParseOutput

func (r *BetaMessage) ParseOutput(dest any) error

ParseOutput finds the first text content block in the message and unmarshals it into dest. This is useful for streaming workflows where you accumulate the message first and then parse the structured output.

var msg Juglow.BetaMessage
for stream.Next() { msg.Accumulate(stream.Current()) }
msg.ParseOutput(&myStruct)

func (BetaMessage) RawJSON

func (r BetaMessage) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaMessage) ToParam

func (r BetaMessage) ToParam() BetaMessageParam

func (*BetaMessage) UnmarshalJSON

func (r *BetaMessage) UnmarshalJSON(data []byte) error

type BetaMessageBatch

type BetaMessageBatch struct {
	// Unique object identifier.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// RFC 3339 datetime string representing the time at which the Message Batch was
	// archived and its results became unavailable.
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// RFC 3339 datetime string representing the time at which cancellation was
	// initiated for the Message Batch. Specified only if cancellation was initiated.
	CancelInitiatedAt time.Time `json:"cancel_initiated_at" api:"required" format:"date-time"`
	// RFC 3339 datetime string representing the time at which the Message Batch was
	// created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// RFC 3339 datetime string representing the time at which processing for the
	// Message Batch ended. Specified only once processing ends.
	//
	// Processing ends when every request in a Message Batch has either succeeded,
	// errored, canceled, or expired.
	EndedAt time.Time `json:"ended_at" api:"required" format:"date-time"`
	// RFC 3339 datetime string representing the time at which the Message Batch will
	// expire and end processing, which is 24 hours after creation.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// Processing status of the Message Batch.
	//
	// Any of "in_progress", "canceling", "ended".
	ProcessingStatus BetaMessageBatchProcessingStatus `json:"processing_status" api:"required"`
	// Tallies requests within the Message Batch, categorized by their status.
	//
	// Requests start as `processing` and move to one of the other statuses only once
	// processing of the entire batch ends. The sum of all values always matches the
	// total number of requests in the batch.
	RequestCounts BetaMessageBatchRequestCounts `json:"request_counts" api:"required"`
	// URL to a `.jsonl` file containing the results of the Message Batch requests.
	// Specified only once processing ends.
	//
	// Results in the file are not guaranteed to be in the same order as requests. Use
	// the `custom_id` field to match results to requests.
	ResultsURL string `json:"results_url" api:"required"`
	// Object type.
	//
	// For Message Batches, this is always `"message_batch"`.
	Type constant.MessageBatch `json:"type" default:"message_batch"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		ArchivedAt        respjson.Field
		CancelInitiatedAt respjson.Field
		CreatedAt         respjson.Field
		EndedAt           respjson.Field
		ExpiresAt         respjson.Field
		ProcessingStatus  respjson.Field
		RequestCounts     respjson.Field
		ResultsURL        respjson.Field
		Type              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMessageBatch) RawJSON

func (r BetaMessageBatch) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaMessageBatch) UnmarshalJSON

func (r *BetaMessageBatch) UnmarshalJSON(data []byte) error

type BetaMessageBatchCancelParams

type BetaMessageBatchCancelParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaMessageBatchCanceledResult

type BetaMessageBatchCanceledResult struct {
	Type constant.Canceled `json:"type" default:"canceled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMessageBatchCanceledResult) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMessageBatchCanceledResult) UnmarshalJSON

func (r *BetaMessageBatchCanceledResult) UnmarshalJSON(data []byte) error

type BetaMessageBatchDeleteParams

type BetaMessageBatchDeleteParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaMessageBatchErroredResult

type BetaMessageBatchErroredResult struct {
	Error BetaErrorResponse `json:"error" api:"required"`
	Type  constant.Errored  `json:"type" default:"errored"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Error       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMessageBatchErroredResult) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMessageBatchErroredResult) UnmarshalJSON

func (r *BetaMessageBatchErroredResult) UnmarshalJSON(data []byte) error

type BetaMessageBatchExpiredResult

type BetaMessageBatchExpiredResult struct {
	Type constant.Expired `json:"type" default:"expired"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMessageBatchExpiredResult) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMessageBatchExpiredResult) UnmarshalJSON

func (r *BetaMessageBatchExpiredResult) UnmarshalJSON(data []byte) error

type BetaMessageBatchGetParams

type BetaMessageBatchGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaMessageBatchIndividualResponse

type BetaMessageBatchIndividualResponse struct {
	// Developer-provided ID created for each request in a Message Batch. Useful for
	// matching results to requests, as results may be given out of request order.
	//
	// Must be unique for each request within the Message Batch.
	CustomID string `json:"custom_id" api:"required"`
	// Processing result for this request.
	//
	// Contains a Message output if processing was successful, an error response if
	// processing failed, or the reason why processing was not attempted, such as
	// cancellation or expiration.
	Result BetaMessageBatchResultUnion `json:"result" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomID    respjson.Field
		Result      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

This is a single line in the response `.jsonl` file and does not represent the response as a whole.

func (BetaMessageBatchIndividualResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMessageBatchIndividualResponse) UnmarshalJSON

func (r *BetaMessageBatchIndividualResponse) UnmarshalJSON(data []byte) error

type BetaMessageBatchListParams

type BetaMessageBatchListParams struct {
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately after this object.
	AfterID param.Opt[string] `query:"after_id,omitzero" json:"-"`
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately before this object.
	BeforeID param.Opt[string] `query:"before_id,omitzero" json:"-"`
	// Number of items to return per page.
	//
	// Defaults to `20`. Ranges from `1` to `1000`.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMessageBatchListParams) URLQuery

func (r BetaMessageBatchListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaMessageBatchListParams's query parameters as `url.Values`.

type BetaMessageBatchNewParams

type BetaMessageBatchNewParams struct {
	// List of requests for prompt completion. Each is an individual request to create
	// a Message.
	Requests []BetaMessageBatchNewParamsRequest `json:"requests,omitzero" api:"required"`
	// The user profile ID to attribute the requests in this batch to. Use when acting
	// on behalf of a party other than your organization. Requires the `user-profiles`
	// beta header. Applies to every request in the batch; an individual request whose
	// `user_profile_id` body field conflicts with this header is errored.
	UserProfileID param.Opt[string] `header:"Juglow-user-profile-id,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMessageBatchNewParams) MarshalJSON

func (r BetaMessageBatchNewParams) MarshalJSON() (data []byte, err error)

func (*BetaMessageBatchNewParams) UnmarshalJSON

func (r *BetaMessageBatchNewParams) UnmarshalJSON(data []byte) error

type BetaMessageBatchNewParamsRequest

type BetaMessageBatchNewParamsRequest struct {
	// Developer-provided ID created for each request in a Message Batch. Useful for
	// matching results to requests, as results may be given out of request order.
	//
	// Must be unique for each request within the Message Batch.
	CustomID string `json:"custom_id" api:"required"`
	// Messages API creation parameters for the individual request.
	//
	// See the
	// [Messages API reference](https://platform.haijun.com/docs/en/api/messages) for
	// full documentation on available parameters.
	Params BetaMessageBatchNewParamsRequestParams `json:"params,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties CustomID, Params are required.

func (BetaMessageBatchNewParamsRequest) MarshalJSON

func (r BetaMessageBatchNewParamsRequest) MarshalJSON() (data []byte, err error)

func (*BetaMessageBatchNewParamsRequest) UnmarshalJSON

func (r *BetaMessageBatchNewParamsRequest) UnmarshalJSON(data []byte) error

type BetaMessageBatchNewParamsRequestParams

type BetaMessageBatchNewParamsRequestParams struct {
	// The maximum number of tokens to generate before stopping.
	//
	// Note that our models may stop _before_ reaching this maximum. This parameter
	// only specifies the absolute maximum number of tokens to generate.
	//
	// Set to `0` to populate the
	// [prompt cache](https://platform.haijun.com/docs/en/build-with-haijun/prompt-caching#pre-warming-the-cache)
	// without generating a response.
	//
	// Different models have different maximum values for this parameter. See
	// [models](https://platform.haijun.com/docs/en/about-haijun/models/overview) for
	// details.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Input messages.
	//
	// Our models are trained to operate on alternating `user` and `assistant`
	// conversational turns. When creating a new `Message`, you specify the prior
	// conversational turns with the `messages` parameter, and the model then generates
	// the next `Message` in the conversation. Consecutive `user` or `assistant` turns
	// in your request will be combined into a single turn.
	//
	// Each input message must be an object with a `role` and `content`. You can
	// specify a single `user`-role message, or you can include multiple `user` and
	// `assistant` messages.
	//
	// If the final message uses the `assistant` role, the response content will
	// continue immediately from the content in that message. This can be used to
	// constrain part of the model's response.
	//
	// Example with a single `user` message:
	//
	// “`json
	// [{ "role": "user", "content": "Hello, haijun" }]
	// “`
	//
	// Example with multiple conversational turns:
	//
	// “`json
	// [
	//
	//	{ "role": "user", "content": "Hello there." },
	//	{ "role": "assistant", "content": "Hi, I'm haijun. How can I help you?" },
	//	{ "role": "user", "content": "Can you explain LLMs in plain English?" }
	//
	// ]
	// “`
	//
	// Example with a partially-filled response from haijun:
	//
	// “`json
	// [
	//
	//	{
	//	  "role": "user",
	//	  "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
	//	},
	//	{ "role": "assistant", "content": "The best answer is (" }
	//
	// ]
	// “`
	//
	// Each input message `content` may be either a single `string` or an array of
	// content blocks, where each block has a specific `type`. Using a `string` for
	// `content` is shorthand for an array of one content block of type `"text"`. The
	// following input messages are equivalent:
	//
	// “`json
	// { "role": "user", "content": "Hello, haijun" }
	// “`
	//
	// “`json
	// { "role": "user", "content": [{ "type": "text", "text": "Hello, haijun" }] }
	// “`
	//
	// See
	// [input examples](https://platform.haijun.com/docs/en/build-with-haijun/working-with-messages).
	//
	// Note that if you want to include a
	// [system prompt](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role),
	// you can use the top-level `system` parameter — there is no `"system"` role for
	// input messages in the Messages API.
	//
	// There is a limit of 100,000 messages in a single request.
	Messages []BetaMessageParam `json:"messages,omitzero" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model,omitzero" api:"required"`
	// Specifies the geographic region for inference processing. If not specified, the
	// workspace's `default_inference_geo` is used.
	InferenceGeo param.Opt[string] `json:"inference_geo,omitzero"`
	// Whether to incrementally stream the response using server-sent events.
	//
	// See [streaming](https://platform.haijun.com/docs/en/build-with-haijun/streaming)
	// for details.
	Stream param.Opt[bool] `json:"stream,omitzero"`
	// Amount of randomness injected into the response.
	//
	// Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
	// for analytical / multiple choice, and closer to `1.0` for creative and
	// generative tasks.
	//
	// Note that even with `temperature` of `0.0`, the results will not be fully
	// deterministic.
	//
	// Deprecated: Deprecated. Models released after haijun Opus 4.6 do not support
	// setting temperature. A value of 1.0 of will be accepted for backwards
	// compatibility, all other values will be rejected with a 400 error.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Only sample from the top K options for each subsequent token.
	//
	// Used to remove "long tail" low probability responses.
	// [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
	//
	// Recommended for advanced use cases only.
	//
	// Deprecated: Deprecated. Models released after haijun Opus 4.6 do not accept
	// top_k; any value will be rejected with a 400 error.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// Use nucleus sampling.
	//
	// In nucleus sampling, we compute the cumulative distribution over all the options
	// for each subsequent token in decreasing probability order and cut it off once it
	// reaches a particular probability specified by `top_p`.
	//
	// Recommended for advanced use cases only.
	//
	// Deprecated: Deprecated. Models released after haijun Opus 4.6 do not support
	// setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all
	// other values will be rejected with a 400 error.
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// Container identifier for reuse across requests.
	Container BetaMessageBatchNewParamsRequestParamsContainerUnion `json:"container,omitzero"`
	// The `fallback_credit_token` from a prior refusal's `stop_details`.
	//
	// When a preceding request was refused and returned a `fallback_credit_token`,
	// pass that code here on the retry to have the retry's cache-creation tokens for
	// the prefix that was warm on the refused model billed at the cache-read rate.
	// Must be redeemed by the same organization and workspace, with the same request
	// body (optionally extended by one appended `assistant` message whose content is
	// the partial text — with any trailing whitespace stripped from the final text
	// block — and paired server-tool blocks streamed before the refusal; the
	// appended-assistant form is not available for requests with `output_format` set
	// or forced `tool_choice`), on an eligible fallback model, on the same platform,
	// and within 5 minutes of the refusal; a mismatch is a 400. A token minted
	// mid-server-tool-loop whose partial content was continuable may only be redeemed
	// with the appended-assistant form — if an exact-body retry is rejected with a 400
	// saying the token must be redeemed by continuing the partial response, retry with
	// the appended-assistant form instead.
	//
	// When the appended-assistant form is used on a model that otherwise disallows
	// assistant-turn prefill, this token also authorizes that one prefill.
	FallbackCreditToken BetaMessageBatchNewParamsRequestParamsFallbackCreditTokenUnion `json:"fallback_credit_token,omitzero"`
	// Opt-in server-side retry on one or more substitute models when the requested
	// model declines for policy reasons. Tried in order: if the first entry also
	// declines, the second is tried, and so on. The string "default" requests the
	// requested model's server-defined default fallback configuration.
	Fallbacks BetaFallbacksParamUnion `json:"fallbacks,omitzero"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed string `json:"speed,omitzero"`
	// Top-level cache control automatically applies a cache_control marker to the last
	// cacheable block in the request.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Context management configuration.
	//
	// This allows you to control how haijun manages context across multiple requests,
	// such as whether to clear function results or not.
	ContextManagement BetaContextManagementConfigParam `json:"context_management,omitzero"`
	// Request-level diagnostics. Currently carries the previous response id for
	// prompt-cache divergence reporting.
	Diagnostics BetaDiagnosticsParam `json:"diagnostics,omitzero"`
	// MCP servers to be utilized in this request
	MCPServers []BetaRequestMCPServerURLDefinitionParam `json:"mcp_servers,omitzero"`
	// An object describing metadata about the request.
	Metadata BetaMetadataParam `json:"metadata,omitzero"`
	// Configuration options for the model's output, such as the output format.
	OutputConfig BetaOutputConfigParam `json:"output_config,omitzero"`
	// Deprecated: Use `output_config.format` instead. See
	// [structured outputs](https://platform.haijun.com/docs/en/build-with-haijun/structured-outputs)
	//
	// A schema to specify haijun's output format in responses. This parameter will be
	// removed in a future release.
	//
	// Deprecated: deprecated
	OutputFormat BetaJSONOutputFormatParam `json:"output_format,omitzero"`
	// Determines whether to use priority capacity (if available) or standard capacity
	// for this request.
	//
	// Juglow offers different levels of service for your API requests. See
	// [service-tiers](https://platform.haijun.com/docs/en/api/service-tiers) for
	// details.
	//
	// Any of "auto", "standard_only".
	ServiceTier string `json:"service_tier,omitzero"`
	// Custom text sequences that will cause the model to stop generating.
	//
	// Our models will normally stop when they have naturally completed their turn,
	// which will result in a response `stop_reason` of `"end_turn"`.
	//
	// If you want the model to stop generating when it encounters custom strings of
	// text, you can use the `stop_sequences` parameter. If the model encounters one of
	// the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
	// and the response `stop_sequence` value will contain the matched stop sequence.
	StopSequences []string `json:"stop_sequences,omitzero"`
	// System prompt.
	//
	// A system prompt is a way of providing context and instructions to haijun, such
	// as specifying a particular goal or role. See our
	// [guide to system prompts](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role).
	System []BetaTextBlockParam `json:"system,omitzero"`
	// Configuration for enabling haijun's extended thinking.
	//
	// When enabled, responses include `thinking` content blocks showing haijun's
	// thinking process before the final answer. Requires a minimum budget of 1,024
	// tokens and counts towards your `max_tokens` limit.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	Thinking BetaThinkingConfigParamUnion `json:"thinking,omitzero"`
	// How the model should use the provided tools. The model can use a specific tool,
	// any available tool, decide by itself, or not use tools at all.
	ToolChoice BetaToolChoiceUnionParam `json:"tool_choice,omitzero"`
	// Definitions of tools that the model may use.
	//
	// If you include `tools` in your API request, the model may return `tool_use`
	// content blocks that represent the model's use of those tools. You can then run
	// those tools using the tool input generated by the model and then optionally
	// return results back to the model using `tool_result` content blocks.
	//
	// There are two types of tools: **client tools** and **server tools**. The
	// behavior described below applies to client tools. For
	// [server tools](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/server-tools),
	// see their individual documentation as each has its own behavior (e.g., the
	// [web search tool](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/web-search-tool)).
	//
	// Each tool definition includes:
	//
	//   - `name`: Name of the tool.
	//   - `description`: Optional, but strongly-recommended description of the tool.
	//   - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
	//     tool `input` shape that the model will produce in `tool_use` output content
	//     blocks.
	//
	// For example, if you defined `tools` as:
	//
	// “`json
	// [
	//
	//	{
	//	  "name": "get_stock_price",
	//	  "description": "Get the current stock price for a given ticker symbol.",
	//	  "input_schema": {
	//	    "type": "object",
	//	    "properties": {
	//	      "ticker": {
	//	        "type": "string",
	//	        "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
	//	      }
	//	    },
	//	    "required": ["ticker"]
	//	  }
	//	}
	//
	// ]
	// “`
	//
	// And then asked the model "What's the S&P 500 at today?", the model might produce
	// `tool_use` content blocks in the response like this:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_use",
	//	  "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "name": "get_stock_price",
	//	  "input": { "ticker": "^GSPC" }
	//	}
	//
	// ]
	// “`
	//
	// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
	// input, and return the following back to the model in a subsequent `user`
	// message:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_result",
	//	  "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "content": "259.75 USD"
	//	}
	//
	// ]
	// “`
	//
	// Tools can be used for workflows that include running client-side tools and
	// functions, or more generally whenever you want the model to produce a particular
	// JSON structure of output.
	//
	// See our
	// [guide](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/overview)
	// for more details.
	Tools []BetaToolUnionParam `json:"tools,omitzero"`
	// contains filtered or unexported fields
}

Messages API creation parameters for the individual request.

See the [Messages API reference](https://platform.haijun.com/docs/en/api/messages) for full documentation on available parameters.

The properties MaxTokens, Messages, Model are required.

func (BetaMessageBatchNewParamsRequestParams) MarshalJSON

func (r BetaMessageBatchNewParamsRequestParams) MarshalJSON() (data []byte, err error)

func (*BetaMessageBatchNewParamsRequestParams) UnmarshalJSON

func (r *BetaMessageBatchNewParamsRequestParams) UnmarshalJSON(data []byte) error

type BetaMessageBatchNewParamsRequestParamsContainerUnion

type BetaMessageBatchNewParamsRequestParamsContainerUnion struct {
	OfContainers *BetaContainerParams `json:",omitzero,inline"`
	OfString     param.Opt[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 (BetaMessageBatchNewParamsRequestParamsContainerUnion) MarshalJSON

func (*BetaMessageBatchNewParamsRequestParamsContainerUnion) UnmarshalJSON

type BetaMessageBatchNewParamsRequestParamsFallbackCreditTokenUnion

type BetaMessageBatchNewParamsRequestParamsFallbackCreditTokenUnion struct {
	OfString              param.Opt[string]             `json:",omitzero,inline"`
	OfFallbackCreditToken *BetaFallbackCreditTokenParam `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 (BetaMessageBatchNewParamsRequestParamsFallbackCreditTokenUnion) MarshalJSON

func (*BetaMessageBatchNewParamsRequestParamsFallbackCreditTokenUnion) UnmarshalJSON

type BetaMessageBatchProcessingStatus

type BetaMessageBatchProcessingStatus string

Processing status of the Message Batch.

const (
	BetaMessageBatchProcessingStatusInProgress BetaMessageBatchProcessingStatus = "in_progress"
	BetaMessageBatchProcessingStatusCanceling  BetaMessageBatchProcessingStatus = "canceling"
	BetaMessageBatchProcessingStatusEnded      BetaMessageBatchProcessingStatus = "ended"
)

type BetaMessageBatchRequestCounts

type BetaMessageBatchRequestCounts struct {
	// Number of requests in the Message Batch that have been canceled.
	//
	// This is zero until processing of the entire Message Batch has ended.
	Canceled int64 `json:"canceled" api:"required"`
	// Number of requests in the Message Batch that encountered an error.
	//
	// This is zero until processing of the entire Message Batch has ended.
	Errored int64 `json:"errored" api:"required"`
	// Number of requests in the Message Batch that have expired.
	//
	// This is zero until processing of the entire Message Batch has ended.
	Expired int64 `json:"expired" api:"required"`
	// Number of requests in the Message Batch that are processing.
	Processing int64 `json:"processing" api:"required"`
	// Number of requests in the Message Batch that have completed successfully.
	//
	// This is zero until processing of the entire Message Batch has ended.
	Succeeded int64 `json:"succeeded" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Canceled    respjson.Field
		Errored     respjson.Field
		Expired     respjson.Field
		Processing  respjson.Field
		Succeeded   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMessageBatchRequestCounts) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMessageBatchRequestCounts) UnmarshalJSON

func (r *BetaMessageBatchRequestCounts) UnmarshalJSON(data []byte) error

type BetaMessageBatchResultUnion

type BetaMessageBatchResultUnion struct {
	// This field is from variant [BetaMessageBatchSucceededResult].
	Message BetaMessage `json:"message"`
	// Any of "succeeded", "errored", "canceled", "expired".
	Type string `json:"type"`
	// This field is from variant [BetaMessageBatchErroredResult].
	Error BetaErrorResponse `json:"error"`
	JSON  struct {
		Message respjson.Field
		Type    respjson.Field
		Error   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaMessageBatchResultUnion contains all possible properties and values from BetaMessageBatchSucceededResult, BetaMessageBatchErroredResult, BetaMessageBatchCanceledResult, BetaMessageBatchExpiredResult.

Use the BetaMessageBatchResultUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaMessageBatchResultUnion) AsAny

func (u BetaMessageBatchResultUnion) AsAny() anyBetaMessageBatchResult

Use the following switch statement to find the correct variant

switch variant := BetaMessageBatchResultUnion.AsAny().(type) {
case Juglow.BetaMessageBatchSucceededResult:
case Juglow.BetaMessageBatchErroredResult:
case Juglow.BetaMessageBatchCanceledResult:
case Juglow.BetaMessageBatchExpiredResult:
default:
  fmt.Errorf("no variant present")
}

func (BetaMessageBatchResultUnion) AsCanceled

func (BetaMessageBatchResultUnion) AsErrored

func (BetaMessageBatchResultUnion) AsExpired

func (BetaMessageBatchResultUnion) AsSucceeded

func (BetaMessageBatchResultUnion) RawJSON

func (u BetaMessageBatchResultUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaMessageBatchResultUnion) UnmarshalJSON

func (r *BetaMessageBatchResultUnion) UnmarshalJSON(data []byte) error

type BetaMessageBatchResultsParams

type BetaMessageBatchResultsParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaMessageBatchService

type BetaMessageBatchService struct {
	Options []option.RequestOption
}

BetaMessageBatchService contains methods and other services that help with interacting with the Juglow 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 NewBetaMessageBatchService method instead.

func NewBetaMessageBatchService

func NewBetaMessageBatchService(opts ...option.RequestOption) (r BetaMessageBatchService)

NewBetaMessageBatchService 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 (*BetaMessageBatchService) Cancel

func (r *BetaMessageBatchService) Cancel(ctx context.Context, messageBatchID string, body BetaMessageBatchCancelParams, opts ...option.RequestOption) (res *BetaMessageBatch, err error)

Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.

The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*BetaMessageBatchService) Delete

Delete a Message Batch.

Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*BetaMessageBatchService) Get

func (r *BetaMessageBatchService) Get(ctx context.Context, messageBatchID string, query BetaMessageBatchGetParams, opts ...option.RequestOption) (res *BetaMessageBatch, err error)

This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*BetaMessageBatchService) List

List all Message Batches within a Workspace. Most recently created batches are returned first.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*BetaMessageBatchService) ListAutoPaging

List all Message Batches within a Workspace. Most recently created batches are returned first.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*BetaMessageBatchService) New

Send a batch of Message creation requests.

The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*BetaMessageBatchService) ResultsStreaming

Streams the results of a Message Batch as a `.jsonl` file.

Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

type BetaMessageBatchSucceededResult

type BetaMessageBatchSucceededResult struct {
	Message BetaMessage        `json:"message" api:"required"`
	Type    constant.Succeeded `json:"type" default:"succeeded"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMessageBatchSucceededResult) RawJSON

Returns the unmodified JSON received from the API

func (*BetaMessageBatchSucceededResult) UnmarshalJSON

func (r *BetaMessageBatchSucceededResult) UnmarshalJSON(data []byte) error

type BetaMessageCountTokensParams

type BetaMessageCountTokensParams struct {
	// Input messages.
	//
	// Our models are trained to operate on alternating `user` and `assistant`
	// conversational turns. When creating a new `Message`, you specify the prior
	// conversational turns with the `messages` parameter, and the model then generates
	// the next `Message` in the conversation. Consecutive `user` or `assistant` turns
	// in your request will be combined into a single turn.
	//
	// Each input message must be an object with a `role` and `content`. You can
	// specify a single `user`-role message, or you can include multiple `user` and
	// `assistant` messages.
	//
	// If the final message uses the `assistant` role, the response content will
	// continue immediately from the content in that message. This can be used to
	// constrain part of the model's response.
	//
	// Example with a single `user` message:
	//
	// “`json
	// [{ "role": "user", "content": "Hello, haijun" }]
	// “`
	//
	// Example with multiple conversational turns:
	//
	// “`json
	// [
	//
	//	{ "role": "user", "content": "Hello there." },
	//	{ "role": "assistant", "content": "Hi, I'm haijun. How can I help you?" },
	//	{ "role": "user", "content": "Can you explain LLMs in plain English?" }
	//
	// ]
	// “`
	//
	// Example with a partially-filled response from haijun:
	//
	// “`json
	// [
	//
	//	{
	//	  "role": "user",
	//	  "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
	//	},
	//	{ "role": "assistant", "content": "The best answer is (" }
	//
	// ]
	// “`
	//
	// Each input message `content` may be either a single `string` or an array of
	// content blocks, where each block has a specific `type`. Using a `string` for
	// `content` is shorthand for an array of one content block of type `"text"`. The
	// following input messages are equivalent:
	//
	// “`json
	// { "role": "user", "content": "Hello, haijun" }
	// “`
	//
	// “`json
	// { "role": "user", "content": [{ "type": "text", "text": "Hello, haijun" }] }
	// “`
	//
	// See
	// [input examples](https://platform.haijun.com/docs/en/build-with-haijun/working-with-messages).
	//
	// Note that if you want to include a
	// [system prompt](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role),
	// you can use the top-level `system` parameter — there is no `"system"` role for
	// input messages in the Messages API.
	//
	// There is a limit of 100,000 messages in a single request.
	Messages []BetaMessageParam `json:"messages,omitzero" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model,omitzero" api:"required"`
	// The user profile ID to attribute this request to. Use when acting on behalf of a
	// party other than your organization. Requires the `user-profiles` beta header.
	UserProfileID param.Opt[string] `header:"Juglow-user-profile-id,omitzero" json:"-"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed BetaMessageCountTokensParamsSpeed `json:"speed,omitzero"`
	// Top-level cache control automatically applies a cache_control marker to the last
	// cacheable block in the request.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Context management configuration.
	//
	// This allows you to control how haijun manages context across multiple requests,
	// such as whether to clear function results or not.
	ContextManagement BetaContextManagementConfigParam `json:"context_management,omitzero"`
	// MCP servers to be utilized in this request
	MCPServers []BetaRequestMCPServerURLDefinitionParam `json:"mcp_servers,omitzero"`
	// Configuration options for the model's output, such as the output format.
	OutputConfig BetaOutputConfigParam `json:"output_config,omitzero"`
	// Deprecated: Use `output_config.format` instead. See
	// [structured outputs](https://platform.haijun.com/docs/en/build-with-haijun/structured-outputs)
	//
	// A schema to specify haijun's output format in responses. This parameter will be
	// removed in a future release.
	OutputFormat BetaJSONOutputFormatParam `json:"output_format,omitzero"`
	// System prompt.
	//
	// A system prompt is a way of providing context and instructions to haijun, such
	// as specifying a particular goal or role. See our
	// [guide to system prompts](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role).
	System BetaMessageCountTokensParamsSystemUnion `json:"system,omitzero"`
	// Configuration for enabling haijun's extended thinking.
	//
	// When enabled, responses include `thinking` content blocks showing haijun's
	// thinking process before the final answer. Requires a minimum budget of 1,024
	// tokens and counts towards your `max_tokens` limit.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	Thinking BetaThinkingConfigParamUnion `json:"thinking,omitzero"`
	// How the model should use the provided tools. The model can use a specific tool,
	// any available tool, decide by itself, or not use tools at all.
	ToolChoice BetaToolChoiceUnionParam `json:"tool_choice,omitzero"`
	// Definitions of tools that the model may use.
	//
	// If you include `tools` in your API request, the model may return `tool_use`
	// content blocks that represent the model's use of those tools. You can then run
	// those tools using the tool input generated by the model and then optionally
	// return results back to the model using `tool_result` content blocks.
	//
	// There are two types of tools: **client tools** and **server tools**. The
	// behavior described below applies to client tools. For
	// [server tools](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/server-tools),
	// see their individual documentation as each has its own behavior (e.g., the
	// [web search tool](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/web-search-tool)).
	//
	// Each tool definition includes:
	//
	//   - `name`: Name of the tool.
	//   - `description`: Optional, but strongly-recommended description of the tool.
	//   - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
	//     tool `input` shape that the model will produce in `tool_use` output content
	//     blocks.
	//
	// For example, if you defined `tools` as:
	//
	// “`json
	// [
	//
	//	{
	//	  "name": "get_stock_price",
	//	  "description": "Get the current stock price for a given ticker symbol.",
	//	  "input_schema": {
	//	    "type": "object",
	//	    "properties": {
	//	      "ticker": {
	//	        "type": "string",
	//	        "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
	//	      }
	//	    },
	//	    "required": ["ticker"]
	//	  }
	//	}
	//
	// ]
	// “`
	//
	// And then asked the model "What's the S&P 500 at today?", the model might produce
	// `tool_use` content blocks in the response like this:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_use",
	//	  "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "name": "get_stock_price",
	//	  "input": { "ticker": "^GSPC" }
	//	}
	//
	// ]
	// “`
	//
	// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
	// input, and return the following back to the model in a subsequent `user`
	// message:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_result",
	//	  "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "content": "259.75 USD"
	//	}
	//
	// ]
	// “`
	//
	// Tools can be used for workflows that include running client-side tools and
	// functions, or more generally whenever you want the model to produce a particular
	// JSON structure of output.
	//
	// See our
	// [guide](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/overview)
	// for more details.
	Tools []BetaMessageCountTokensParamsToolUnion `json:"tools,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMessageCountTokensParams) MarshalJSON

func (r BetaMessageCountTokensParams) MarshalJSON() (data []byte, err error)

func (*BetaMessageCountTokensParams) UnmarshalJSON

func (r *BetaMessageCountTokensParams) UnmarshalJSON(data []byte) error

type BetaMessageCountTokensParamsSpeed

type BetaMessageCountTokensParamsSpeed string

Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

const (
	BetaMessageCountTokensParamsSpeedStandard BetaMessageCountTokensParamsSpeed = "standard"
	BetaMessageCountTokensParamsSpeedFast     BetaMessageCountTokensParamsSpeed = "fast"
)

type BetaMessageCountTokensParamsSystemUnion

type BetaMessageCountTokensParamsSystemUnion struct {
	OfString             param.Opt[string]    `json:",omitzero,inline"`
	OfBetaTextBlockArray []BetaTextBlockParam `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 (BetaMessageCountTokensParamsSystemUnion) MarshalJSON

func (u BetaMessageCountTokensParamsSystemUnion) MarshalJSON() ([]byte, error)

func (*BetaMessageCountTokensParamsSystemUnion) UnmarshalJSON

func (u *BetaMessageCountTokensParamsSystemUnion) UnmarshalJSON(data []byte) error

type BetaMessageCountTokensParamsToolUnion

type BetaMessageCountTokensParamsToolUnion struct {
	OfTool                        *BetaToolParam                        `json:",omitzero,inline"`
	OfBashTool20241022            *BetaToolBash20241022Param            `json:",omitzero,inline"`
	OfBashTool20250124            *BetaToolBash20250124Param            `json:",omitzero,inline"`
	OfCodeExecutionTool20250522   *BetaCodeExecutionTool20250522Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20250825   *BetaCodeExecutionTool20250825Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20260120   *BetaCodeExecutionTool20260120Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20260521   *BetaCodeExecutionTool20260521Param   `json:",omitzero,inline"`
	OfComputerUseTool20241022     *BetaToolComputerUse20241022Param     `json:",omitzero,inline"`
	OfMemoryTool20250818          *BetaMemoryTool20250818Param          `json:",omitzero,inline"`
	OfComputerUseTool20250124     *BetaToolComputerUse20250124Param     `json:",omitzero,inline"`
	OfTextEditor20241022          *BetaToolTextEditor20241022Param      `json:",omitzero,inline"`
	OfComputerUseTool20251124     *BetaToolComputerUse20251124Param     `json:",omitzero,inline"`
	OfTextEditor20250124          *BetaToolTextEditor20250124Param      `json:",omitzero,inline"`
	OfTextEditor20250429          *BetaToolTextEditor20250429Param      `json:",omitzero,inline"`
	OfTextEditor20250728          *BetaToolTextEditor20250728Param      `json:",omitzero,inline"`
	OfWebSearchTool20250305       *BetaWebSearchTool20250305Param       `json:",omitzero,inline"`
	OfWebFetchTool20250910        *BetaWebFetchTool20250910Param        `json:",omitzero,inline"`
	OfWebSearchTool20260209       *BetaWebSearchTool20260209Param       `json:",omitzero,inline"`
	OfWebFetchTool20260209        *BetaWebFetchTool20260209Param        `json:",omitzero,inline"`
	OfWebFetchTool20260309        *BetaWebFetchTool20260309Param        `json:",omitzero,inline"`
	OfWebSearchTool20260318       *BetaWebSearchTool20260318Param       `json:",omitzero,inline"`
	OfWebFetchTool20260318        *BetaWebFetchTool20260318Param        `json:",omitzero,inline"`
	OfAdvisorTool20260301         *BetaAdvisorTool20260301Param         `json:",omitzero,inline"`
	OfToolSearchToolBm25_20251119 *BetaToolSearchToolBm25_20251119Param `json:",omitzero,inline"`
	OfToolSearchToolRegex20251119 *BetaToolSearchToolRegex20251119Param `json:",omitzero,inline"`
	OfMCPToolset                  *BetaMCPToolsetParam                  `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 (BetaMessageCountTokensParamsToolUnion) GetAllowedCallers

func (u BetaMessageCountTokensParamsToolUnion) GetAllowedCallers() []string

Returns a pointer to the underlying variant's AllowedCallers property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetAllowedDomains

func (u BetaMessageCountTokensParamsToolUnion) GetAllowedDomains() []string

Returns a pointer to the underlying variant's AllowedDomains property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetBlockedDomains

func (u BetaMessageCountTokensParamsToolUnion) GetBlockedDomains() []string

Returns a pointer to the underlying variant's BlockedDomains property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetCacheControl

Returns a pointer to the underlying variant's CacheControl property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetCaching

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetCitations

Returns a pointer to the underlying variant's Citations property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetConfigs

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetDefaultConfig

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetDeferLoading

func (u BetaMessageCountTokensParamsToolUnion) GetDeferLoading() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetDescription

func (u BetaMessageCountTokensParamsToolUnion) GetDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetDisplayHeightPx

func (u BetaMessageCountTokensParamsToolUnion) GetDisplayHeightPx() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetDisplayNumber

func (u BetaMessageCountTokensParamsToolUnion) GetDisplayNumber() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetDisplayWidthPx

func (u BetaMessageCountTokensParamsToolUnion) GetDisplayWidthPx() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetEagerInputStreaming

func (u BetaMessageCountTokensParamsToolUnion) GetEagerInputStreaming() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetEnableZoom

func (u BetaMessageCountTokensParamsToolUnion) GetEnableZoom() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetInputExamples

func (u BetaMessageCountTokensParamsToolUnion) GetInputExamples() []map[string]any

Returns a pointer to the underlying variant's InputExamples property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetInputSchema

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetMCPServerName

func (u BetaMessageCountTokensParamsToolUnion) GetMCPServerName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetMaxCharacters

func (u BetaMessageCountTokensParamsToolUnion) GetMaxCharacters() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetMaxContentTokens

func (u BetaMessageCountTokensParamsToolUnion) GetMaxContentTokens() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetMaxTokens

func (u BetaMessageCountTokensParamsToolUnion) GetMaxTokens() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetMaxUses

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetModel

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetName

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetResponseInclusion

func (u BetaMessageCountTokensParamsToolUnion) GetResponseInclusion() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetStrict

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetUseCache

Returns a pointer to the underlying variant's property, if present.

func (BetaMessageCountTokensParamsToolUnion) GetUserLocation

Returns a pointer to the underlying variant's UserLocation property, if present.

func (BetaMessageCountTokensParamsToolUnion) MarshalJSON

func (u BetaMessageCountTokensParamsToolUnion) MarshalJSON() ([]byte, error)

func (*BetaMessageCountTokensParamsToolUnion) UnmarshalJSON

func (u *BetaMessageCountTokensParamsToolUnion) UnmarshalJSON(data []byte) error

type BetaMessageDeltaUsage

type BetaMessageDeltaUsage struct {
	// The cumulative number of input tokens used to create the cache entry.
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// The cumulative number of input tokens read from the cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// Outcome of the `fallback_credit_token` presented on this request.
	FallbackCredit BetaFallbackCreditUsage `json:"fallback_credit" api:"required"`
	// The cumulative number of input tokens which were used.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// Per-iteration token usage breakdown.
	//
	// Each entry represents one sampling iteration, with its own input/output token
	// counts and cache statistics. This allows you to:
	//
	// - Determine which iterations exceeded long context thresholds (>=200k tokens)
	// - Calculate the true context window size from the last iteration
	// - Understand token accumulation across server-side tool use loops
	Iterations BetaIterationsUsage `json:"iterations" api:"required"`
	// The cumulative number of output tokens which were used.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// Breakdown of output tokens by category.
	//
	// `output_tokens` remains the inclusive, authoritative total used for billing.
	// This object provides a read-only decomposition for observability — for example,
	// how many of the billed output tokens were spent on internal reasoning that may
	// have been summarized before being returned to you.
	OutputTokensDetails BetaOutputTokensDetails `json:"output_tokens_details" api:"required"`
	// The number of server tool requests.
	ServerToolUse BetaServerToolUsage `json:"server_tool_use" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		FallbackCredit           respjson.Field
		InputTokens              respjson.Field
		Iterations               respjson.Field
		OutputTokens             respjson.Field
		OutputTokensDetails      respjson.Field
		ServerToolUse            respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMessageDeltaUsage) RawJSON

func (r BetaMessageDeltaUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaMessageDeltaUsage) UnmarshalJSON

func (r *BetaMessageDeltaUsage) UnmarshalJSON(data []byte) error

type BetaMessageIterationUsage

type BetaMessageIterationUsage struct {
	// Breakdown of cached tokens by TTL
	CacheCreation BetaCacheCreation `json:"cache_creation" api:"required"`
	// The number of input tokens used to create the cache entry.
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// The number of input tokens read from the cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// The number of input tokens which were used.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model" api:"required"`
	// The number of output tokens which were used.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// Usage for a sampling iteration
	Type constant.Message `json:"type" default:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreation            respjson.Field
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		Model                    respjson.Field
		OutputTokens             respjson.Field
		Type                     respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Token usage for a sampling iteration.

func (BetaMessageIterationUsage) RawJSON

func (r BetaMessageIterationUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaMessageIterationUsage) UnmarshalJSON

func (r *BetaMessageIterationUsage) UnmarshalJSON(data []byte) error

type BetaMessageNewParams

type BetaMessageNewParams struct {
	// The maximum number of tokens to generate before stopping.
	//
	// Note that our models may stop _before_ reaching this maximum. This parameter
	// only specifies the absolute maximum number of tokens to generate.
	//
	// Set to `0` to populate the
	// [prompt cache](https://platform.haijun.com/docs/en/build-with-haijun/prompt-caching#pre-warming-the-cache)
	// without generating a response.
	//
	// Different models have different maximum values for this parameter. See
	// [models](https://platform.haijun.com/docs/en/about-haijun/models/overview) for
	// details.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Input messages.
	//
	// Our models are trained to operate on alternating `user` and `assistant`
	// conversational turns. When creating a new `Message`, you specify the prior
	// conversational turns with the `messages` parameter, and the model then generates
	// the next `Message` in the conversation. Consecutive `user` or `assistant` turns
	// in your request will be combined into a single turn.
	//
	// Each input message must be an object with a `role` and `content`. You can
	// specify a single `user`-role message, or you can include multiple `user` and
	// `assistant` messages.
	//
	// If the final message uses the `assistant` role, the response content will
	// continue immediately from the content in that message. This can be used to
	// constrain part of the model's response.
	//
	// Example with a single `user` message:
	//
	// “`json
	// [{ "role": "user", "content": "Hello, haijun" }]
	// “`
	//
	// Example with multiple conversational turns:
	//
	// “`json
	// [
	//
	//	{ "role": "user", "content": "Hello there." },
	//	{ "role": "assistant", "content": "Hi, I'm haijun. How can I help you?" },
	//	{ "role": "user", "content": "Can you explain LLMs in plain English?" }
	//
	// ]
	// “`
	//
	// Example with a partially-filled response from haijun:
	//
	// “`json
	// [
	//
	//	{
	//	  "role": "user",
	//	  "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
	//	},
	//	{ "role": "assistant", "content": "The best answer is (" }
	//
	// ]
	// “`
	//
	// Each input message `content` may be either a single `string` or an array of
	// content blocks, where each block has a specific `type`. Using a `string` for
	// `content` is shorthand for an array of one content block of type `"text"`. The
	// following input messages are equivalent:
	//
	// “`json
	// { "role": "user", "content": "Hello, haijun" }
	// “`
	//
	// “`json
	// { "role": "user", "content": [{ "type": "text", "text": "Hello, haijun" }] }
	// “`
	//
	// See
	// [input examples](https://platform.haijun.com/docs/en/build-with-haijun/working-with-messages).
	//
	// Note that if you want to include a
	// [system prompt](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role),
	// you can use the top-level `system` parameter — there is no `"system"` role for
	// input messages in the Messages API.
	//
	// There is a limit of 100,000 messages in a single request.
	Messages []BetaMessageParam `json:"messages,omitzero" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model,omitzero" api:"required"`
	// Specifies the geographic region for inference processing. If not specified, the
	// workspace's `default_inference_geo` is used.
	InferenceGeo param.Opt[string] `json:"inference_geo,omitzero"`
	// Amount of randomness injected into the response.
	//
	// Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
	// for analytical / multiple choice, and closer to `1.0` for creative and
	// generative tasks.
	//
	// Note that even with `temperature` of `0.0`, the results will not be fully
	// deterministic.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Only sample from the top K options for each subsequent token.
	//
	// Used to remove "long tail" low probability responses.
	// [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
	//
	// Recommended for advanced use cases only.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// Use nucleus sampling.
	//
	// In nucleus sampling, we compute the cumulative distribution over all the options
	// for each subsequent token in decreasing probability order and cut it off once it
	// reaches a particular probability specified by `top_p`.
	//
	// Recommended for advanced use cases only.
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// The user profile ID to attribute this request to. Use when acting on behalf of a
	// party other than your organization. Requires the `user-profiles` beta header.
	UserProfileID param.Opt[string] `header:"Juglow-user-profile-id,omitzero" json:"-"`
	// Container identifier for reuse across requests.
	Container BetaMessageNewParamsContainerUnion `json:"container,omitzero"`
	// The `fallback_credit_token` from a prior refusal's `stop_details`.
	//
	// When a preceding request was refused and returned a `fallback_credit_token`,
	// pass that code here on the retry to have the retry's cache-creation tokens for
	// the prefix that was warm on the refused model billed at the cache-read rate.
	// Must be redeemed by the same organization and workspace, with the same request
	// body (optionally extended by one appended `assistant` message whose content is
	// the partial text — with any trailing whitespace stripped from the final text
	// block — and paired server-tool blocks streamed before the refusal; the
	// appended-assistant form is not available for requests with `output_format` set
	// or forced `tool_choice`), on an eligible fallback model, on the same platform,
	// and within 5 minutes of the refusal; a mismatch is a 400. A token minted
	// mid-server-tool-loop whose partial content was continuable may only be redeemed
	// with the appended-assistant form — if an exact-body retry is rejected with a 400
	// saying the token must be redeemed by continuing the partial response, retry with
	// the appended-assistant form instead.
	//
	// When the appended-assistant form is used on a model that otherwise disallows
	// assistant-turn prefill, this token also authorizes that one prefill.
	FallbackCreditToken BetaMessageNewParamsFallbackCreditTokenUnion `json:"fallback_credit_token,omitzero"`
	// Opt-in server-side retry on one or more substitute models when the requested
	// model declines for policy reasons. Tried in order: if the first entry also
	// declines, the second is tried, and so on. The string "default" requests the
	// requested model's server-defined default fallback configuration.
	Fallbacks BetaFallbacksParamUnion `json:"fallbacks,omitzero"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed BetaMessageNewParamsSpeed `json:"speed,omitzero"`
	// Top-level cache control automatically applies a cache_control marker to the last
	// cacheable block in the request.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Context management configuration.
	//
	// This allows you to control how haijun manages context across multiple requests,
	// such as whether to clear function results or not.
	ContextManagement BetaContextManagementConfigParam `json:"context_management,omitzero"`
	// Request-level diagnostics. Currently carries the previous response id for
	// prompt-cache divergence reporting.
	Diagnostics BetaDiagnosticsParam `json:"diagnostics,omitzero"`
	// MCP servers to be utilized in this request
	MCPServers []BetaRequestMCPServerURLDefinitionParam `json:"mcp_servers,omitzero"`
	// An object describing metadata about the request.
	Metadata BetaMetadataParam `json:"metadata,omitzero"`
	// Configuration options for the model's output, such as the output format.
	OutputConfig BetaOutputConfigParam `json:"output_config,omitzero"`
	// Deprecated: Use `output_config.format` instead. See
	// [structured outputs](https://platform.haijun.com/docs/en/build-with-haijun/structured-outputs)
	//
	// A schema to specify haijun's output format in responses. This parameter will be
	// removed in a future release.
	OutputFormat BetaJSONOutputFormatParam `json:"output_format,omitzero"`
	// Determines whether to use priority capacity (if available) or standard capacity
	// for this request.
	//
	// Juglow offers different levels of service for your API requests. See
	// [service-tiers](https://platform.haijun.com/docs/en/api/service-tiers) for
	// details.
	//
	// Any of "auto", "standard_only".
	ServiceTier BetaMessageNewParamsServiceTier `json:"service_tier,omitzero"`
	// Custom text sequences that will cause the model to stop generating.
	//
	// Our models will normally stop when they have naturally completed their turn,
	// which will result in a response `stop_reason` of `"end_turn"`.
	//
	// If you want the model to stop generating when it encounters custom strings of
	// text, you can use the `stop_sequences` parameter. If the model encounters one of
	// the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
	// and the response `stop_sequence` value will contain the matched stop sequence.
	StopSequences []string `json:"stop_sequences,omitzero"`
	// System prompt.
	//
	// A system prompt is a way of providing context and instructions to haijun, such
	// as specifying a particular goal or role. See our
	// [guide to system prompts](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role).
	System []BetaTextBlockParam `json:"system,omitzero"`
	// Configuration for enabling haijun's extended thinking.
	//
	// When enabled, responses include `thinking` content blocks showing haijun's
	// thinking process before the final answer. Requires a minimum budget of 1,024
	// tokens and counts towards your `max_tokens` limit.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	Thinking BetaThinkingConfigParamUnion `json:"thinking,omitzero"`
	// How the model should use the provided tools. The model can use a specific tool,
	// any available tool, decide by itself, or not use tools at all.
	ToolChoice BetaToolChoiceUnionParam `json:"tool_choice,omitzero"`
	// Definitions of tools that the model may use.
	//
	// If you include `tools` in your API request, the model may return `tool_use`
	// content blocks that represent the model's use of those tools. You can then run
	// those tools using the tool input generated by the model and then optionally
	// return results back to the model using `tool_result` content blocks.
	//
	// There are two types of tools: **client tools** and **server tools**. The
	// behavior described below applies to client tools. For
	// [server tools](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/server-tools),
	// see their individual documentation as each has its own behavior (e.g., the
	// [web search tool](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/web-search-tool)).
	//
	// Each tool definition includes:
	//
	//   - `name`: Name of the tool.
	//   - `description`: Optional, but strongly-recommended description of the tool.
	//   - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
	//     tool `input` shape that the model will produce in `tool_use` output content
	//     blocks.
	//
	// For example, if you defined `tools` as:
	//
	// “`json
	// [
	//
	//	{
	//	  "name": "get_stock_price",
	//	  "description": "Get the current stock price for a given ticker symbol.",
	//	  "input_schema": {
	//	    "type": "object",
	//	    "properties": {
	//	      "ticker": {
	//	        "type": "string",
	//	        "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
	//	      }
	//	    },
	//	    "required": ["ticker"]
	//	  }
	//	}
	//
	// ]
	// “`
	//
	// And then asked the model "What's the S&P 500 at today?", the model might produce
	// `tool_use` content blocks in the response like this:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_use",
	//	  "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "name": "get_stock_price",
	//	  "input": { "ticker": "^GSPC" }
	//	}
	//
	// ]
	// “`
	//
	// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
	// input, and return the following back to the model in a subsequent `user`
	// message:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_result",
	//	  "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "content": "259.75 USD"
	//	}
	//
	// ]
	// “`
	//
	// Tools can be used for workflows that include running client-side tools and
	// functions, or more generally whenever you want the model to produce a particular
	// JSON structure of output.
	//
	// See our
	// [guide](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/overview)
	// for more details.
	Tools []BetaToolUnionParam `json:"tools,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaMessageNewParams) MarshalJSON

func (r BetaMessageNewParams) MarshalJSON() (data []byte, err error)

func (*BetaMessageNewParams) UnmarshalJSON

func (r *BetaMessageNewParams) UnmarshalJSON(data []byte) error

type BetaMessageNewParamsContainerUnion

type BetaMessageNewParamsContainerUnion struct {
	OfContainers *BetaContainerParams `json:",omitzero,inline"`
	OfString     param.Opt[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 (BetaMessageNewParamsContainerUnion) MarshalJSON

func (u BetaMessageNewParamsContainerUnion) MarshalJSON() ([]byte, error)

func (*BetaMessageNewParamsContainerUnion) UnmarshalJSON

func (u *BetaMessageNewParamsContainerUnion) UnmarshalJSON(data []byte) error

type BetaMessageNewParamsFallbackCreditTokenUnion

type BetaMessageNewParamsFallbackCreditTokenUnion struct {
	OfString              param.Opt[string]             `json:",omitzero,inline"`
	OfFallbackCreditToken *BetaFallbackCreditTokenParam `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 (BetaMessageNewParamsFallbackCreditTokenUnion) MarshalJSON

func (*BetaMessageNewParamsFallbackCreditTokenUnion) UnmarshalJSON

func (u *BetaMessageNewParamsFallbackCreditTokenUnion) UnmarshalJSON(data []byte) error

type BetaMessageNewParamsServiceTier

type BetaMessageNewParamsServiceTier string

Determines whether to use priority capacity (if available) or standard capacity for this request.

Juglow offers different levels of service for your API requests. See [service-tiers](https://platform.haijun.com/docs/en/api/service-tiers) for details.

const (
	BetaMessageNewParamsServiceTierAuto         BetaMessageNewParamsServiceTier = "auto"
	BetaMessageNewParamsServiceTierStandardOnly BetaMessageNewParamsServiceTier = "standard_only"
)

type BetaMessageNewParamsSpeed

type BetaMessageNewParamsSpeed string

Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

const (
	BetaMessageNewParamsSpeedStandard BetaMessageNewParamsSpeed = "standard"
	BetaMessageNewParamsSpeedFast     BetaMessageNewParamsSpeed = "fast"
)

type BetaMessageParam

type BetaMessageParam struct {
	Content []BetaContentBlockParamUnion `json:"content,omitzero" api:"required"`
	// Any of "user", "assistant", "system".
	Role BetaMessageParamRole `json:"role,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Content, Role are required.

func NewBetaUserMessage

func NewBetaUserMessage(blocks ...BetaContentBlockParamUnion) BetaMessageParam

func (BetaMessageParam) MarshalJSON

func (r BetaMessageParam) MarshalJSON() (data []byte, err error)

func (*BetaMessageParam) UnmarshalJSON

func (r *BetaMessageParam) UnmarshalJSON(data []byte) error

type BetaMessageParamRole

type BetaMessageParamRole string
const (
	BetaMessageParamRoleUser      BetaMessageParamRole = "user"
	BetaMessageParamRoleAssistant BetaMessageParamRole = "assistant"
	BetaMessageParamRoleSystem    BetaMessageParamRole = "system"
)

type BetaMessageService

type BetaMessageService struct {
	Options []option.RequestOption
	Batches BetaMessageBatchService
}

BetaMessageService contains methods and other services that help with interacting with the Juglow 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 NewBetaMessageService method instead.

func NewBetaMessageService

func NewBetaMessageService(opts ...option.RequestOption) (r BetaMessageService)

NewBetaMessageService 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 (*BetaMessageService) CountTokens

Count the number of tokens in a Message.

The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.

Learn more about token counting in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/token-counting)

func (*BetaMessageService) New

Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.

The Messages API can be used for either single queries or stateless multi-turn conversations.

Learn more about the Messages API in our [user guide](https://platform.haijun.com/docs/en/get-started)

Note: If you choose to set a timeout for this request, we recommend 10 minutes.

func (*BetaMessageService) NewStreaming

Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.

The Messages API can be used for either single queries or stateless multi-turn conversations.

Learn more about the Messages API in our [user guide](https://platform.haijun.com/docs/en/get-started)

Note: If you choose to set a timeout for this request, we recommend 10 minutes.

func (*BetaMessageService) NewToolRunner

func (r *BetaMessageService) NewToolRunner(tools []BetaTool, params BetaToolRunnerParams, opts ...option.RequestOption) *BetaToolRunner

NewToolRunner creates a BetaToolRunner that automatically handles the loop between the model generating tool calls, executing those tool calls, and sending the results back to the model until a final answer is produced or the maximum number of iterations is reached.

func (*BetaMessageService) NewToolRunnerStreaming

func (r *BetaMessageService) NewToolRunnerStreaming(tools []BetaTool, params BetaToolRunnerParams, opts ...option.RequestOption) *BetaToolRunnerStreaming

NewToolRunnerStreaming creates a BetaToolRunnerStreaming that automatically handles the loop between the model generating tool calls, executing those tool calls, and sending the results back to the model using streaming API calls until a final answer is produced or the maximum number of iterations is reached.

type BetaMessageTokensCount

type BetaMessageTokensCount struct {
	// Information about context management applied to the message.
	ContextManagement BetaCountTokensContextManagementResponse `json:"context_management" api:"required"`
	// The total number of tokens across the provided list of messages, system prompt,
	// and tools.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ContextManagement respjson.Field
		InputTokens       respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaMessageTokensCount) RawJSON

func (r BetaMessageTokensCount) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaMessageTokensCount) UnmarshalJSON

func (r *BetaMessageTokensCount) UnmarshalJSON(data []byte) error

type BetaMetadataParam

type BetaMetadataParam struct {
	// An external identifier for the user who is associated with the request.
	//
	// This should be a uuid, hash value, or other opaque identifier. Juglow may use
	// this id to help detect abuse. Do not include any identifying information such as
	// name, email address, or phone number.
	UserID param.Opt[string] `json:"user_id,omitzero"`
	// contains filtered or unexported fields
}

func (BetaMetadataParam) MarshalJSON

func (r BetaMetadataParam) MarshalJSON() (data []byte, err error)

func (*BetaMetadataParam) UnmarshalJSON

func (r *BetaMetadataParam) UnmarshalJSON(data []byte) error

type BetaMidConversationSystemBlockParam

type BetaMidConversationSystemBlockParam struct {
	// System instruction text blocks.
	Content []BetaMidConversationSystemBlockParamContentUnion `json:"content,omitzero" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "mid_conv_system".
	Type constant.MidConvSystem `json:"type" default:"mid_conv_system"`
	// contains filtered or unexported fields
}

System instructions that appear mid-conversation.

Use this block to provide or update system-level instructions at a specific point in the conversation, rather than only via the top-level `system` parameter.

The properties Content, Type are required.

func (BetaMidConversationSystemBlockParam) MarshalJSON

func (r BetaMidConversationSystemBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaMidConversationSystemBlockParam) UnmarshalJSON

func (r *BetaMidConversationSystemBlockParam) UnmarshalJSON(data []byte) error

type BetaMidConversationSystemBlockParamContentUnion

type BetaMidConversationSystemBlockParamContentUnion struct {
	OfText         *BetaTextBlockParam                `json:",omitzero,inline"`
	OfToolAddition *BetaRequestToolAdditionBlockParam `json:",omitzero,inline"`
	OfToolRemoval  *BetaRequestToolRemovalBlockParam  `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 (BetaMidConversationSystemBlockParamContentUnion) GetCacheControl

Returns a pointer to the underlying variant's CacheControl property, if present.

func (BetaMidConversationSystemBlockParamContentUnion) GetCitations

Returns a pointer to the underlying variant's property, if present.

func (BetaMidConversationSystemBlockParamContentUnion) GetText

Returns a pointer to the underlying variant's property, if present.

func (BetaMidConversationSystemBlockParamContentUnion) GetTool

func (u BetaMidConversationSystemBlockParamContentUnion) GetTool() (res betaMidConversationSystemBlockParamContentUnionTool)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaMidConversationSystemBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaMidConversationSystemBlockParamContentUnion) MarshalJSON

func (*BetaMidConversationSystemBlockParamContentUnion) UnmarshalJSON

type BetaModelCapabilities

type BetaModelCapabilities struct {
	// Whether the model supports the Batch API.
	Batch BetaCapabilitySupport `json:"batch" api:"required"`
	// Whether the model supports citation generation.
	Citations BetaCapabilitySupport `json:"citations" api:"required"`
	// Whether the model supports code execution tools.
	CodeExecution BetaCapabilitySupport `json:"code_execution" api:"required"`
	// Context management support and available strategies.
	ContextManagement BetaContextManagementCapability `json:"context_management" api:"required"`
	// Effort (reasoning_effort) support and available levels.
	Effort BetaEffortCapability `json:"effort" api:"required"`
	// Whether the model accepts image content blocks.
	ImageInput BetaCapabilitySupport `json:"image_input" api:"required"`
	// Whether the model accepts PDF content blocks.
	PDFInput BetaCapabilitySupport `json:"pdf_input" api:"required"`
	// Whether the model supports structured output / JSON mode / strict tool schemas.
	StructuredOutputs BetaCapabilitySupport `json:"structured_outputs" api:"required"`
	// Thinking capability and supported type configurations.
	Thinking BetaThinkingCapability `json:"thinking" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Batch             respjson.Field
		Citations         respjson.Field
		CodeExecution     respjson.Field
		ContextManagement respjson.Field
		Effort            respjson.Field
		ImageInput        respjson.Field
		PDFInput          respjson.Field
		StructuredOutputs respjson.Field
		Thinking          respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Model capability information.

func (BetaModelCapabilities) RawJSON

func (r BetaModelCapabilities) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaModelCapabilities) UnmarshalJSON

func (r *BetaModelCapabilities) UnmarshalJSON(data []byte) error

type BetaModelGetParams

type BetaModelGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaModelInfo

type BetaModelInfo struct {
	// Unique model identifier.
	ID string `json:"id" api:"required"`
	// Model IDs this model accepts as `fallbacks[i].model` on the Messages API. An
	// empty list means the `fallbacks` parameter is not supported for this model as
	// primary.
	AllowedFallbackModels []string `json:"allowed_fallback_models" api:"required"`
	// Model capability information.
	Capabilities BetaModelCapabilities `json:"capabilities" api:"required"`
	// RFC 3339 datetime string representing the time at which the model was released.
	// May be set to an epoch value if the release date is unknown.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// A human-readable name for the model.
	DisplayName string `json:"display_name" api:"required"`
	// Maximum input context window size in tokens for this model.
	MaxInputTokens int64 `json:"max_input_tokens" api:"required"`
	// Maximum value for the `max_tokens` parameter when using this model.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Object type.
	//
	// For Models, this is always `"model"`.
	Type constant.Model `json:"type" default:"model"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		AllowedFallbackModels respjson.Field
		Capabilities          respjson.Field
		CreatedAt             respjson.Field
		DisplayName           respjson.Field
		MaxInputTokens        respjson.Field
		MaxTokens             respjson.Field
		Type                  respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaModelInfo) RawJSON

func (r BetaModelInfo) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaModelInfo) UnmarshalJSON

func (r *BetaModelInfo) UnmarshalJSON(data []byte) error

type BetaModelListParams

type BetaModelListParams struct {
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately after this object.
	AfterID param.Opt[string] `query:"after_id,omitzero" json:"-"`
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately before this object.
	BeforeID param.Opt[string] `query:"before_id,omitzero" json:"-"`
	// Number of items to return per page.
	//
	// Defaults to `20`. Ranges from `1` to `1000`.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaModelListParams) URLQuery

func (r BetaModelListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaModelListParams's query parameters as `url.Values`.

type BetaModelService

type BetaModelService struct {
	Options []option.RequestOption
}

BetaModelService contains methods and other services that help with interacting with the Juglow 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 NewBetaModelService method instead.

func NewBetaModelService

func NewBetaModelService(opts ...option.RequestOption) (r BetaModelService)

NewBetaModelService 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 (*BetaModelService) Get

func (r *BetaModelService) Get(ctx context.Context, modelID string, query BetaModelGetParams, opts ...option.RequestOption) (res *BetaModelInfo, err error)

Get a specific model.

The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.

func (*BetaModelService) List

List available models.

The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.

func (*BetaModelService) ListAutoPaging

List available models.

The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.

type BetaMonetaryAmount

type BetaMonetaryAmount struct {
	// Amount in minor units of the currency, as an integer decimal string with no
	// leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a
	// number so no float rounding is ever applied.
	Amount string `json:"amount" api:"required"`
	// Uppercase ISO-4217 currency code. `USD` is the only currency currently
	// supported; the accepted set is closed and grows only when a new currency is
	// priced.
	//
	// Any of "USD".
	Currency BetaCurrency `json:"currency" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Amount      respjson.Field
		Currency    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A monetary amount in a specific currency.

func (BetaMonetaryAmount) RawJSON

func (r BetaMonetaryAmount) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaMonetaryAmount) ToParam

ToParam converts this BetaMonetaryAmount to a BetaMonetaryAmountParam.

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 BetaMonetaryAmountParam.Overrides()

func (*BetaMonetaryAmount) UnmarshalJSON

func (r *BetaMonetaryAmount) UnmarshalJSON(data []byte) error

type BetaMonetaryAmountParam

type BetaMonetaryAmountParam struct {
	// Amount in minor units of the currency, as an integer decimal string with no
	// leading zeros: "2500" is $25.00 and "50" is fifty cents. A string rather than a
	// number so no float rounding is ever applied.
	Amount string `json:"amount" api:"required"`
	// Uppercase ISO-4217 currency code. `USD` is the only currency currently
	// supported; the accepted set is closed and grows only when a new currency is
	// priced.
	//
	// Any of "USD".
	Currency BetaCurrency `json:"currency,omitzero" api:"required"`
	// contains filtered or unexported fields
}

A monetary amount in a specific currency.

The properties Amount, Currency are required.

func (BetaMonetaryAmountParam) MarshalJSON

func (r BetaMonetaryAmountParam) MarshalJSON() (data []byte, err error)

func (*BetaMonetaryAmountParam) UnmarshalJSON

func (r *BetaMonetaryAmountParam) UnmarshalJSON(data []byte) error

type BetaNotFoundError

type BetaNotFoundError struct {
	Message string                 `json:"message" api:"required"`
	Type    constant.NotFoundError `json:"type" default:"not_found_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaNotFoundError) RawJSON

func (r BetaNotFoundError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaNotFoundError) UnmarshalJSON

func (r *BetaNotFoundError) UnmarshalJSON(data []byte) error

type BetaOutputConfigEffort

type BetaOutputConfigEffort string

All possible effort levels.

const (
	BetaOutputConfigEffortLow    BetaOutputConfigEffort = "low"
	BetaOutputConfigEffortMedium BetaOutputConfigEffort = "medium"
	BetaOutputConfigEffortHigh   BetaOutputConfigEffort = "high"
	BetaOutputConfigEffortXhigh  BetaOutputConfigEffort = "xhigh"
	BetaOutputConfigEffortMax    BetaOutputConfigEffort = "max"
)

type BetaOutputConfigParam

type BetaOutputConfigParam struct {
	// All possible effort levels.
	//
	// Any of "low", "medium", "high", "xhigh", "max".
	Effort BetaOutputConfigEffort `json:"effort,omitzero"`
	// A schema to specify haijun's output format in responses. See
	// [structured outputs](https://platform.haijun.com/docs/en/build-with-haijun/structured-outputs)
	Format BetaJSONOutputFormatParam `json:"format,omitzero"`
	// User-configurable total token budget across contexts.
	TaskBudget BetaTokenTaskBudgetParam `json:"task_budget,omitzero"`
	// contains filtered or unexported fields
}

func (BetaOutputConfigParam) MarshalJSON

func (r BetaOutputConfigParam) MarshalJSON() (data []byte, err error)

func (*BetaOutputConfigParam) UnmarshalJSON

func (r *BetaOutputConfigParam) UnmarshalJSON(data []byte) error

type BetaOutputTokensDetails

type BetaOutputTokensDetails struct {
	// Number of output tokens the model generated as internal reasoning, including the
	// thinking-block delimiter tokens.
	//
	// Reflects the raw reasoning the model produced, not the (possibly shorter)
	// summarized thinking text returned in the response body. Computed by
	// re-tokenizing the raw reasoning text, so it may differ from the model's exact
	// generation count by a small number of tokens. Always ≤ `output_tokens`;
	// `output_tokens - thinking_tokens` approximates the non-reasoning output.
	ThinkingTokens int64 `json:"thinking_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ThinkingTokens respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaOutputTokensDetails) RawJSON

func (r BetaOutputTokensDetails) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaOutputTokensDetails) UnmarshalJSON

func (r *BetaOutputTokensDetails) UnmarshalJSON(data []byte) error

type BetaOverloadedError

type BetaOverloadedError struct {
	Message string                   `json:"message" api:"required"`
	Type    constant.OverloadedError `json:"type" default:"overloaded_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaOverloadedError) RawJSON

func (r BetaOverloadedError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaOverloadedError) UnmarshalJSON

func (r *BetaOverloadedError) UnmarshalJSON(data []byte) error

type BetaPackages

type BetaPackages struct {
	// Ubuntu/Debian packages to install
	Apt []string `json:"apt" api:"required"`
	// Rust packages to install
	Cargo []string `json:"cargo" api:"required"`
	// Ruby packages to install
	Gem []string `json:"gem" api:"required"`
	// Go packages to install
	Go []string `json:"go" api:"required"`
	// Node.js packages to install
	Npm []string `json:"npm" api:"required"`
	// Python packages to install
	Pip []string `json:"pip" api:"required"`
	// Package configuration type
	//
	// Any of "packages".
	Type BetaPackagesType `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Apt         respjson.Field
		Cargo       respjson.Field
		Gem         respjson.Field
		Go          respjson.Field
		Npm         respjson.Field
		Pip         respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Packages (and their versions) available in this environment.

func (BetaPackages) RawJSON

func (r BetaPackages) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaPackages) UnmarshalJSON

func (r *BetaPackages) UnmarshalJSON(data []byte) error

type BetaPackagesParams

type BetaPackagesParams struct {
	// Ubuntu/Debian packages to install
	Apt []string `json:"apt,omitzero"`
	// Rust packages to install
	Cargo []string `json:"cargo,omitzero"`
	// Ruby packages to install
	Gem []string `json:"gem,omitzero"`
	// Go packages to install
	Go []string `json:"go,omitzero"`
	// Node.js packages to install
	Npm []string `json:"npm,omitzero"`
	// Python packages to install
	Pip []string `json:"pip,omitzero"`
	// Package configuration type
	//
	// Any of "packages".
	Type BetaPackagesParamsType `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Specify packages (and optionally their versions) available in this environment.

When versioning, use the version semantics relevant for the package manager, e.g. for `pip` use `package==1.0.0`. You are responsible for validating the package and version exist. Unversioned installs the latest.

func (BetaPackagesParams) MarshalJSON

func (r BetaPackagesParams) MarshalJSON() (data []byte, err error)

func (*BetaPackagesParams) UnmarshalJSON

func (r *BetaPackagesParams) UnmarshalJSON(data []byte) error

type BetaPackagesParamsType

type BetaPackagesParamsType string

Package configuration type

const (
	BetaPackagesParamsTypePackages BetaPackagesParamsType = "packages"
)

type BetaPackagesType

type BetaPackagesType string

Package configuration type

const (
	BetaPackagesTypePackages BetaPackagesType = "packages"
)

type BetaPermissionError

type BetaPermissionError struct {
	Message string                   `json:"message" api:"required"`
	Type    constant.PermissionError `json:"type" default:"permission_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaPermissionError) RawJSON

func (r BetaPermissionError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaPermissionError) UnmarshalJSON

func (r *BetaPermissionError) UnmarshalJSON(data []byte) error

type BetaPlainTextSource

type BetaPlainTextSource struct {
	Data      string             `json:"data" api:"required"`
	MediaType constant.TextPlain `json:"media_type" default:"text/plain"`
	Type      constant.Text      `json:"type" default:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		MediaType   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaPlainTextSource) RawJSON

func (r BetaPlainTextSource) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaPlainTextSource) ToParam

ToParam converts this BetaPlainTextSource to a BetaPlainTextSourceParam.

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 BetaPlainTextSourceParam.Overrides()

func (*BetaPlainTextSource) UnmarshalJSON

func (r *BetaPlainTextSource) UnmarshalJSON(data []byte) error

type BetaPlainTextSourceParam

type BetaPlainTextSourceParam struct {
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as "text/plain".
	MediaType constant.TextPlain `json:"media_type" default:"text/plain"`
	// This field can be elided, and will marshal its zero value as "text".
	Type constant.Text `json:"type" default:"text"`
	// contains filtered or unexported fields
}

The properties Data, MediaType, Type are required.

func (BetaPlainTextSourceParam) MarshalJSON

func (r BetaPlainTextSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaPlainTextSourceParam) UnmarshalJSON

func (r *BetaPlainTextSourceParam) UnmarshalJSON(data []byte) error

type BetaRateLimitError

type BetaRateLimitError struct {
	Message string                  `json:"message" api:"required"`
	Type    constant.RateLimitError `json:"type" default:"rate_limit_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaRateLimitError) RawJSON

func (r BetaRateLimitError) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaRateLimitError) UnmarshalJSON

func (r *BetaRateLimitError) UnmarshalJSON(data []byte) error

type BetaRawContentBlockDeltaEvent

type BetaRawContentBlockDeltaEvent struct {
	Delta BetaRawContentBlockDeltaUnion `json:"delta" api:"required"`
	Index int64                         `json:"index" api:"required"`
	Type  constant.ContentBlockDelta    `json:"type" default:"content_block_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Delta       respjson.Field
		Index       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaRawContentBlockDeltaEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaRawContentBlockDeltaEvent) UnmarshalJSON

func (r *BetaRawContentBlockDeltaEvent) UnmarshalJSON(data []byte) error

type BetaRawContentBlockDeltaUnion

type BetaRawContentBlockDeltaUnion struct {
	// This field is from variant [BetaTextDelta].
	Text string `json:"text"`
	// Any of "text_delta", "input_json_delta", "citations_delta", "thinking_delta",
	// "signature_delta", "compaction_delta".
	Type string `json:"type"`
	// This field is from variant [BetaInputJSONDelta].
	PartialJSON string `json:"partial_json"`
	// This field is from variant [BetaCitationsDelta].
	Citation BetaCitationsDeltaCitationUnion `json:"citation"`
	// This field is from variant [BetaThinkingDelta].
	EstimatedTokens int64 `json:"estimated_tokens"`
	// This field is from variant [BetaThinkingDelta].
	Thinking string `json:"thinking"`
	// This field is from variant [BetaSignatureDelta].
	Signature string `json:"signature"`
	// This field is from variant [BetaCompactionContentBlockDelta].
	Content string `json:"content"`
	// This field is from variant [BetaCompactionContentBlockDelta].
	EncryptedContent string `json:"encrypted_content"`
	JSON             struct {
		Text             respjson.Field
		Type             respjson.Field
		PartialJSON      respjson.Field
		Citation         respjson.Field
		EstimatedTokens  respjson.Field
		Thinking         respjson.Field
		Signature        respjson.Field
		Content          respjson.Field
		EncryptedContent respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaRawContentBlockDeltaUnion contains all possible properties and values from BetaTextDelta, BetaInputJSONDelta, BetaCitationsDelta, BetaThinkingDelta, BetaSignatureDelta, BetaCompactionContentBlockDelta.

Use the BetaRawContentBlockDeltaUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaRawContentBlockDeltaUnion) AsAny

func (u BetaRawContentBlockDeltaUnion) AsAny() anyBetaRawContentBlockDelta

Use the following switch statement to find the correct variant

switch variant := BetaRawContentBlockDeltaUnion.AsAny().(type) {
case Juglow.BetaTextDelta:
case Juglow.BetaInputJSONDelta:
case Juglow.BetaCitationsDelta:
case Juglow.BetaThinkingDelta:
case Juglow.BetaSignatureDelta:
case Juglow.BetaCompactionContentBlockDelta:
default:
  fmt.Errorf("no variant present")
}

func (BetaRawContentBlockDeltaUnion) AsCitationsDelta

func (u BetaRawContentBlockDeltaUnion) AsCitationsDelta() (v BetaCitationsDelta)

func (BetaRawContentBlockDeltaUnion) AsCompactionDelta

func (BetaRawContentBlockDeltaUnion) AsInputJSONDelta

func (u BetaRawContentBlockDeltaUnion) AsInputJSONDelta() (v BetaInputJSONDelta)

func (BetaRawContentBlockDeltaUnion) AsSignatureDelta

func (u BetaRawContentBlockDeltaUnion) AsSignatureDelta() (v BetaSignatureDelta)

func (BetaRawContentBlockDeltaUnion) AsTextDelta

func (u BetaRawContentBlockDeltaUnion) AsTextDelta() (v BetaTextDelta)

func (BetaRawContentBlockDeltaUnion) AsThinkingDelta

func (u BetaRawContentBlockDeltaUnion) AsThinkingDelta() (v BetaThinkingDelta)

func (BetaRawContentBlockDeltaUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaRawContentBlockDeltaUnion) UnmarshalJSON

func (r *BetaRawContentBlockDeltaUnion) UnmarshalJSON(data []byte) error

type BetaRawContentBlockStartEvent

type BetaRawContentBlockStartEvent struct {
	// Response model for a file uploaded to the container.
	ContentBlock BetaRawContentBlockStartEventContentBlockUnion `json:"content_block" api:"required"`
	Index        int64                                          `json:"index" api:"required"`
	Type         constant.ContentBlockStart                     `json:"type" default:"content_block_start"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ContentBlock respjson.Field
		Index        respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaRawContentBlockStartEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaRawContentBlockStartEvent) UnmarshalJSON

func (r *BetaRawContentBlockStartEvent) UnmarshalJSON(data []byte) error

type BetaRawContentBlockStartEventContentBlockUnion

type BetaRawContentBlockStartEventContentBlockUnion struct {
	// This field is from variant [BetaTextBlock].
	Citations []BetaTextCitationUnion `json:"citations"`
	// This field is from variant [BetaTextBlock].
	Text string `json:"text"`
	// Any of "text", "thinking", "redacted_thinking", "tool_use", "server_tool_use",
	// "web_search_tool_result", "web_fetch_tool_result", "advisor_tool_result",
	// "code_execution_tool_result", "bash_code_execution_tool_result",
	// "text_editor_code_execution_tool_result", "tool_search_tool_result",
	// "mcp_tool_use", "mcp_tool_result", "container_upload", "compaction", "fallback".
	Type string `json:"type"`
	// This field is from variant [BetaThinkingBlock].
	Signature string `json:"signature"`
	// This field is from variant [BetaThinkingBlock].
	Thinking string `json:"thinking"`
	// This field is from variant [BetaRedactedThinkingBlock].
	Data  string `json:"data"`
	ID    string `json:"id"`
	Input any    `json:"input"`
	Name  string `json:"name"`
	// This field is a union of [BetaToolUseBlockCallerUnion],
	// [BetaServerToolUseBlockCallerUnion], [BetaWebSearchToolResultBlockCallerUnion],
	// [BetaWebFetchToolResultBlockCallerUnion]
	Caller BetaRawContentBlockStartEventContentBlockUnionCaller `json:"caller"`
	// This field is a union of [BetaWebSearchToolResultBlockContentUnion],
	// [BetaWebFetchToolResultBlockContentUnion],
	// [BetaAdvisorToolResultBlockContentUnion],
	// [BetaCodeExecutionToolResultBlockContentUnion],
	// [BetaBashCodeExecutionToolResultBlockContentUnion],
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion],
	// [BetaToolSearchToolResultBlockContentUnion],
	// [BetaMCPToolResultBlockContentUnion], [string]
	Content   BetaRawContentBlockStartEventContentBlockUnionContent `json:"content"`
	ToolUseID string                                                `json:"tool_use_id"`
	// This field is from variant [BetaMCPToolUseBlock].
	ServerName string `json:"server_name"`
	// This field is from variant [BetaMCPToolResultBlock].
	IsError bool `json:"is_error"`
	// This field is from variant [BetaContainerUploadBlock].
	FileID string `json:"file_id"`
	// This field is from variant [BetaCompactionBlock].
	EncryptedContent string `json:"encrypted_content"`
	// This field is from variant [BetaFallbackBlock].
	From BetaFallbackInfo `json:"from"`
	// This field is from variant [BetaFallbackBlock].
	To BetaFallbackInfo `json:"to"`
	// This field is from variant [BetaFallbackBlock].
	Trigger BetaFallbackRefusalTrigger `json:"trigger"`
	JSON    struct {
		Citations        respjson.Field
		Text             respjson.Field
		Type             respjson.Field
		Signature        respjson.Field
		Thinking         respjson.Field
		Data             respjson.Field
		ID               respjson.Field
		Input            respjson.Field
		Name             respjson.Field
		Caller           respjson.Field
		Content          respjson.Field
		ToolUseID        respjson.Field
		ServerName       respjson.Field
		IsError          respjson.Field
		FileID           respjson.Field
		EncryptedContent respjson.Field
		From             respjson.Field
		To               respjson.Field
		Trigger          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaRawContentBlockStartEventContentBlockUnion contains all possible properties and values from BetaTextBlock, BetaThinkingBlock, BetaRedactedThinkingBlock, BetaToolUseBlock, BetaServerToolUseBlock, BetaWebSearchToolResultBlock, BetaWebFetchToolResultBlock, BetaAdvisorToolResultBlock, BetaCodeExecutionToolResultBlock, BetaBashCodeExecutionToolResultBlock, BetaTextEditorCodeExecutionToolResultBlock, BetaToolSearchToolResultBlock, BetaMCPToolUseBlock, BetaMCPToolResultBlock, BetaContainerUploadBlock, BetaCompactionBlock, BetaFallbackBlock.

Use the BetaRawContentBlockStartEventContentBlockUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaRawContentBlockStartEventContentBlockUnion) AsAdvisorToolResult

func (BetaRawContentBlockStartEventContentBlockUnion) AsAny

func (u BetaRawContentBlockStartEventContentBlockUnion) AsAny() anyBetaRawContentBlockStartEventContentBlock

Use the following switch statement to find the correct variant

switch variant := BetaRawContentBlockStartEventContentBlockUnion.AsAny().(type) {
case Juglow.BetaTextBlock:
case Juglow.BetaThinkingBlock:
case Juglow.BetaRedactedThinkingBlock:
case Juglow.BetaToolUseBlock:
case Juglow.BetaServerToolUseBlock:
case Juglow.BetaWebSearchToolResultBlock:
case Juglow.BetaWebFetchToolResultBlock:
case Juglow.BetaAdvisorToolResultBlock:
case Juglow.BetaCodeExecutionToolResultBlock:
case Juglow.BetaBashCodeExecutionToolResultBlock:
case Juglow.BetaTextEditorCodeExecutionToolResultBlock:
case Juglow.BetaToolSearchToolResultBlock:
case Juglow.BetaMCPToolUseBlock:
case Juglow.BetaMCPToolResultBlock:
case Juglow.BetaContainerUploadBlock:
case Juglow.BetaCompactionBlock:
case Juglow.BetaFallbackBlock:
default:
  fmt.Errorf("no variant present")
}

func (BetaRawContentBlockStartEventContentBlockUnion) AsBashCodeExecutionToolResult

func (BetaRawContentBlockStartEventContentBlockUnion) AsCodeExecutionToolResult

func (BetaRawContentBlockStartEventContentBlockUnion) AsCompaction

func (BetaRawContentBlockStartEventContentBlockUnion) AsContainerUpload

func (BetaRawContentBlockStartEventContentBlockUnion) AsFallback

func (BetaRawContentBlockStartEventContentBlockUnion) AsMCPToolResult

func (BetaRawContentBlockStartEventContentBlockUnion) AsMCPToolUse

func (BetaRawContentBlockStartEventContentBlockUnion) AsRedactedThinking

func (BetaRawContentBlockStartEventContentBlockUnion) AsServerToolUse

func (BetaRawContentBlockStartEventContentBlockUnion) AsText

func (BetaRawContentBlockStartEventContentBlockUnion) AsTextEditorCodeExecutionToolResult

func (BetaRawContentBlockStartEventContentBlockUnion) AsThinking

func (BetaRawContentBlockStartEventContentBlockUnion) AsToolSearchToolResult

func (BetaRawContentBlockStartEventContentBlockUnion) AsToolUse

func (BetaRawContentBlockStartEventContentBlockUnion) AsWebFetchToolResult

func (BetaRawContentBlockStartEventContentBlockUnion) AsWebSearchToolResult

func (BetaRawContentBlockStartEventContentBlockUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaRawContentBlockStartEventContentBlockUnion) UnmarshalJSON

type BetaRawContentBlockStartEventContentBlockUnionCaller

type BetaRawContentBlockStartEventContentBlockUnionCaller struct {
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaRawContentBlockStartEventContentBlockUnionCaller is an implicit subunion of BetaRawContentBlockStartEventContentBlockUnion. BetaRawContentBlockStartEventContentBlockUnionCaller provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaRawContentBlockStartEventContentBlockUnion.

func (*BetaRawContentBlockStartEventContentBlockUnionCaller) UnmarshalJSON

type BetaRawContentBlockStartEventContentBlockUnionContent

type BetaRawContentBlockStartEventContentBlockUnionContent struct {
	// This field will be present if the value is a [[]BetaWebSearchResultBlock]
	// instead of an object.
	OfBetaWebSearchResultBlockArray []BetaWebSearchResultBlock `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [[]BetaTextBlock] instead of an
	// object.
	OfBetaMCPToolResultBlockContent []BetaTextBlock `json:",inline"`
	ErrorCode                       string          `json:"error_code"`
	Type                            string          `json:"type"`
	// This field is a union of [BetaDocumentBlock], [[]BetaCodeExecutionOutputBlock],
	// [[]BetaCodeExecutionOutputBlock], [[]BetaBashCodeExecutionOutputBlock], [string]
	Content BetaRawContentBlockStartEventContentBlockUnionContentContent `json:"content"`
	// This field is from variant [BetaWebFetchToolResultBlockContentUnion].
	RetrievedAt string `json:"retrieved_at"`
	// This field is from variant [BetaWebFetchToolResultBlockContentUnion].
	URL        string `json:"url"`
	StopReason string `json:"stop_reason"`
	// This field is from variant [BetaAdvisorToolResultBlockContentUnion].
	Text string `json:"text"`
	// This field is from variant [BetaAdvisorToolResultBlockContentUnion].
	EncryptedContent string `json:"encrypted_content"`
	ReturnCode       int64  `json:"return_code"`
	Stderr           string `json:"stderr"`
	Stdout           string `json:"stdout"`
	// This field is from variant [BetaCodeExecutionToolResultBlockContentUnion].
	EncryptedStdout string `json:"encrypted_stdout"`
	ErrorMessage    string `json:"error_message"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	FileType BetaTextEditorCodeExecutionViewResultBlockFileType `json:"file_type"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	NumLines int64 `json:"num_lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	StartLine int64 `json:"start_line"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	TotalLines int64 `json:"total_lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	IsFileUpdate bool `json:"is_file_update"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	Lines []string `json:"lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	NewLines int64 `json:"new_lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	NewStart int64 `json:"new_start"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	OldLines int64 `json:"old_lines"`
	// This field is from variant
	// [BetaTextEditorCodeExecutionToolResultBlockContentUnion].
	OldStart int64 `json:"old_start"`
	// This field is from variant [BetaToolSearchToolResultBlockContentUnion].
	ToolReferences []BetaToolReferenceBlock `json:"tool_references"`
	JSON           struct {
		OfBetaWebSearchResultBlockArray respjson.Field
		OfString                        respjson.Field
		OfBetaMCPToolResultBlockContent respjson.Field
		ErrorCode                       respjson.Field
		Type                            respjson.Field
		Content                         respjson.Field
		RetrievedAt                     respjson.Field
		URL                             respjson.Field
		StopReason                      respjson.Field
		Text                            respjson.Field
		EncryptedContent                respjson.Field
		ReturnCode                      respjson.Field
		Stderr                          respjson.Field
		Stdout                          respjson.Field
		EncryptedStdout                 respjson.Field
		ErrorMessage                    respjson.Field
		FileType                        respjson.Field
		NumLines                        respjson.Field
		StartLine                       respjson.Field
		TotalLines                      respjson.Field
		IsFileUpdate                    respjson.Field
		Lines                           respjson.Field
		NewLines                        respjson.Field
		NewStart                        respjson.Field
		OldLines                        respjson.Field
		OldStart                        respjson.Field
		ToolReferences                  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaRawContentBlockStartEventContentBlockUnionContent is an implicit subunion of BetaRawContentBlockStartEventContentBlockUnion. BetaRawContentBlockStartEventContentBlockUnionContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaRawContentBlockStartEventContentBlockUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaWebSearchResultBlockArray OfString OfBetaMCPToolResultBlockContent]

func (*BetaRawContentBlockStartEventContentBlockUnionContent) UnmarshalJSON

type BetaRawContentBlockStartEventContentBlockUnionContentContent

type BetaRawContentBlockStartEventContentBlockUnionContentContent struct {
	// This field will be present if the value is a [[]BetaCodeExecutionOutputBlock]
	// instead of an object.
	OfContent []BetaCodeExecutionOutputBlock `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field is from variant [BetaDocumentBlock].
	Citations BetaCitationConfig `json:"citations"`
	// This field is from variant [BetaDocumentBlock].
	Source BetaDocumentBlockSourceUnion `json:"source"`
	// This field is from variant [BetaDocumentBlock].
	Title string `json:"title"`
	// This field is from variant [BetaDocumentBlock].
	Type constant.Document `json:"type"`
	JSON struct {
		OfContent respjson.Field
		OfString  respjson.Field
		Citations respjson.Field
		Source    respjson.Field
		Title     respjson.Field
		Type      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaRawContentBlockStartEventContentBlockUnionContentContent is an implicit subunion of BetaRawContentBlockStartEventContentBlockUnion. BetaRawContentBlockStartEventContentBlockUnionContentContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaRawContentBlockStartEventContentBlockUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfContent OfString]

func (*BetaRawContentBlockStartEventContentBlockUnionContentContent) UnmarshalJSON

type BetaRawContentBlockStopEvent

type BetaRawContentBlockStopEvent struct {
	Index int64                     `json:"index" api:"required"`
	Type  constant.ContentBlockStop `json:"type" default:"content_block_stop"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Index       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaRawContentBlockStopEvent) RawJSON

Returns the unmodified JSON received from the API

func (*BetaRawContentBlockStopEvent) UnmarshalJSON

func (r *BetaRawContentBlockStopEvent) UnmarshalJSON(data []byte) error

type BetaRawMessageDeltaEvent

type BetaRawMessageDeltaEvent struct {
	// Information about context management strategies applied during the request
	ContextManagement BetaContextManagementResponse `json:"context_management" api:"required"`
	Delta             BetaRawMessageDeltaEventDelta `json:"delta" api:"required"`
	Type              constant.MessageDelta         `json:"type" default:"message_delta"`
	// Billing and rate-limit usage.
	//
	// Juglow's API bills and rate-limits by token counts, as tokens represent the
	// underlying cost to our systems.
	//
	// Under the hood, the API transforms requests into a format suitable for the
	// model. The model's output then goes through a parsing stage before becoming an
	// API response. As a result, the token counts in `usage` will not match one-to-one
	// with the exact visible content of an API request or response.
	//
	// For example, `output_tokens` will be non-zero, even for an empty string response
	// from haijun.
	//
	// Total input tokens in a request is the summation of `input_tokens`,
	// `cache_creation_input_tokens`, and `cache_read_input_tokens`.
	Usage BetaMessageDeltaUsage `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ContextManagement respjson.Field
		Delta             respjson.Field
		Type              respjson.Field
		Usage             respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaRawMessageDeltaEvent) RawJSON

func (r BetaRawMessageDeltaEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaRawMessageDeltaEvent) UnmarshalJSON

func (r *BetaRawMessageDeltaEvent) UnmarshalJSON(data []byte) error

type BetaRawMessageDeltaEventDelta

type BetaRawMessageDeltaEventDelta struct {
	// Information about the container used in the request (for the code execution
	// tool)
	Container BetaContainer `json:"container" api:"required"`
	// Structured information about a refusal.
	StopDetails BetaRefusalStopDetails `json:"stop_details" api:"required"`
	// Any of "end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn",
	// "compaction", "refusal", "model_context_window_exceeded".
	StopReason   BetaStopReason `json:"stop_reason" api:"required"`
	StopSequence string         `json:"stop_sequence" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Container    respjson.Field
		StopDetails  respjson.Field
		StopReason   respjson.Field
		StopSequence respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaRawMessageDeltaEventDelta) RawJSON

Returns the unmodified JSON received from the API

func (*BetaRawMessageDeltaEventDelta) UnmarshalJSON

func (r *BetaRawMessageDeltaEventDelta) UnmarshalJSON(data []byte) error

type BetaRawMessageStartEvent

type BetaRawMessageStartEvent struct {
	Message BetaMessage           `json:"message" api:"required"`
	Type    constant.MessageStart `json:"type" default:"message_start"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaRawMessageStartEvent) RawJSON

func (r BetaRawMessageStartEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaRawMessageStartEvent) UnmarshalJSON

func (r *BetaRawMessageStartEvent) UnmarshalJSON(data []byte) error

type BetaRawMessageStopEvent

type BetaRawMessageStopEvent struct {
	Type constant.MessageStop `json:"type" default:"message_stop"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaRawMessageStopEvent) RawJSON

func (r BetaRawMessageStopEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaRawMessageStopEvent) UnmarshalJSON

func (r *BetaRawMessageStopEvent) UnmarshalJSON(data []byte) error

type BetaRawMessageStreamEventUnion

type BetaRawMessageStreamEventUnion struct {
	// This field is from variant [BetaRawMessageStartEvent].
	Message BetaMessage `json:"message"`
	// Any of "message_start", "message_delta", "message_stop", "content_block_start",
	// "content_block_delta", "content_block_stop".
	Type string `json:"type"`
	// This field is from variant [BetaRawMessageDeltaEvent].
	ContextManagement BetaContextManagementResponse `json:"context_management"`
	// This field is a union of [BetaRawMessageDeltaEventDelta],
	// [BetaRawContentBlockDeltaUnion]
	Delta BetaRawMessageStreamEventUnionDelta `json:"delta"`
	// This field is from variant [BetaRawMessageDeltaEvent].
	Usage BetaMessageDeltaUsage `json:"usage"`
	// This field is from variant [BetaRawContentBlockStartEvent].
	ContentBlock BetaRawContentBlockStartEventContentBlockUnion `json:"content_block"`
	Index        int64                                          `json:"index"`
	JSON         struct {
		Message           respjson.Field
		Type              respjson.Field
		ContextManagement respjson.Field
		Delta             respjson.Field
		Usage             respjson.Field
		ContentBlock      respjson.Field
		Index             respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaRawMessageStreamEventUnion contains all possible properties and values from BetaRawMessageStartEvent, BetaRawMessageDeltaEvent, BetaRawMessageStopEvent, BetaRawContentBlockStartEvent, BetaRawContentBlockDeltaEvent, BetaRawContentBlockStopEvent.

Use the BetaRawMessageStreamEventUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaRawMessageStreamEventUnion) AsAny

func (u BetaRawMessageStreamEventUnion) AsAny() anyBetaRawMessageStreamEvent

Use the following switch statement to find the correct variant

switch variant := BetaRawMessageStreamEventUnion.AsAny().(type) {
case Juglow.BetaRawMessageStartEvent:
case Juglow.BetaRawMessageDeltaEvent:
case Juglow.BetaRawMessageStopEvent:
case Juglow.BetaRawContentBlockStartEvent:
case Juglow.BetaRawContentBlockDeltaEvent:
case Juglow.BetaRawContentBlockStopEvent:
default:
  fmt.Errorf("no variant present")
}

func (BetaRawMessageStreamEventUnion) AsContentBlockDelta

func (BetaRawMessageStreamEventUnion) AsContentBlockStart

func (BetaRawMessageStreamEventUnion) AsContentBlockStop

func (BetaRawMessageStreamEventUnion) AsMessageDelta

func (BetaRawMessageStreamEventUnion) AsMessageStart

func (BetaRawMessageStreamEventUnion) AsMessageStop

func (BetaRawMessageStreamEventUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaRawMessageStreamEventUnion) UnmarshalJSON

func (r *BetaRawMessageStreamEventUnion) UnmarshalJSON(data []byte) error

type BetaRawMessageStreamEventUnionDelta

type BetaRawMessageStreamEventUnionDelta struct {
	// This field is from variant [BetaRawMessageDeltaEventDelta].
	Container BetaContainer `json:"container"`
	// This field is from variant [BetaRawMessageDeltaEventDelta].
	StopDetails BetaRefusalStopDetails `json:"stop_details"`
	// This field is from variant [BetaRawMessageDeltaEventDelta].
	StopReason BetaStopReason `json:"stop_reason"`
	// This field is from variant [BetaRawMessageDeltaEventDelta].
	StopSequence string `json:"stop_sequence"`
	// This field is from variant [BetaRawContentBlockDeltaUnion].
	Text string `json:"text"`
	Type string `json:"type"`
	// This field is from variant [BetaRawContentBlockDeltaUnion].
	PartialJSON string `json:"partial_json"`
	// This field is from variant [BetaRawContentBlockDeltaUnion].
	Citation BetaCitationsDeltaCitationUnion `json:"citation"`
	// This field is from variant [BetaRawContentBlockDeltaUnion].
	EstimatedTokens int64 `json:"estimated_tokens"`
	// This field is from variant [BetaRawContentBlockDeltaUnion].
	Thinking string `json:"thinking"`
	// This field is from variant [BetaRawContentBlockDeltaUnion].
	Signature string `json:"signature"`
	// This field is from variant [BetaRawContentBlockDeltaUnion].
	Content string `json:"content"`
	// This field is from variant [BetaRawContentBlockDeltaUnion].
	EncryptedContent string `json:"encrypted_content"`
	JSON             struct {
		Container        respjson.Field
		StopDetails      respjson.Field
		StopReason       respjson.Field
		StopSequence     respjson.Field
		Text             respjson.Field
		Type             respjson.Field
		PartialJSON      respjson.Field
		Citation         respjson.Field
		EstimatedTokens  respjson.Field
		Thinking         respjson.Field
		Signature        respjson.Field
		Content          respjson.Field
		EncryptedContent respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaRawMessageStreamEventUnionDelta is an implicit subunion of BetaRawMessageStreamEventUnion. BetaRawMessageStreamEventUnionDelta provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the BetaRawMessageStreamEventUnion.

func (*BetaRawMessageStreamEventUnionDelta) UnmarshalJSON

func (r *BetaRawMessageStreamEventUnionDelta) UnmarshalJSON(data []byte) error

type BetaRedactedThinkingBlock

type BetaRedactedThinkingBlock struct {
	// The contents of this redacted thinking block, returned when portions of the
	// model's thinking were safety-redacted. This field is opaque and encrypted, with
	// no readable content.
	//
	// Pass `redacted_thinking` blocks back to the API unchanged when continuing a
	// multi-turn conversation.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking#redacted-thinking-blocks)
	// for details.
	Data string                    `json:"data" api:"required"`
	Type constant.RedactedThinking `json:"type" default:"redacted_thinking"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaRedactedThinkingBlock) RawJSON

func (r BetaRedactedThinkingBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaRedactedThinkingBlock) ToParam

func (*BetaRedactedThinkingBlock) UnmarshalJSON

func (r *BetaRedactedThinkingBlock) UnmarshalJSON(data []byte) error

type BetaRedactedThinkingBlockParam

type BetaRedactedThinkingBlockParam struct {
	// The `data` value of this redacted thinking block, exactly as returned by the API
	// in a previous response. Opaque and encrypted; pass it back unchanged.
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "redacted_thinking".
	Type constant.RedactedThinking `json:"type" default:"redacted_thinking"`
	// contains filtered or unexported fields
}

The properties Data, Type are required.

func (BetaRedactedThinkingBlockParam) MarshalJSON

func (r BetaRedactedThinkingBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaRedactedThinkingBlockParam) UnmarshalJSON

func (r *BetaRedactedThinkingBlockParam) UnmarshalJSON(data []byte) error

type BetaRefusalStopDetails

type BetaRefusalStopDetails struct {
	// The policy category that triggered a refusal.
	//
	// Any of "cyber", "bio", "frontier_llm", "reasoning_extraction", "general_harms".
	Category BetaRefusalStopDetailsCategory `json:"category" api:"required"`
	// Human-readable explanation of the refusal.
	//
	// This text is not guaranteed to be stable. `null` when no explanation is
	// available for the category.
	Explanation string `json:"explanation" api:"required"`
	// Opaque code that refunds the cache-miss cost when retrying this refused request
	// on the fallback model. Pass it as `fallback_credit_token` on the retry request.
	// Expires 5 minutes after the refusal.
	//
	// The retry is sent either with the same request body (`system`, `messages`,
	// `tools`, and other render-shaping fields), or with the same body plus one
	// appended `assistant` message whose content is the partial text (with any
	// trailing whitespace stripped from the final text block) and paired server-tool
	// blocks from this refusal — which also authorizes that appended turn as an
	// assistant-prefill continuation on models that otherwise disallow prefill. A
	// token minted mid-server-tool-loop whose partial content was continuable may only
	// be redeemed the second way — if a same-body retry is rejected with a 400 saying
	// the token must be redeemed by continuing the partial response, retry the second
	// way instead. Either way: same workspace, same platform; a mismatch is a 400.
	// Resending a token for an already-warm prefix is permitted but yields no
	// additional credit.
	//
	// `null` when the refused model isn't eligible for a fallback credit.
	FallbackCreditToken string `json:"fallback_credit_token" api:"required"`
	// Whether the accompanying `fallback_credit_token` may be redeemed with the
	// appended-assistant retry form. Only set when `fallback_credit_token` is present.
	//
	// `true`: retry by resending the same request body plus one appended `assistant`
	// message whose content is this response's `content` with any trailing whitespace
	// stripped from the final text block and unpaired `tool_use` blocks omitted (the
	// same appended-turn shape described on `fallback_credit_token`), with the token
	// attached. `false`: retry by resending the original request body unchanged, with
	// the token attached — the appended-assistant form is not available for this
	// refusal (no continuable partial content, or the request uses `output_format` or
	// a `tool_choice` that forces tool use). One exception: when the request used
	// `output_format` or a forced `tool_choice` and the refusal arrived after server
	// tools (including MCP connector tools) had already executed, the token may not be
	// redeemable by either retry form; if the exact-body retry is then rejected with a
	// 400 saying the token must be redeemed by continuing the partial response,
	// discard the token and retry without it.
	//
	// Advisory: if an appended-assistant retry is rejected with a 400 despite `true`,
	// fall back to resending the original request body with the token.
	FallbackHasPrefillClaim bool `json:"fallback_has_prefill_claim" api:"required"`
	// The server's suggested retry target for this refusal. Populated when a fallback
	// attempt could not be made (the fallback model's rate limit was exhausted, or it
	// was overloaded); names the fallback model the caller can retry directly. Null
	// otherwise.
	RecommendedModel string           `json:"recommended_model" api:"required"`
	Type             constant.Refusal `json:"type" default:"refusal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Category                respjson.Field
		Explanation             respjson.Field
		FallbackCreditToken     respjson.Field
		FallbackHasPrefillClaim respjson.Field
		RecommendedModel        respjson.Field
		Type                    respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured information about a refusal.

func (BetaRefusalStopDetails) RawJSON

func (r BetaRefusalStopDetails) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaRefusalStopDetails) UnmarshalJSON

func (r *BetaRefusalStopDetails) UnmarshalJSON(data []byte) error

type BetaRefusalStopDetailsCategory

type BetaRefusalStopDetailsCategory string

The policy category that triggered a refusal.

const (
	BetaRefusalStopDetailsCategoryCyber               BetaRefusalStopDetailsCategory = "cyber"
	BetaRefusalStopDetailsCategoryBio                 BetaRefusalStopDetailsCategory = "bio"
	BetaRefusalStopDetailsCategoryFrontierLLM         BetaRefusalStopDetailsCategory = "frontier_llm"
	BetaRefusalStopDetailsCategoryReasoningExtraction BetaRefusalStopDetailsCategory = "reasoning_extraction"
	BetaRefusalStopDetailsCategoryGeneralHarms        BetaRefusalStopDetailsCategory = "general_harms"
)

type BetaRequestDocumentBlockParam

type BetaRequestDocumentBlockParam struct {
	Source  BetaRequestDocumentBlockSourceUnionParam `json:"source,omitzero" api:"required"`
	Context param.Opt[string]                        `json:"context,omitzero"`
	Title   param.Opt[string]                        `json:"title,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	Citations    BetaCitationsConfigParam       `json:"citations,omitzero"`
	// This field can be elided, and will marshal its zero value as "document".
	Type constant.Document `json:"type" default:"document"`
	// contains filtered or unexported fields
}

The properties Source, Type are required.

func (BetaRequestDocumentBlockParam) MarshalJSON

func (r BetaRequestDocumentBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaRequestDocumentBlockParam) UnmarshalJSON

func (r *BetaRequestDocumentBlockParam) UnmarshalJSON(data []byte) error

type BetaRequestDocumentBlockSourceUnionParam

type BetaRequestDocumentBlockSourceUnionParam struct {
	OfBase64  *BetaBase64PDFSourceParam    `json:",omitzero,inline"`
	OfText    *BetaPlainTextSourceParam    `json:",omitzero,inline"`
	OfContent *BetaContentBlockSourceParam `json:",omitzero,inline"`
	OfURL     *BetaURLPDFSourceParam       `json:",omitzero,inline"`
	OfFile    *BetaFileDocumentSourceParam `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 (BetaRequestDocumentBlockSourceUnionParam) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestDocumentBlockSourceUnionParam) GetData

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestDocumentBlockSourceUnionParam) GetFileID

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestDocumentBlockSourceUnionParam) GetMediaType

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestDocumentBlockSourceUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestDocumentBlockSourceUnionParam) GetURL

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestDocumentBlockSourceUnionParam) MarshalJSON

func (*BetaRequestDocumentBlockSourceUnionParam) UnmarshalJSON

func (u *BetaRequestDocumentBlockSourceUnionParam) UnmarshalJSON(data []byte) error

type BetaRequestMCPServerToolConfigurationParam

type BetaRequestMCPServerToolConfigurationParam struct {
	Enabled      param.Opt[bool] `json:"enabled,omitzero"`
	AllowedTools []string        `json:"allowed_tools,omitzero"`
	// contains filtered or unexported fields
}

func (BetaRequestMCPServerToolConfigurationParam) MarshalJSON

func (r BetaRequestMCPServerToolConfigurationParam) MarshalJSON() (data []byte, err error)

func (*BetaRequestMCPServerToolConfigurationParam) UnmarshalJSON

func (r *BetaRequestMCPServerToolConfigurationParam) UnmarshalJSON(data []byte) error

type BetaRequestMCPServerURLDefinitionParam

type BetaRequestMCPServerURLDefinitionParam struct {
	Name               string                                     `json:"name" api:"required"`
	URL                string                                     `json:"url" api:"required"`
	AuthorizationToken param.Opt[string]                          `json:"authorization_token,omitzero"`
	ToolConfiguration  BetaRequestMCPServerToolConfigurationParam `json:"tool_configuration,omitzero"`
	// This field can be elided, and will marshal its zero value as "url".
	Type constant.URL `json:"type" default:"url"`
	// contains filtered or unexported fields
}

The properties Name, Type, URL are required.

func (BetaRequestMCPServerURLDefinitionParam) MarshalJSON

func (r BetaRequestMCPServerURLDefinitionParam) MarshalJSON() (data []byte, err error)

func (*BetaRequestMCPServerURLDefinitionParam) UnmarshalJSON

func (r *BetaRequestMCPServerURLDefinitionParam) UnmarshalJSON(data []byte) error

type BetaRequestMCPToolResultBlockParam

type BetaRequestMCPToolResultBlockParam struct {
	ToolUseID string          `json:"tool_use_id" api:"required"`
	IsError   param.Opt[bool] `json:"is_error,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam                 `json:"cache_control,omitzero"`
	Content      BetaRequestMCPToolResultBlockParamContentUnion `json:"content,omitzero"`
	// This field can be elided, and will marshal its zero value as "mcp_tool_result".
	Type constant.MCPToolResult `json:"type" default:"mcp_tool_result"`
	// contains filtered or unexported fields
}

The properties ToolUseID, Type are required.

func (BetaRequestMCPToolResultBlockParam) MarshalJSON

func (r BetaRequestMCPToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaRequestMCPToolResultBlockParam) UnmarshalJSON

func (r *BetaRequestMCPToolResultBlockParam) UnmarshalJSON(data []byte) error

type BetaRequestMCPToolResultBlockParamContentUnion

type BetaRequestMCPToolResultBlockParamContentUnion struct {
	OfString                        param.Opt[string]    `json:",omitzero,inline"`
	OfBetaMCPToolResultBlockContent []BetaTextBlockParam `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 (BetaRequestMCPToolResultBlockParamContentUnion) MarshalJSON

func (*BetaRequestMCPToolResultBlockParamContentUnion) UnmarshalJSON

type BetaRequestToolAdditionBlockParam

type BetaRequestToolAdditionBlockParam struct {
	// Reference to a single tool the caller declared directly in `tools[]`. Does not
	// accept the composed `{server}_{name}` form the server assigns to MCP-resolved
	// tools — use `mcp_tool_reference` or `mcp_toolset_reference` for those.
	Tool BetaRequestToolAdditionBlockToolUnionParam `json:"tool,omitzero" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool_addition".
	Type constant.ToolAddition `json:"type" default:"tool_addition"`
	// contains filtered or unexported fields
}

Mid-conversation directive to surface a declared tool.

`tool` references a tool (or MCP toolset) by name from the request's `tools`; it is offered to the model from this point in the conversation onward.

The properties Tool, Type are required.

func (BetaRequestToolAdditionBlockParam) MarshalJSON

func (r BetaRequestToolAdditionBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaRequestToolAdditionBlockParam) UnmarshalJSON

func (r *BetaRequestToolAdditionBlockParam) UnmarshalJSON(data []byte) error

type BetaRequestToolAdditionBlockToolUnionParam

type BetaRequestToolAdditionBlockToolUnionParam struct {
	OfToolReference       *BetaToolChangeToolReferenceParam       `json:",omitzero,inline"`
	OfMCPToolReference    *BetaToolChangeMCPToolReferenceParam    `json:",omitzero,inline"`
	OfMCPToolsetReference *BetaToolChangeMCPToolsetReferenceParam `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 (BetaRequestToolAdditionBlockToolUnionParam) GetName

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestToolAdditionBlockToolUnionParam) GetServerName

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestToolAdditionBlockToolUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestToolAdditionBlockToolUnionParam) MarshalJSON

func (*BetaRequestToolAdditionBlockToolUnionParam) UnmarshalJSON

func (u *BetaRequestToolAdditionBlockToolUnionParam) UnmarshalJSON(data []byte) error

type BetaRequestToolRemovalBlockParam

type BetaRequestToolRemovalBlockParam struct {
	// Reference to a single tool the caller declared directly in `tools[]`. Does not
	// accept the composed `{server}_{name}` form the server assigns to MCP-resolved
	// tools — use `mcp_tool_reference` or `mcp_toolset_reference` for those.
	Tool BetaRequestToolRemovalBlockToolUnionParam `json:"tool,omitzero" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool_removal".
	Type constant.ToolRemoval `json:"type" default:"tool_removal"`
	// contains filtered or unexported fields
}

Mid-conversation directive to withdraw a tool.

`tool` references a tool (or MCP toolset) by name from the request's `tools`; it is no longer offered to the model from this point in the conversation onward.

The properties Tool, Type are required.

func (BetaRequestToolRemovalBlockParam) MarshalJSON

func (r BetaRequestToolRemovalBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaRequestToolRemovalBlockParam) UnmarshalJSON

func (r *BetaRequestToolRemovalBlockParam) UnmarshalJSON(data []byte) error

type BetaRequestToolRemovalBlockToolUnionParam

type BetaRequestToolRemovalBlockToolUnionParam struct {
	OfToolReference       *BetaToolChangeToolReferenceParam       `json:",omitzero,inline"`
	OfMCPToolReference    *BetaToolChangeMCPToolReferenceParam    `json:",omitzero,inline"`
	OfMCPToolsetReference *BetaToolChangeMCPToolsetReferenceParam `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 (BetaRequestToolRemovalBlockToolUnionParam) GetName

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestToolRemovalBlockToolUnionParam) GetServerName

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestToolRemovalBlockToolUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaRequestToolRemovalBlockToolUnionParam) MarshalJSON

func (*BetaRequestToolRemovalBlockToolUnionParam) UnmarshalJSON

func (u *BetaRequestToolRemovalBlockToolUnionParam) UnmarshalJSON(data []byte) error

type BetaSearchResultBlockParam

type BetaSearchResultBlockParam struct {
	Content []BetaTextBlockParam `json:"content,omitzero" api:"required"`
	Source  string               `json:"source" api:"required"`
	Title   string               `json:"title" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	Citations    BetaCitationsConfigParam       `json:"citations,omitzero"`
	// This field can be elided, and will marshal its zero value as "search_result".
	Type constant.SearchResult `json:"type" default:"search_result"`
	// contains filtered or unexported fields
}

The properties Content, Source, Title, Type are required.

func (BetaSearchResultBlockParam) MarshalJSON

func (r BetaSearchResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaSearchResultBlockParam) UnmarshalJSON

func (r *BetaSearchResultBlockParam) UnmarshalJSON(data []byte) error

type BetaSelfHostedConfig

type BetaSelfHostedConfig struct {
	// Environment type
	Type constant.SelfHosted `json:"type" default:"self_hosted"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for self-hosted environments.

func (BetaSelfHostedConfig) RawJSON

func (r BetaSelfHostedConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaSelfHostedConfig) UnmarshalJSON

func (r *BetaSelfHostedConfig) UnmarshalJSON(data []byte) error

type BetaSelfHostedConfigParams

type BetaSelfHostedConfigParams struct {
	// Environment type
	Type constant.SelfHosted `json:"type" default:"self_hosted"`
	// contains filtered or unexported fields
}

Request params for `self_hosted` environment configuration.

This struct has a constant value, construct it with NewBetaSelfHostedConfigParams.

func NewBetaSelfHostedConfigParams

func NewBetaSelfHostedConfigParams() BetaSelfHostedConfigParams

func (BetaSelfHostedConfigParams) MarshalJSON

func (r BetaSelfHostedConfigParams) MarshalJSON() (data []byte, err error)

func (*BetaSelfHostedConfigParams) UnmarshalJSON

func (r *BetaSelfHostedConfigParams) UnmarshalJSON(data []byte) error

type BetaSelfHostedWork

type BetaSelfHostedWork struct {
	// Work identifier (e.g., 'work\_...')
	ID string `json:"id" api:"required"`
	// RFC 3339 timestamp when work was acknowledged by Environment Manager
	AcknowledgedAt string `json:"acknowledged_at" api:"required"`
	// RFC 3339 timestamp when work was created
	CreatedAt string `json:"created_at" api:"required"`
	// The actual work to be performed
	Data BetaSessionWorkData `json:"data" api:"required"`
	// Environment identifier this work belongs to (e.g., `env_...`)
	EnvironmentID string `json:"environment_id" api:"required"`
	// RFC 3339 timestamp of the most recent heartbeat
	LatestHeartbeatAt string `json:"latest_heartbeat_at" api:"required"`
	// User-provided metadata key-value pairs associated with this work item
	Metadata map[string]string `json:"metadata" api:"required"`
	// Credential payload used by the environment worker to execute this work item. May
	// be populated when polling for work; null on all other retrieval paths.
	Secret string `json:"secret" api:"required"`
	// RFC 3339 timestamp when work execution started
	StartedAt string `json:"started_at" api:"required"`
	// Current state of the work item
	//
	// Any of "queued", "starting", "active", "stopping", "stopped".
	State BetaSelfHostedWorkState `json:"state" api:"required"`
	// RFC 3339 timestamp when stop was requested
	StopRequestedAt string `json:"stop_requested_at" api:"required"`
	// RFC 3339 timestamp when work execution stopped
	StoppedAt string `json:"stopped_at" api:"required"`
	// The type of object (always 'work')
	Type constant.Work `json:"type" default:"work"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		AcknowledgedAt    respjson.Field
		CreatedAt         respjson.Field
		Data              respjson.Field
		EnvironmentID     respjson.Field
		LatestHeartbeatAt respjson.Field
		Metadata          respjson.Field
		Secret            respjson.Field
		StartedAt         respjson.Field
		State             respjson.Field
		StopRequestedAt   respjson.Field
		StoppedAt         respjson.Field
		Type              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Work resource representing a unit of work in a self-hosted environment.

Work items are queued when sessions are created or when long-dormant sessions receive new messages. The Environment Manager polls for work items and executes them on customer-hosted infrastructure.

func (BetaSelfHostedWork) RawJSON

func (r BetaSelfHostedWork) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaSelfHostedWork) UnmarshalJSON

func (r *BetaSelfHostedWork) UnmarshalJSON(data []byte) error

type BetaSelfHostedWorkHeartbeatResponse

type BetaSelfHostedWorkHeartbeatResponse struct {
	// RFC 3339 timestamp of the actual heartbeat from DB
	LastHeartbeat string `json:"last_heartbeat" api:"required"`
	// Whether the heartbeat succeeded in extending the lease
	LeaseExtended bool `json:"lease_extended" api:"required"`
	// Current state of the work item (active/stopping/stopped)
	//
	// Any of "queued", "starting", "active", "stopping", "stopped".
	State BetaSelfHostedWorkHeartbeatResponseState `json:"state" api:"required"`
	// Effective TTL applied to the lease
	TTLSeconds int64 `json:"ttl_seconds" api:"required"`
	// The type of response
	Type constant.WorkHeartbeat `json:"type" default:"work_heartbeat"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LastHeartbeat respjson.Field
		LeaseExtended respjson.Field
		State         respjson.Field
		TTLSeconds    respjson.Field
		Type          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response after recording a heartbeat for a work item.

func (BetaSelfHostedWorkHeartbeatResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaSelfHostedWorkHeartbeatResponse) UnmarshalJSON

func (r *BetaSelfHostedWorkHeartbeatResponse) UnmarshalJSON(data []byte) error

type BetaSelfHostedWorkHeartbeatResponseState

type BetaSelfHostedWorkHeartbeatResponseState string

Current state of the work item (active/stopping/stopped)

const (
	BetaSelfHostedWorkHeartbeatResponseStateQueued   BetaSelfHostedWorkHeartbeatResponseState = "queued"
	BetaSelfHostedWorkHeartbeatResponseStateStarting BetaSelfHostedWorkHeartbeatResponseState = "starting"
	BetaSelfHostedWorkHeartbeatResponseStateActive   BetaSelfHostedWorkHeartbeatResponseState = "active"
	BetaSelfHostedWorkHeartbeatResponseStateStopping BetaSelfHostedWorkHeartbeatResponseState = "stopping"
	BetaSelfHostedWorkHeartbeatResponseStateStopped  BetaSelfHostedWorkHeartbeatResponseState = "stopped"
)

type BetaSelfHostedWorkListResponse

type BetaSelfHostedWorkListResponse struct {
	// List of work items
	Data []BetaSelfHostedWork `json:"data" api:"required"`
	// Opaque cursor for fetching the next page of results
	NextPage string `json:"next_page" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		NextPage    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response when listing work items with cursor-based pagination.

func (BetaSelfHostedWorkListResponse) RawJSON

Returns the unmodified JSON received from the API

func (*BetaSelfHostedWorkListResponse) UnmarshalJSON

func (r *BetaSelfHostedWorkListResponse) UnmarshalJSON(data []byte) error

type BetaSelfHostedWorkQueueStats

type BetaSelfHostedWorkQueueStats struct {
	// Number of work items waiting to be picked up (lag from consumer group)
	Depth int64 `json:"depth" api:"required"`
	// RFC 3339 timestamp of oldest item in the work stream (includes both queued and
	// pending items), null if stream empty
	OldestQueuedAt string `json:"oldest_queued_at" api:"required"`
	// Number of work items being processed (polled but not acknowledged)
	Pending int64 `json:"pending" api:"required"`
	// The type of object
	Type constant.WorkQueueStats `json:"type" default:"work_queue_stats"`
	// Number of workers that have polled for work in the last 30 seconds. Requires
	// worker_id to be sent with poll requests.
	WorkersPolling int64 `json:"workers_polling" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Depth          respjson.Field
		OldestQueuedAt respjson.Field
		Pending        respjson.Field
		Type           respjson.Field
		WorkersPolling respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Statistics about the work queue for an environment.

Uses Redis Stream consumer group metrics for O(1) queries.

func (BetaSelfHostedWorkQueueStats) RawJSON

Returns the unmodified JSON received from the API

func (*BetaSelfHostedWorkQueueStats) UnmarshalJSON

func (r *BetaSelfHostedWorkQueueStats) UnmarshalJSON(data []byte) error

type BetaSelfHostedWorkState

type BetaSelfHostedWorkState string

Current state of the work item

const (
	BetaSelfHostedWorkStateQueued   BetaSelfHostedWorkState = "queued"
	BetaSelfHostedWorkStateStarting BetaSelfHostedWorkState = "starting"
	BetaSelfHostedWorkStateActive   BetaSelfHostedWorkState = "active"
	BetaSelfHostedWorkStateStopping BetaSelfHostedWorkState = "stopping"
	BetaSelfHostedWorkStateStopped  BetaSelfHostedWorkState = "stopped"
)

type BetaSelfHostedWorkStopRequestParam

type BetaSelfHostedWorkStopRequestParam struct {
	// If true, immediately stop work without graceful shutdown
	Force param.Opt[bool] `json:"force,omitzero"`
	// contains filtered or unexported fields
}

Request to stop a work item.

func (BetaSelfHostedWorkStopRequestParam) MarshalJSON

func (r BetaSelfHostedWorkStopRequestParam) MarshalJSON() (data []byte, err error)

func (*BetaSelfHostedWorkStopRequestParam) UnmarshalJSON

func (r *BetaSelfHostedWorkStopRequestParam) UnmarshalJSON(data []byte) error

type BetaSelfHostedWorkUpdateRequestParam

type BetaSelfHostedWorkUpdateRequestParam struct {
	// Metadata patch. Set a key to a string to upsert it, or to null to delete it.
	// Omit the field to preserve existing metadata.
	Metadata map[string]string `json:"metadata,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Request to update work item metadata.

The property Metadata is required.

func (BetaSelfHostedWorkUpdateRequestParam) MarshalJSON

func (r BetaSelfHostedWorkUpdateRequestParam) MarshalJSON() (data []byte, err error)

func (*BetaSelfHostedWorkUpdateRequestParam) UnmarshalJSON

func (r *BetaSelfHostedWorkUpdateRequestParam) UnmarshalJSON(data []byte) error

type BetaServerToolCaller

type BetaServerToolCaller struct {
	ToolID string                         `json:"tool_id" api:"required"`
	Type   constant.CodeExecution20250825 `json:"type" default:"code_execution_20250825"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ToolID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tool invocation generated by a server-side tool.

func (BetaServerToolCaller) RawJSON

func (r BetaServerToolCaller) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaServerToolCaller) ToParam

ToParam converts this BetaServerToolCaller to a BetaServerToolCallerParam.

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 BetaServerToolCallerParam.Overrides()

func (*BetaServerToolCaller) UnmarshalJSON

func (r *BetaServerToolCaller) UnmarshalJSON(data []byte) error

type BetaServerToolCaller20260120

type BetaServerToolCaller20260120 struct {
	ToolID string                         `json:"tool_id" api:"required"`
	Type   constant.CodeExecution20260120 `json:"type" default:"code_execution_20260120"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ToolID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaServerToolCaller20260120) RawJSON

Returns the unmodified JSON received from the API

func (BetaServerToolCaller20260120) ToParam

ToParam converts this BetaServerToolCaller20260120 to a BetaServerToolCaller20260120Param.

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 BetaServerToolCaller20260120Param.Overrides()

func (*BetaServerToolCaller20260120) UnmarshalJSON

func (r *BetaServerToolCaller20260120) UnmarshalJSON(data []byte) error

type BetaServerToolCaller20260120Param

type BetaServerToolCaller20260120Param struct {
	ToolID string `json:"tool_id" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20260120".
	Type constant.CodeExecution20260120 `json:"type" default:"code_execution_20260120"`
	// contains filtered or unexported fields
}

The properties ToolID, Type are required.

func (BetaServerToolCaller20260120Param) MarshalJSON

func (r BetaServerToolCaller20260120Param) MarshalJSON() (data []byte, err error)

func (*BetaServerToolCaller20260120Param) UnmarshalJSON

func (r *BetaServerToolCaller20260120Param) UnmarshalJSON(data []byte) error

type BetaServerToolCallerParam

type BetaServerToolCallerParam struct {
	ToolID string `json:"tool_id" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20250825".
	Type constant.CodeExecution20250825 `json:"type" default:"code_execution_20250825"`
	// contains filtered or unexported fields
}

Tool invocation generated by a server-side tool.

The properties ToolID, Type are required.

func (BetaServerToolCallerParam) MarshalJSON

func (r BetaServerToolCallerParam) MarshalJSON() (data []byte, err error)

func (*BetaServerToolCallerParam) UnmarshalJSON

func (r *BetaServerToolCallerParam) UnmarshalJSON(data []byte) error

type BetaServerToolUsage

type BetaServerToolUsage struct {
	// The number of web fetch tool requests.
	WebFetchRequests int64 `json:"web_fetch_requests" api:"required"`
	// The number of web search tool requests.
	WebSearchRequests int64 `json:"web_search_requests" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		WebFetchRequests  respjson.Field
		WebSearchRequests respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaServerToolUsage) RawJSON

func (r BetaServerToolUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaServerToolUsage) UnmarshalJSON

func (r *BetaServerToolUsage) UnmarshalJSON(data []byte) error

type BetaServerToolUseBlock

type BetaServerToolUseBlock struct {
	ID    string `json:"id" api:"required"`
	Input any    `json:"input" api:"required"`
	// Any of "advisor", "web_search", "web_fetch", "code_execution",
	// "bash_code_execution", "text_editor_code_execution", "tool_search_tool_regex",
	// "tool_search_tool_bm25".
	Name BetaServerToolUseBlockName `json:"name" api:"required"`
	Type constant.ServerToolUse     `json:"type" default:"server_tool_use"`
	// Tool invocation directly from the model.
	Caller BetaServerToolUseBlockCallerUnion `json:"caller"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Input       respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		Caller      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaServerToolUseBlock) RawJSON

func (r BetaServerToolUseBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaServerToolUseBlock) ToParam

func (*BetaServerToolUseBlock) UnmarshalJSON

func (r *BetaServerToolUseBlock) UnmarshalJSON(data []byte) error

type BetaServerToolUseBlockCallerUnion

type BetaServerToolUseBlockCallerUnion struct {
	// Any of "direct", "code_execution_20250825", "code_execution_20260120".
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaServerToolUseBlockCallerUnion contains all possible properties and values from BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller20260120.

Use the BetaServerToolUseBlockCallerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaServerToolUseBlockCallerUnion) AsAny

func (u BetaServerToolUseBlockCallerUnion) AsAny() anyBetaServerToolUseBlockCaller

Use the following switch statement to find the correct variant

switch variant := BetaServerToolUseBlockCallerUnion.AsAny().(type) {
case Juglow.BetaDirectCaller:
case Juglow.BetaServerToolCaller:
case Juglow.BetaServerToolCaller20260120:
default:
  fmt.Errorf("no variant present")
}

func (BetaServerToolUseBlockCallerUnion) AsCodeExecution20250825

func (u BetaServerToolUseBlockCallerUnion) AsCodeExecution20250825() (v BetaServerToolCaller)

func (BetaServerToolUseBlockCallerUnion) AsCodeExecution20260120

func (u BetaServerToolUseBlockCallerUnion) AsCodeExecution20260120() (v BetaServerToolCaller20260120)

func (BetaServerToolUseBlockCallerUnion) AsDirect

func (BetaServerToolUseBlockCallerUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaServerToolUseBlockCallerUnion) UnmarshalJSON

func (r *BetaServerToolUseBlockCallerUnion) UnmarshalJSON(data []byte) error

type BetaServerToolUseBlockName

type BetaServerToolUseBlockName string
const (
	BetaServerToolUseBlockNameAdvisor                 BetaServerToolUseBlockName = "advisor"
	BetaServerToolUseBlockNameWebSearch               BetaServerToolUseBlockName = "web_search"
	BetaServerToolUseBlockNameWebFetch                BetaServerToolUseBlockName = "web_fetch"
	BetaServerToolUseBlockNameCodeExecution           BetaServerToolUseBlockName = "code_execution"
	BetaServerToolUseBlockNameBashCodeExecution       BetaServerToolUseBlockName = "bash_code_execution"
	BetaServerToolUseBlockNameTextEditorCodeExecution BetaServerToolUseBlockName = "text_editor_code_execution"
	BetaServerToolUseBlockNameToolSearchToolRegex     BetaServerToolUseBlockName = "tool_search_tool_regex"
	BetaServerToolUseBlockNameToolSearchToolBm25      BetaServerToolUseBlockName = "tool_search_tool_bm25"
)

type BetaServerToolUseBlockParam

type BetaServerToolUseBlockParam struct {
	ID    string `json:"id" api:"required"`
	Input any    `json:"input,omitzero" api:"required"`
	// Any of "advisor", "web_search", "web_fetch", "code_execution",
	// "bash_code_execution", "text_editor_code_execution", "tool_search_tool_regex",
	// "tool_search_tool_bm25".
	Name BetaServerToolUseBlockParamName `json:"name,omitzero" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Tool invocation directly from the model.
	Caller BetaServerToolUseBlockParamCallerUnion `json:"caller,omitzero"`
	// This field can be elided, and will marshal its zero value as "server_tool_use".
	Type constant.ServerToolUse `json:"type" default:"server_tool_use"`
	// contains filtered or unexported fields
}

The properties ID, Input, Name, Type are required.

func (BetaServerToolUseBlockParam) MarshalJSON

func (r BetaServerToolUseBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaServerToolUseBlockParam) UnmarshalJSON

func (r *BetaServerToolUseBlockParam) UnmarshalJSON(data []byte) error

type BetaServerToolUseBlockParamCallerUnion

type BetaServerToolUseBlockParamCallerUnion struct {
	OfDirect                *BetaDirectCallerParam             `json:",omitzero,inline"`
	OfCodeExecution20250825 *BetaServerToolCallerParam         `json:",omitzero,inline"`
	OfCodeExecution20260120 *BetaServerToolCaller20260120Param `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 (BetaServerToolUseBlockParamCallerUnion) GetToolID

Returns a pointer to the underlying variant's property, if present.

func (BetaServerToolUseBlockParamCallerUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaServerToolUseBlockParamCallerUnion) MarshalJSON

func (u BetaServerToolUseBlockParamCallerUnion) MarshalJSON() ([]byte, error)

func (*BetaServerToolUseBlockParamCallerUnion) UnmarshalJSON

func (u *BetaServerToolUseBlockParamCallerUnion) UnmarshalJSON(data []byte) error

type BetaServerToolUseBlockParamName

type BetaServerToolUseBlockParamName string
const (
	BetaServerToolUseBlockParamNameAdvisor                 BetaServerToolUseBlockParamName = "advisor"
	BetaServerToolUseBlockParamNameWebSearch               BetaServerToolUseBlockParamName = "web_search"
	BetaServerToolUseBlockParamNameWebFetch                BetaServerToolUseBlockParamName = "web_fetch"
	BetaServerToolUseBlockParamNameCodeExecution           BetaServerToolUseBlockParamName = "code_execution"
	BetaServerToolUseBlockParamNameBashCodeExecution       BetaServerToolUseBlockParamName = "bash_code_execution"
	BetaServerToolUseBlockParamNameTextEditorCodeExecution BetaServerToolUseBlockParamName = "text_editor_code_execution"
	BetaServerToolUseBlockParamNameToolSearchToolRegex     BetaServerToolUseBlockParamName = "tool_search_tool_regex"
	BetaServerToolUseBlockParamNameToolSearchToolBm25      BetaServerToolUseBlockParamName = "tool_search_tool_bm25"
)

type BetaService

type BetaService struct {
	Options        []option.RequestOption
	Models         BetaModelService
	Messages       BetaMessageService
	Agents         BetaAgentService
	Environments   BetaEnvironmentService
	Sessions       BetaSessionService
	Deployments    BetaDeploymentService
	DeploymentRuns BetaDeploymentRunService
	Vaults         BetaVaultService
	MemoryStores   BetaMemoryStoreService
	Files          BetaFileService
	Tracks         BetaTrackService
	Webhooks       BetaWebhookService
	UserProfiles   BetaUserProfileService
	Dreams         BetaDreamService
	Tunnels        BetaTunnelService
}

BetaService contains methods and other services that help with interacting with the Juglow 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 NewBetaService method instead.

func NewBetaService

func NewBetaService(opts ...option.RequestOption) (r BetaService)

NewBetaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type BetaSessionArchiveParams

type BetaSessionArchiveParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaSessionDeleteParams

type BetaSessionDeleteParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaSessionEventListParams

type BetaSessionEventListParams struct {
	// Return events created after this time (exclusive). Compared against the event's
	// `processed_at` value.
	CreatedAtGt param.Opt[time.Time] `query:"created_at[gt],omitzero" format:"date-time" json:"-"`
	// Return events created at or after this time (inclusive). Compared against the
	// event's `processed_at` value.
	CreatedAtGte param.Opt[time.Time] `query:"created_at[gte],omitzero" format:"date-time" json:"-"`
	// Return events created before this time (exclusive). Compared against the event's
	// `processed_at` value.
	CreatedAtLt param.Opt[time.Time] `query:"created_at[lt],omitzero" format:"date-time" json:"-"`
	// Return events created at or before this time (inclusive). Compared against the
	// event's `processed_at` value.
	CreatedAtLte param.Opt[time.Time] `query:"created_at[lte],omitzero" format:"date-time" json:"-"`
	// Query parameter for limit
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor from a previous response's next_page.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Sort direction for results, ordered by the event's `processed_at`. Defaults to
	// asc (chronological).
	//
	// Any of "asc", "desc".
	Order BetaSessionEventListParamsOrder `query:"order,omitzero" json:"-"`
	// Filter by event type. Values match the `type` field on returned events (for
	// example, `user.message` or `agent.tool_use`). Omit to return all event types.
	Types []string `query:"types,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionEventListParams) URLQuery

func (r BetaSessionEventListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaSessionEventListParams's query parameters as `url.Values`.

type BetaSessionEventListParamsOrder

type BetaSessionEventListParamsOrder string

Sort direction for results, ordered by the event's `processed_at`. Defaults to asc (chronological).

const (
	BetaSessionEventListParamsOrderAsc  BetaSessionEventListParamsOrder = "asc"
	BetaSessionEventListParamsOrderDesc BetaSessionEventListParamsOrder = "desc"
)

type BetaSessionEventSendParams

type BetaSessionEventSendParams struct {
	// Events to send to the `session`.
	Events []BetaManagedAgentsEventParamsUnion `json:"events,omitzero" api:"required"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionEventSendParams) MarshalJSON

func (r BetaSessionEventSendParams) MarshalJSON() (data []byte, err error)

func (*BetaSessionEventSendParams) UnmarshalJSON

func (r *BetaSessionEventSendParams) UnmarshalJSON(data []byte) error

type BetaSessionEventService

type BetaSessionEventService struct {
	Options []option.RequestOption
}

BetaSessionEventService contains methods and other services that help with interacting with the Juglow 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 NewBetaSessionEventService method instead.

func NewBetaSessionEventService

func NewBetaSessionEventService(opts ...option.RequestOption) (r BetaSessionEventService)

NewBetaSessionEventService 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 (*BetaSessionEventService) List

List Events

func (*BetaSessionEventService) ListAutoPaging

List Events

func (*BetaSessionEventService) NewToolRunner

NewToolRunner returns a SessionToolRunner bound to ctx and this event service for the given managed-agents session. It is the sessions-side counterpart to (*BetaMessageService).NewToolRunner. sessionID is a leading positional argument, matching list/send/stream on the events resource. The first call to Next launches background goroutines (stream, dispatch). Logger defaults to slog.Default().

sessionID is validated here: if it is empty, Next returns false on the first call and Err returns the corresponding error. The returned pointer is never nil so `defer r.Close()` is always safe.

func (*BetaSessionEventService) Send

Send Events

func (*BetaSessionEventService) StreamEvents

Stream Events

type BetaSessionEventStreamParams

type BetaSessionEventStreamParams struct {
	// When set, this connection also receives streaming deltas (`event_start`,
	// `event_delta`) while an event is being produced, before the event itself
	// arrives. Deltas are best-effort; when the final event is produced it carries the
	// complete content. A model request that ends early (an error or interrupt)
	// produces no final event — its terminal `span.model_request_end` closes the
	// preview. Accepts one or more event types to preview and may be repeated:
	// `agent.message` streams `content_delta` fragments; `agent.thinking` is
	// start-only — a signal that the agent has begun extended thinking, concluded by
	// the `agent.thinking` event itself. Only previews of the requested event types
	// are sent.
	EventDeltas []BetaManagedAgentsDeltaType `query:"event_deltas,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionEventStreamParams) URLQuery

func (r BetaSessionEventStreamParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaSessionEventStreamParams's query parameters as `url.Values`.

type BetaSessionGetParams

type BetaSessionGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaSessionListParams

type BetaSessionListParams struct {
	// Filter sessions created with this agent ID.
	AgentID param.Opt[string] `query:"agent_id,omitzero" json:"-"`
	// Filter by agent version. Only applies when agent_id is also set.
	AgentVersion param.Opt[int64] `query:"agent_version,omitzero" json:"-"`
	// Return sessions created after this time (exclusive).
	CreatedAtGt param.Opt[time.Time] `query:"created_at[gt],omitzero" format:"date-time" json:"-"`
	// Return sessions created at or after this time (inclusive).
	CreatedAtGte param.Opt[time.Time] `query:"created_at[gte],omitzero" format:"date-time" json:"-"`
	// Return sessions created before this time (exclusive).
	CreatedAtLt param.Opt[time.Time] `query:"created_at[lt],omitzero" format:"date-time" json:"-"`
	// Return sessions created at or before this time (inclusive).
	CreatedAtLte param.Opt[time.Time] `query:"created_at[lte],omitzero" format:"date-time" json:"-"`
	// Filter sessions created by this deployment ID.
	DeploymentID param.Opt[string] `query:"deployment_id,omitzero" json:"-"`
	// When true, includes archived sessions. Default: false (exclude archived).
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Maximum number of results to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter sessions whose resources contain a memory_store with this memory store
	// ID.
	MemoryStoreID param.Opt[string] `query:"memory_store_id,omitzero" json:"-"`
	// Opaque pagination cursor from a previous response.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Sort direction for results, ordered by created_at. Defaults to desc (newest
	// first).
	//
	// Any of "asc", "desc".
	Order BetaSessionListParamsOrder `query:"order,omitzero" json:"-"`
	// Filter by session status. Repeat the parameter to match any of multiple
	// statuses.
	//
	// Any of "rescheduling", "running", "idle", "terminated".
	Statuses []string `query:"statuses,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionListParams) URLQuery

func (r BetaSessionListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaSessionListParams's query parameters as `url.Values`.

type BetaSessionListParamsOrder

type BetaSessionListParamsOrder string

Sort direction for results, ordered by created_at. Defaults to desc (newest first).

const (
	BetaSessionListParamsOrderAsc  BetaSessionListParamsOrder = "asc"
	BetaSessionListParamsOrderDesc BetaSessionListParamsOrder = "desc"
)

type BetaSessionNewParams

type BetaSessionNewParams struct {
	// Agent identifier. Accepts the `agent` ID string, which pins the latest version
	// for the session, or an `agent` object with both id and version specified.
	Agent BetaSessionNewParamsAgentUnion `json:"agent,omitzero" api:"required"`
	// ID of the `environment` defining the container configuration for this session.
	EnvironmentID string `json:"environment_id" api:"required"`
	// Human-readable session title.
	Title param.Opt[string] `json:"title,omitzero"`
	// A hard spend ceiling. The session stops issuing new model requests once the
	// tracked list cost reaches `max_list_cost`.
	Budget BetaManagedAgentsBudgetLimitParam `json:"budget,omitzero"`
	// Initial events to send to the `session` at creation, processed in order.
	// Supports `user.message` and `user.define_outcome` events. Maximum 50 events.
	InitialEvents []BetaSessionNewParamsInitialEventUnion `json:"initial_events,omitzero"`
	// Arbitrary key-value metadata attached to the session. Maximum 16 pairs, keys up
	// to 64 chars, values up to 512 chars.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Resources (e.g. repositories, files) to mount into the session's container.
	Resources []BetaSessionNewParamsResourceUnion `json:"resources,omitzero"`
	// Vault IDs for stored credentials the agent can use during the session.
	VaultIDs []string `json:"vault_ids,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionNewParams) MarshalJSON

func (r BetaSessionNewParams) MarshalJSON() (data []byte, err error)

func (*BetaSessionNewParams) UnmarshalJSON

func (r *BetaSessionNewParams) UnmarshalJSON(data []byte) error

type BetaSessionNewParamsAgentUnion

type BetaSessionNewParamsAgentUnion struct {
	OfString                               param.Opt[string]                          `json:",omitzero,inline"`
	OfBetaManagedAgentsAgents              *BetaManagedAgentsAgentParams              `json:",omitzero,inline"`
	OfBetaManagedAgentsAgentWithOverridess *BetaManagedAgentsAgentWithOverridesParams `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 (BetaSessionNewParamsAgentUnion) GetID

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsAgentUnion) GetMCPServers

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsAgentUnion) GetModel

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsAgentUnion) GetSystem

func (u BetaSessionNewParamsAgentUnion) GetSystem() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsAgentUnion) GetTools

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsAgentUnion) GetTracks added in v1.71.2

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsAgentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsAgentUnion) GetVersion

func (u BetaSessionNewParamsAgentUnion) GetVersion() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsAgentUnion) MarshalJSON

func (u BetaSessionNewParamsAgentUnion) MarshalJSON() ([]byte, error)

func (*BetaSessionNewParamsAgentUnion) UnmarshalJSON

func (u *BetaSessionNewParamsAgentUnion) UnmarshalJSON(data []byte) error

type BetaSessionNewParamsInitialEventUnion

type BetaSessionNewParamsInitialEventUnion struct {
	OfUserMessage       *BetaManagedAgentsUserMessageEventParams       `json:",omitzero,inline"`
	OfUserDefineOutcome *BetaManagedAgentsUserDefineOutcomeEventParams `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 (BetaSessionNewParamsInitialEventUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsInitialEventUnion) GetDescription

func (u BetaSessionNewParamsInitialEventUnion) GetDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsInitialEventUnion) GetMaxIterations

func (u BetaSessionNewParamsInitialEventUnion) GetMaxIterations() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsInitialEventUnion) GetRubric

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsInitialEventUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsInitialEventUnion) MarshalJSON

func (u BetaSessionNewParamsInitialEventUnion) MarshalJSON() ([]byte, error)

func (*BetaSessionNewParamsInitialEventUnion) UnmarshalJSON

func (u *BetaSessionNewParamsInitialEventUnion) UnmarshalJSON(data []byte) error

type BetaSessionNewParamsResourceUnion

type BetaSessionNewParamsResourceUnion struct {
	OfGitHubRepository *BetaManagedAgentsGitHubRepositoryResourceParams `json:",omitzero,inline"`
	OfFile             *BetaManagedAgentsFileResourceParams             `json:",omitzero,inline"`
	OfMemoryStore      *BetaManagedAgentsMemoryStoreResourceParam       `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 (BetaSessionNewParamsResourceUnion) GetAccess

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsResourceUnion) GetAuthorizationToken

func (u BetaSessionNewParamsResourceUnion) GetAuthorizationToken() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsResourceUnion) GetCheckout

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsResourceUnion) GetFileID

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsResourceUnion) GetInstructions

func (u BetaSessionNewParamsResourceUnion) GetInstructions() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsResourceUnion) GetMemoryStoreID

func (u BetaSessionNewParamsResourceUnion) GetMemoryStoreID() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsResourceUnion) GetMountPath

func (u BetaSessionNewParamsResourceUnion) GetMountPath() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsResourceUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsResourceUnion) GetURL

Returns a pointer to the underlying variant's property, if present.

func (BetaSessionNewParamsResourceUnion) MarshalJSON

func (u BetaSessionNewParamsResourceUnion) MarshalJSON() ([]byte, error)

func (*BetaSessionNewParamsResourceUnion) UnmarshalJSON

func (u *BetaSessionNewParamsResourceUnion) UnmarshalJSON(data []byte) error

type BetaSessionResourceAddParams

type BetaSessionResourceAddParams struct {
	// Mount a file uploaded via the Files API into the session.
	BetaManagedAgentsFileResourceParams BetaManagedAgentsFileResourceParams
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionResourceAddParams) MarshalJSON

func (r BetaSessionResourceAddParams) MarshalJSON() (data []byte, err error)

func (*BetaSessionResourceAddParams) UnmarshalJSON

func (r *BetaSessionResourceAddParams) UnmarshalJSON(data []byte) error

type BetaSessionResourceDeleteParams

type BetaSessionResourceDeleteParams struct {
	SessionID string `path:"session_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaSessionResourceGetParams

type BetaSessionResourceGetParams struct {
	SessionID string `path:"session_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaSessionResourceGetResponseUnion

type BetaSessionResourceGetResponseUnion struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	MountPath string    `json:"mount_path"`
	// Any of "github_repository", "file", "memory_store".
	Type      string    `json:"type"`
	UpdatedAt time.Time `json:"updated_at"`
	// This field is from variant [BetaManagedAgentsGitHubRepositoryResource].
	URL string `json:"url"`
	// This field is from variant [BetaManagedAgentsGitHubRepositoryResource].
	Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion `json:"checkout"`
	// This field is from variant [BetaManagedAgentsFileResource].
	FileID string `json:"file_id"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	MemoryStoreID string `json:"memory_store_id"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Access BetaManagedAgentsMemoryStoreResourceAccess `json:"access"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Instructions string `json:"instructions"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Name string `json:"name"`
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		MountPath     respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		URL           respjson.Field
		Checkout      respjson.Field
		FileID        respjson.Field
		MemoryStoreID respjson.Field
		Access        respjson.Field
		Description   respjson.Field
		Instructions  respjson.Field
		Name          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaSessionResourceGetResponseUnion contains all possible properties and values from BetaManagedAgentsGitHubRepositoryResource, BetaManagedAgentsFileResource, BetaManagedAgentsMemoryStoreResource.

Use the BetaSessionResourceGetResponseUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaSessionResourceGetResponseUnion) AsAny

func (u BetaSessionResourceGetResponseUnion) AsAny() anyBetaSessionResourceGetResponse

Use the following switch statement to find the correct variant

switch variant := BetaSessionResourceGetResponseUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsGitHubRepositoryResource:
case Juglow.BetaManagedAgentsFileResource:
case Juglow.BetaManagedAgentsMemoryStoreResource:
default:
  fmt.Errorf("no variant present")
}

func (BetaSessionResourceGetResponseUnion) AsFile

func (BetaSessionResourceGetResponseUnion) AsGitHubRepository

func (BetaSessionResourceGetResponseUnion) AsMemoryStore

func (BetaSessionResourceGetResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaSessionResourceGetResponseUnion) UnmarshalJSON

func (r *BetaSessionResourceGetResponseUnion) UnmarshalJSON(data []byte) error

type BetaSessionResourceListParams

type BetaSessionResourceListParams struct {
	// Maximum number of resources to return per page (max 1000). If omitted, returns
	// all resources.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque cursor from a previous response's next_page field.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionResourceListParams) URLQuery

func (r BetaSessionResourceListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaSessionResourceListParams's query parameters as `url.Values`.

type BetaSessionResourceService

type BetaSessionResourceService struct {
	Options []option.RequestOption
}

BetaSessionResourceService contains methods and other services that help with interacting with the Juglow 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 NewBetaSessionResourceService method instead.

func NewBetaSessionResourceService

func NewBetaSessionResourceService(opts ...option.RequestOption) (r BetaSessionResourceService)

NewBetaSessionResourceService 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 (*BetaSessionResourceService) Add

Add Session Resource

func (*BetaSessionResourceService) Delete

Delete Session Resource

func (*BetaSessionResourceService) Get

Get Session Resource

func (*BetaSessionResourceService) List

List Session Resources

func (*BetaSessionResourceService) ListAutoPaging

List Session Resources

func (*BetaSessionResourceService) Update

Update Session Resource

type BetaSessionResourceUpdateParams

type BetaSessionResourceUpdateParams struct {
	SessionID string `path:"session_id" api:"required" json:"-"`
	// New authorization token for the resource. Currently only `github_repository`
	// resources support token rotation.
	AuthorizationToken string `json:"authorization_token" api:"required"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionResourceUpdateParams) MarshalJSON

func (r BetaSessionResourceUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaSessionResourceUpdateParams) UnmarshalJSON

func (r *BetaSessionResourceUpdateParams) UnmarshalJSON(data []byte) error

type BetaSessionResourceUpdateResponseUnion

type BetaSessionResourceUpdateResponseUnion struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	MountPath string    `json:"mount_path"`
	// Any of "github_repository", "file", "memory_store".
	Type      string    `json:"type"`
	UpdatedAt time.Time `json:"updated_at"`
	// This field is from variant [BetaManagedAgentsGitHubRepositoryResource].
	URL string `json:"url"`
	// This field is from variant [BetaManagedAgentsGitHubRepositoryResource].
	Checkout BetaManagedAgentsGitHubRepositoryResourceCheckoutUnion `json:"checkout"`
	// This field is from variant [BetaManagedAgentsFileResource].
	FileID string `json:"file_id"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	MemoryStoreID string `json:"memory_store_id"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Access BetaManagedAgentsMemoryStoreResourceAccess `json:"access"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Description string `json:"description"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Instructions string `json:"instructions"`
	// This field is from variant [BetaManagedAgentsMemoryStoreResource].
	Name string `json:"name"`
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		MountPath     respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		URL           respjson.Field
		Checkout      respjson.Field
		FileID        respjson.Field
		MemoryStoreID respjson.Field
		Access        respjson.Field
		Description   respjson.Field
		Instructions  respjson.Field
		Name          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaSessionResourceUpdateResponseUnion contains all possible properties and values from BetaManagedAgentsGitHubRepositoryResource, BetaManagedAgentsFileResource, BetaManagedAgentsMemoryStoreResource.

Use the BetaSessionResourceUpdateResponseUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaSessionResourceUpdateResponseUnion) AsAny

func (u BetaSessionResourceUpdateResponseUnion) AsAny() anyBetaSessionResourceUpdateResponse

Use the following switch statement to find the correct variant

switch variant := BetaSessionResourceUpdateResponseUnion.AsAny().(type) {
case Juglow.BetaManagedAgentsGitHubRepositoryResource:
case Juglow.BetaManagedAgentsFileResource:
case Juglow.BetaManagedAgentsMemoryStoreResource:
default:
  fmt.Errorf("no variant present")
}

func (BetaSessionResourceUpdateResponseUnion) AsFile

func (BetaSessionResourceUpdateResponseUnion) AsGitHubRepository

func (BetaSessionResourceUpdateResponseUnion) AsMemoryStore

func (BetaSessionResourceUpdateResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaSessionResourceUpdateResponseUnion) UnmarshalJSON

func (r *BetaSessionResourceUpdateResponseUnion) UnmarshalJSON(data []byte) error

type BetaSessionService

type BetaSessionService struct {
	Options   []option.RequestOption
	Events    BetaSessionEventService
	Resources BetaSessionResourceService
	Threads   BetaSessionThreadService
}

BetaSessionService contains methods and other services that help with interacting with the Juglow 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 NewBetaSessionService method instead.

func NewBetaSessionService

func NewBetaSessionService(opts ...option.RequestOption) (r BetaSessionService)

NewBetaSessionService 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 (*BetaSessionService) Archive

Archive Session

func (*BetaSessionService) Delete

Delete Session

func (*BetaSessionService) Get

Get Session

func (*BetaSessionService) List

List Sessions

func (*BetaSessionService) New

Create Session

func (*BetaSessionService) Update

Update Session

type BetaSessionThreadArchiveParams

type BetaSessionThreadArchiveParams struct {
	SessionID string `path:"session_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaSessionThreadEventListParams

type BetaSessionThreadEventListParams struct {
	SessionID string `path:"session_id" api:"required" json:"-"`
	// Query parameter for limit
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Query parameter for page
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionThreadEventListParams) URLQuery

func (r BetaSessionThreadEventListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaSessionThreadEventListParams's query parameters as `url.Values`.

type BetaSessionThreadEventService

type BetaSessionThreadEventService struct {
	Options []option.RequestOption
}

BetaSessionThreadEventService contains methods and other services that help with interacting with the Juglow 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 NewBetaSessionThreadEventService method instead.

func NewBetaSessionThreadEventService

func NewBetaSessionThreadEventService(opts ...option.RequestOption) (r BetaSessionThreadEventService)

NewBetaSessionThreadEventService 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 (*BetaSessionThreadEventService) List

List Session Thread Events

func (*BetaSessionThreadEventService) ListAutoPaging

List Session Thread Events

func (*BetaSessionThreadEventService) StreamEvents

Stream Session Thread Events

type BetaSessionThreadEventStreamParams

type BetaSessionThreadEventStreamParams struct {
	SessionID string `path:"session_id" api:"required" json:"-"`
	// When set, this connection also receives streaming deltas (`event_start`,
	// `event_delta`) while an event is being produced, before the event itself
	// arrives. Deltas are best-effort; when the final event is produced it carries the
	// complete content. A model request that ends early (an error or interrupt)
	// produces no final event — its terminal `span.model_request_end` closes the
	// preview. Accepts one or more event types to preview and may be repeated:
	// `agent.message` streams `content_delta` fragments; `agent.thinking` is
	// start-only — a signal that the agent has begun extended thinking, concluded by
	// the `agent.thinking` event itself. Only previews of the requested event types
	// are sent.
	EventDeltas []BetaManagedAgentsDeltaType `query:"event_deltas,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionThreadEventStreamParams) URLQuery

func (r BetaSessionThreadEventStreamParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaSessionThreadEventStreamParams's query parameters as `url.Values`.

type BetaSessionThreadGetParams

type BetaSessionThreadGetParams struct {
	SessionID string `path:"session_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaSessionThreadListParams

type BetaSessionThreadListParams struct {
	// Maximum results per page. Defaults to 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor from a previous response's next_page. Forward-only.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionThreadListParams) URLQuery

func (r BetaSessionThreadListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaSessionThreadListParams's query parameters as `url.Values`.

type BetaSessionThreadService

type BetaSessionThreadService struct {
	Options []option.RequestOption
	Events  BetaSessionThreadEventService
}

BetaSessionThreadService contains methods and other services that help with interacting with the Juglow 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 NewBetaSessionThreadService method instead.

func NewBetaSessionThreadService

func NewBetaSessionThreadService(opts ...option.RequestOption) (r BetaSessionThreadService)

NewBetaSessionThreadService 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 (*BetaSessionThreadService) Archive

Archive Session Thread

func (*BetaSessionThreadService) Get

Get Session Thread

func (*BetaSessionThreadService) List

List Session Threads

func (*BetaSessionThreadService) ListAutoPaging

List Session Threads

type BetaSessionUpdateParams

type BetaSessionUpdateParams struct {
	// Human-readable session title.
	Title param.Opt[string] `json:"title,omitzero"`
	// Metadata patch. Set a key to a string to upsert it, or to null to delete it.
	// Omit the field to preserve.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Mid-session agent configuration update. Only `tools` and `mcp_servers` are
	// updatable. Full replacement: the provided array becomes the new value. To
	// preserve existing entries, GET the session, modify the array, and POST it back.
	Agent BetaManagedAgentsSessionAgentUpdateParam `json:"agent,omitzero"`
	// A hard spend ceiling. The session stops issuing new model requests once the
	// tracked list cost reaches `max_list_cost`.
	Budget BetaManagedAgentsBudgetLimitParam `json:"budget,omitzero"`
	// Vault IDs (`vlt_*`) to attach to the session. Not yet supported; requests
	// setting this field are rejected. Reserved for future use.
	VaultIDs []string `json:"vault_ids,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaSessionUpdateParams) MarshalJSON

func (r BetaSessionUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaSessionUpdateParams) UnmarshalJSON

func (r *BetaSessionUpdateParams) UnmarshalJSON(data []byte) error

type BetaSessionWorkData

type BetaSessionWorkData struct {
	// Session identifier (e.g., 'session\_...')
	ID string `json:"id" api:"required"`
	// Type of work data
	Type constant.Session `json:"type" default:"session"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Work data for session work items.

This resource type is used when work represents a session that needs to be executed in a self-hosted environment.

func (BetaSessionWorkData) RawJSON

func (r BetaSessionWorkData) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaSessionWorkData) UnmarshalJSON

func (r *BetaSessionWorkData) UnmarshalJSON(data []byte) error

type BetaSignatureDelta

type BetaSignatureDelta struct {
	// The `signature` for this thinking block: an opaque value used to verify that the
	// block was generated by haijun when it is passed back to the API. Delivered in a
	// `signature_delta` event just before the block's `content_block_stop` event.
	Signature string                  `json:"signature" api:"required"`
	Type      constant.SignatureDelta `json:"type" default:"signature_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Signature   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaSignatureDelta) RawJSON

func (r BetaSignatureDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaSignatureDelta) UnmarshalJSON

func (r *BetaSignatureDelta) UnmarshalJSON(data []byte) error

type BetaStopReason

type BetaStopReason string
const (
	BetaStopReasonEndTurn                    BetaStopReason = "end_turn"
	BetaStopReasonMaxTokens                  BetaStopReason = "max_tokens"
	BetaStopReasonStopSequence               BetaStopReason = "stop_sequence"
	BetaStopReasonToolUse                    BetaStopReason = "tool_use"
	BetaStopReasonPauseTurn                  BetaStopReason = "pause_turn"
	BetaStopReasonCompaction                 BetaStopReason = "compaction"
	BetaStopReasonRefusal                    BetaStopReason = "refusal"
	BetaStopReasonModelContextWindowExceeded BetaStopReason = "model_context_window_exceeded"
)

type BetaTextBlock

type BetaTextBlock struct {
	// Citations supporting the text block.
	//
	// The type of citation returned will depend on the type of document being cited.
	// Citing a PDF results in `page_location`, plain text results in `char_location`,
	// and content document results in `content_block_location`.
	Citations []BetaTextCitationUnion `json:"citations" api:"required"`
	Text      string                  `json:"text" api:"required"`
	Type      constant.Text           `json:"type" default:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Citations   respjson.Field
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTextBlock) RawJSON

func (r BetaTextBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaTextBlock) ToParam

func (r BetaTextBlock) ToParam() BetaTextBlockParam

func (*BetaTextBlock) UnmarshalJSON

func (r *BetaTextBlock) UnmarshalJSON(data []byte) error

type BetaTextBlockParam

type BetaTextBlockParam struct {
	Text      string                       `json:"text" api:"required"`
	Citations []BetaTextCitationParamUnion `json:"citations,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "text".
	Type constant.Text `json:"type" default:"text"`
	// contains filtered or unexported fields
}

The properties Text, Type are required.

func (BetaTextBlockParam) MarshalJSON

func (r BetaTextBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaTextBlockParam) UnmarshalJSON

func (r *BetaTextBlockParam) UnmarshalJSON(data []byte) error

type BetaTextCitationParamUnion

type BetaTextCitationParamUnion struct {
	OfCharLocation            *BetaCitationCharLocationParam            `json:",omitzero,inline"`
	OfPageLocation            *BetaCitationPageLocationParam            `json:",omitzero,inline"`
	OfContentBlockLocation    *BetaCitationContentBlockLocationParam    `json:",omitzero,inline"`
	OfWebSearchResultLocation *BetaCitationWebSearchResultLocationParam `json:",omitzero,inline"`
	OfSearchResultLocation    *BetaCitationSearchResultLocationParam    `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 (BetaTextCitationParamUnion) GetCitedText

func (u BetaTextCitationParamUnion) GetCitedText() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetDocumentIndex

func (u BetaTextCitationParamUnion) GetDocumentIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetDocumentTitle

func (u BetaTextCitationParamUnion) GetDocumentTitle() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetEncryptedIndex

func (u BetaTextCitationParamUnion) GetEncryptedIndex() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetEndBlockIndex

func (u BetaTextCitationParamUnion) GetEndBlockIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetEndCharIndex

func (u BetaTextCitationParamUnion) GetEndCharIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetEndPageNumber

func (u BetaTextCitationParamUnion) GetEndPageNumber() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetSearchResultIndex

func (u BetaTextCitationParamUnion) GetSearchResultIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetSource

func (u BetaTextCitationParamUnion) GetSource() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetStartBlockIndex

func (u BetaTextCitationParamUnion) GetStartBlockIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetStartCharIndex

func (u BetaTextCitationParamUnion) GetStartCharIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetStartPageNumber

func (u BetaTextCitationParamUnion) GetStartPageNumber() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetTitle

func (u BetaTextCitationParamUnion) GetTitle() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetType

func (u BetaTextCitationParamUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) GetURL

func (u BetaTextCitationParamUnion) GetURL() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaTextCitationParamUnion) MarshalJSON

func (u BetaTextCitationParamUnion) MarshalJSON() ([]byte, error)

func (*BetaTextCitationParamUnion) UnmarshalJSON

func (u *BetaTextCitationParamUnion) UnmarshalJSON(data []byte) error

type BetaTextCitationUnion

type BetaTextCitationUnion struct {
	CitedText     string `json:"cited_text"`
	DocumentIndex int64  `json:"document_index"`
	DocumentTitle string `json:"document_title"`
	// This field is from variant [BetaCitationCharLocation].
	EndCharIndex int64  `json:"end_char_index"`
	FileID       string `json:"file_id"`
	// This field is from variant [BetaCitationCharLocation].
	StartCharIndex int64 `json:"start_char_index"`
	// Any of "char_location", "page_location", "content_block_location",
	// "web_search_result_location", "search_result_location".
	Type string `json:"type"`
	// This field is from variant [BetaCitationPageLocation].
	EndPageNumber int64 `json:"end_page_number"`
	// This field is from variant [BetaCitationPageLocation].
	StartPageNumber int64 `json:"start_page_number"`
	EndBlockIndex   int64 `json:"end_block_index"`
	StartBlockIndex int64 `json:"start_block_index"`
	// This field is from variant [BetaCitationsWebSearchResultLocation].
	EncryptedIndex string `json:"encrypted_index"`
	Title          string `json:"title"`
	// This field is from variant [BetaCitationsWebSearchResultLocation].
	URL string `json:"url"`
	// This field is from variant [BetaCitationSearchResultLocation].
	SearchResultIndex int64 `json:"search_result_index"`
	// This field is from variant [BetaCitationSearchResultLocation].
	Source string `json:"source"`
	JSON   struct {
		CitedText         respjson.Field
		DocumentIndex     respjson.Field
		DocumentTitle     respjson.Field
		EndCharIndex      respjson.Field
		FileID            respjson.Field
		StartCharIndex    respjson.Field
		Type              respjson.Field
		EndPageNumber     respjson.Field
		StartPageNumber   respjson.Field
		EndBlockIndex     respjson.Field
		StartBlockIndex   respjson.Field
		EncryptedIndex    respjson.Field
		Title             respjson.Field
		URL               respjson.Field
		SearchResultIndex respjson.Field
		Source            respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaTextCitationUnion contains all possible properties and values from BetaCitationCharLocation, BetaCitationPageLocation, BetaCitationContentBlockLocation, BetaCitationsWebSearchResultLocation, BetaCitationSearchResultLocation.

Use the BetaTextCitationUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaTextCitationUnion) AsAny

func (u BetaTextCitationUnion) AsAny() anyBetaTextCitation

Use the following switch statement to find the correct variant

switch variant := BetaTextCitationUnion.AsAny().(type) {
case Juglow.BetaCitationCharLocation:
case Juglow.BetaCitationPageLocation:
case Juglow.BetaCitationContentBlockLocation:
case Juglow.BetaCitationsWebSearchResultLocation:
case Juglow.BetaCitationSearchResultLocation:
default:
  fmt.Errorf("no variant present")
}

func (BetaTextCitationUnion) AsCharLocation

func (u BetaTextCitationUnion) AsCharLocation() (v BetaCitationCharLocation)

func (BetaTextCitationUnion) AsContentBlockLocation

func (u BetaTextCitationUnion) AsContentBlockLocation() (v BetaCitationContentBlockLocation)

func (BetaTextCitationUnion) AsPageLocation

func (u BetaTextCitationUnion) AsPageLocation() (v BetaCitationPageLocation)

func (BetaTextCitationUnion) AsSearchResultLocation

func (u BetaTextCitationUnion) AsSearchResultLocation() (v BetaCitationSearchResultLocation)

func (BetaTextCitationUnion) AsWebSearchResultLocation

func (u BetaTextCitationUnion) AsWebSearchResultLocation() (v BetaCitationsWebSearchResultLocation)

func (BetaTextCitationUnion) RawJSON

func (u BetaTextCitationUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTextCitationUnion) UnmarshalJSON

func (r *BetaTextCitationUnion) UnmarshalJSON(data []byte) error

type BetaTextDelta

type BetaTextDelta struct {
	Text string             `json:"text" api:"required"`
	Type constant.TextDelta `json:"type" default:"text_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTextDelta) RawJSON

func (r BetaTextDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTextDelta) UnmarshalJSON

func (r *BetaTextDelta) UnmarshalJSON(data []byte) error

type BetaTextEditorCodeExecutionCreateResultBlock

type BetaTextEditorCodeExecutionCreateResultBlock struct {
	IsFileUpdate bool                                         `json:"is_file_update" api:"required"`
	Type         constant.TextEditorCodeExecutionCreateResult `json:"type" default:"text_editor_code_execution_create_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IsFileUpdate respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTextEditorCodeExecutionCreateResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BetaTextEditorCodeExecutionCreateResultBlock) UnmarshalJSON

func (r *BetaTextEditorCodeExecutionCreateResultBlock) UnmarshalJSON(data []byte) error

type BetaTextEditorCodeExecutionCreateResultBlockParam

type BetaTextEditorCodeExecutionCreateResultBlockParam struct {
	IsFileUpdate bool `json:"is_file_update" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_create_result".
	Type constant.TextEditorCodeExecutionCreateResult `json:"type" default:"text_editor_code_execution_create_result"`
	// contains filtered or unexported fields
}

The properties IsFileUpdate, Type are required.

func (BetaTextEditorCodeExecutionCreateResultBlockParam) MarshalJSON

func (r BetaTextEditorCodeExecutionCreateResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaTextEditorCodeExecutionCreateResultBlockParam) UnmarshalJSON

type BetaTextEditorCodeExecutionStrReplaceResultBlock

type BetaTextEditorCodeExecutionStrReplaceResultBlock struct {
	Lines    []string                                         `json:"lines" api:"required"`
	NewLines int64                                            `json:"new_lines" api:"required"`
	NewStart int64                                            `json:"new_start" api:"required"`
	OldLines int64                                            `json:"old_lines" api:"required"`
	OldStart int64                                            `json:"old_start" api:"required"`
	Type     constant.TextEditorCodeExecutionStrReplaceResult `json:"type" default:"text_editor_code_execution_str_replace_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Lines       respjson.Field
		NewLines    respjson.Field
		NewStart    respjson.Field
		OldLines    respjson.Field
		OldStart    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTextEditorCodeExecutionStrReplaceResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BetaTextEditorCodeExecutionStrReplaceResultBlock) UnmarshalJSON

type BetaTextEditorCodeExecutionStrReplaceResultBlockParam

type BetaTextEditorCodeExecutionStrReplaceResultBlockParam struct {
	NewLines param.Opt[int64] `json:"new_lines,omitzero"`
	NewStart param.Opt[int64] `json:"new_start,omitzero"`
	OldLines param.Opt[int64] `json:"old_lines,omitzero"`
	OldStart param.Opt[int64] `json:"old_start,omitzero"`
	Lines    []string         `json:"lines,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_str_replace_result".
	Type constant.TextEditorCodeExecutionStrReplaceResult `json:"type" default:"text_editor_code_execution_str_replace_result"`
	// contains filtered or unexported fields
}

The property Type is required.

func (BetaTextEditorCodeExecutionStrReplaceResultBlockParam) MarshalJSON

func (*BetaTextEditorCodeExecutionStrReplaceResultBlockParam) UnmarshalJSON

type BetaTextEditorCodeExecutionToolResultBlock

type BetaTextEditorCodeExecutionToolResultBlock struct {
	Content   BetaTextEditorCodeExecutionToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                                 `json:"tool_use_id" api:"required"`
	Type      constant.TextEditorCodeExecutionToolResult             `json:"type" default:"text_editor_code_execution_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTextEditorCodeExecutionToolResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaTextEditorCodeExecutionToolResultBlock) ToParam

func (*BetaTextEditorCodeExecutionToolResultBlock) UnmarshalJSON

func (r *BetaTextEditorCodeExecutionToolResultBlock) UnmarshalJSON(data []byte) error

type BetaTextEditorCodeExecutionToolResultBlockContentUnion

type BetaTextEditorCodeExecutionToolResultBlockContentUnion struct {
	// This field is from variant [BetaTextEditorCodeExecutionToolResultError].
	ErrorCode BetaTextEditorCodeExecutionToolResultErrorErrorCode `json:"error_code"`
	// This field is from variant [BetaTextEditorCodeExecutionToolResultError].
	ErrorMessage string `json:"error_message"`
	Type         string `json:"type"`
	// This field is from variant [BetaTextEditorCodeExecutionViewResultBlock].
	Content string `json:"content"`
	// This field is from variant [BetaTextEditorCodeExecutionViewResultBlock].
	FileType BetaTextEditorCodeExecutionViewResultBlockFileType `json:"file_type"`
	// This field is from variant [BetaTextEditorCodeExecutionViewResultBlock].
	NumLines int64 `json:"num_lines"`
	// This field is from variant [BetaTextEditorCodeExecutionViewResultBlock].
	StartLine int64 `json:"start_line"`
	// This field is from variant [BetaTextEditorCodeExecutionViewResultBlock].
	TotalLines int64 `json:"total_lines"`
	// This field is from variant [BetaTextEditorCodeExecutionCreateResultBlock].
	IsFileUpdate bool `json:"is_file_update"`
	// This field is from variant [BetaTextEditorCodeExecutionStrReplaceResultBlock].
	Lines []string `json:"lines"`
	// This field is from variant [BetaTextEditorCodeExecutionStrReplaceResultBlock].
	NewLines int64 `json:"new_lines"`
	// This field is from variant [BetaTextEditorCodeExecutionStrReplaceResultBlock].
	NewStart int64 `json:"new_start"`
	// This field is from variant [BetaTextEditorCodeExecutionStrReplaceResultBlock].
	OldLines int64 `json:"old_lines"`
	// This field is from variant [BetaTextEditorCodeExecutionStrReplaceResultBlock].
	OldStart int64 `json:"old_start"`
	JSON     struct {
		ErrorCode    respjson.Field
		ErrorMessage respjson.Field
		Type         respjson.Field
		Content      respjson.Field
		FileType     respjson.Field
		NumLines     respjson.Field
		StartLine    respjson.Field
		TotalLines   respjson.Field
		IsFileUpdate respjson.Field
		Lines        respjson.Field
		NewLines     respjson.Field
		NewStart     respjson.Field
		OldLines     respjson.Field
		OldStart     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaTextEditorCodeExecutionToolResultBlockContentUnion contains all possible properties and values from BetaTextEditorCodeExecutionToolResultError, BetaTextEditorCodeExecutionViewResultBlock, BetaTextEditorCodeExecutionCreateResultBlock, BetaTextEditorCodeExecutionStrReplaceResultBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaTextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionCreateResultBlock

func (u BetaTextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionCreateResultBlock() (v BetaTextEditorCodeExecutionCreateResultBlock)

func (BetaTextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionStrReplaceResultBlock

func (u BetaTextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionStrReplaceResultBlock() (v BetaTextEditorCodeExecutionStrReplaceResultBlock)

func (BetaTextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionToolResultError

func (u BetaTextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionToolResultError() (v BetaTextEditorCodeExecutionToolResultError)

func (BetaTextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionViewResultBlock

func (u BetaTextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionViewResultBlock() (v BetaTextEditorCodeExecutionViewResultBlock)

func (BetaTextEditorCodeExecutionToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaTextEditorCodeExecutionToolResultBlockContentUnion) UnmarshalJSON

type BetaTextEditorCodeExecutionToolResultBlockParam

type BetaTextEditorCodeExecutionToolResultBlockParam struct {
	Content   BetaTextEditorCodeExecutionToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                                      `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_tool_result".
	Type constant.TextEditorCodeExecutionToolResult `json:"type" default:"text_editor_code_execution_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (BetaTextEditorCodeExecutionToolResultBlockParam) MarshalJSON

func (r BetaTextEditorCodeExecutionToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaTextEditorCodeExecutionToolResultBlockParam) UnmarshalJSON

type BetaTextEditorCodeExecutionToolResultBlockParamContentUnion

type BetaTextEditorCodeExecutionToolResultBlockParamContentUnion struct {
	OfRequestTextEditorCodeExecutionToolResultError       *BetaTextEditorCodeExecutionToolResultErrorParam       `json:",omitzero,inline"`
	OfRequestTextEditorCodeExecutionViewResultBlock       *BetaTextEditorCodeExecutionViewResultBlockParam       `json:",omitzero,inline"`
	OfRequestTextEditorCodeExecutionCreateResultBlock     *BetaTextEditorCodeExecutionCreateResultBlockParam     `json:",omitzero,inline"`
	OfRequestTextEditorCodeExecutionStrReplaceResultBlock *BetaTextEditorCodeExecutionStrReplaceResultBlockParam `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 (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetErrorMessage

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetFileType

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetIsFileUpdate

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetLines

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetNewLines

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetNewStart

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetNumLines

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetOldLines

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetOldStart

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetStartLine

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetTotalLines

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) MarshalJSON

func (*BetaTextEditorCodeExecutionToolResultBlockParamContentUnion) UnmarshalJSON

type BetaTextEditorCodeExecutionToolResultError

type BetaTextEditorCodeExecutionToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded", "file_not_found".
	ErrorCode    BetaTextEditorCodeExecutionToolResultErrorErrorCode `json:"error_code" api:"required"`
	ErrorMessage string                                              `json:"error_message" api:"required"`
	Type         constant.TextEditorCodeExecutionToolResultError     `json:"type" default:"text_editor_code_execution_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode    respjson.Field
		ErrorMessage respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTextEditorCodeExecutionToolResultError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaTextEditorCodeExecutionToolResultError) UnmarshalJSON

func (r *BetaTextEditorCodeExecutionToolResultError) UnmarshalJSON(data []byte) error

type BetaTextEditorCodeExecutionToolResultErrorErrorCode

type BetaTextEditorCodeExecutionToolResultErrorErrorCode string
const (
	BetaTextEditorCodeExecutionToolResultErrorErrorCodeInvalidToolInput      BetaTextEditorCodeExecutionToolResultErrorErrorCode = "invalid_tool_input"
	BetaTextEditorCodeExecutionToolResultErrorErrorCodeUnavailable           BetaTextEditorCodeExecutionToolResultErrorErrorCode = "unavailable"
	BetaTextEditorCodeExecutionToolResultErrorErrorCodeTooManyRequests       BetaTextEditorCodeExecutionToolResultErrorErrorCode = "too_many_requests"
	BetaTextEditorCodeExecutionToolResultErrorErrorCodeExecutionTimeExceeded BetaTextEditorCodeExecutionToolResultErrorErrorCode = "execution_time_exceeded"
	BetaTextEditorCodeExecutionToolResultErrorErrorCodeFileNotFound          BetaTextEditorCodeExecutionToolResultErrorErrorCode = "file_not_found"
)

type BetaTextEditorCodeExecutionToolResultErrorParam

type BetaTextEditorCodeExecutionToolResultErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded", "file_not_found".
	ErrorCode    BetaTextEditorCodeExecutionToolResultErrorParamErrorCode `json:"error_code,omitzero" api:"required"`
	ErrorMessage param.Opt[string]                                        `json:"error_message,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_tool_result_error".
	Type constant.TextEditorCodeExecutionToolResultError `json:"type" default:"text_editor_code_execution_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (BetaTextEditorCodeExecutionToolResultErrorParam) MarshalJSON

func (r BetaTextEditorCodeExecutionToolResultErrorParam) MarshalJSON() (data []byte, err error)

func (*BetaTextEditorCodeExecutionToolResultErrorParam) UnmarshalJSON

type BetaTextEditorCodeExecutionToolResultErrorParamErrorCode

type BetaTextEditorCodeExecutionToolResultErrorParamErrorCode string
const (
	BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeInvalidToolInput      BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "invalid_tool_input"
	BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeUnavailable           BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "unavailable"
	BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeTooManyRequests       BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "too_many_requests"
	BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeExecutionTimeExceeded BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "execution_time_exceeded"
	BetaTextEditorCodeExecutionToolResultErrorParamErrorCodeFileNotFound          BetaTextEditorCodeExecutionToolResultErrorParamErrorCode = "file_not_found"
)

type BetaTextEditorCodeExecutionViewResultBlock

type BetaTextEditorCodeExecutionViewResultBlock struct {
	Content string `json:"content" api:"required"`
	// Any of "text", "image", "pdf".
	FileType   BetaTextEditorCodeExecutionViewResultBlockFileType `json:"file_type" api:"required"`
	NumLines   int64                                              `json:"num_lines" api:"required"`
	StartLine  int64                                              `json:"start_line" api:"required"`
	TotalLines int64                                              `json:"total_lines" api:"required"`
	Type       constant.TextEditorCodeExecutionViewResult         `json:"type" default:"text_editor_code_execution_view_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		FileType    respjson.Field
		NumLines    respjson.Field
		StartLine   respjson.Field
		TotalLines  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTextEditorCodeExecutionViewResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BetaTextEditorCodeExecutionViewResultBlock) UnmarshalJSON

func (r *BetaTextEditorCodeExecutionViewResultBlock) UnmarshalJSON(data []byte) error

type BetaTextEditorCodeExecutionViewResultBlockFileType

type BetaTextEditorCodeExecutionViewResultBlockFileType string
const (
	BetaTextEditorCodeExecutionViewResultBlockFileTypeText  BetaTextEditorCodeExecutionViewResultBlockFileType = "text"
	BetaTextEditorCodeExecutionViewResultBlockFileTypeImage BetaTextEditorCodeExecutionViewResultBlockFileType = "image"
	BetaTextEditorCodeExecutionViewResultBlockFileTypePDF   BetaTextEditorCodeExecutionViewResultBlockFileType = "pdf"
)

type BetaTextEditorCodeExecutionViewResultBlockParam

type BetaTextEditorCodeExecutionViewResultBlockParam struct {
	Content string `json:"content" api:"required"`
	// Any of "text", "image", "pdf".
	FileType   BetaTextEditorCodeExecutionViewResultBlockParamFileType `json:"file_type,omitzero" api:"required"`
	NumLines   param.Opt[int64]                                        `json:"num_lines,omitzero"`
	StartLine  param.Opt[int64]                                        `json:"start_line,omitzero"`
	TotalLines param.Opt[int64]                                        `json:"total_lines,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_view_result".
	Type constant.TextEditorCodeExecutionViewResult `json:"type" default:"text_editor_code_execution_view_result"`
	// contains filtered or unexported fields
}

The properties Content, FileType, Type are required.

func (BetaTextEditorCodeExecutionViewResultBlockParam) MarshalJSON

func (r BetaTextEditorCodeExecutionViewResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaTextEditorCodeExecutionViewResultBlockParam) UnmarshalJSON

type BetaTextEditorCodeExecutionViewResultBlockParamFileType

type BetaTextEditorCodeExecutionViewResultBlockParamFileType string
const (
	BetaTextEditorCodeExecutionViewResultBlockParamFileTypeText  BetaTextEditorCodeExecutionViewResultBlockParamFileType = "text"
	BetaTextEditorCodeExecutionViewResultBlockParamFileTypeImage BetaTextEditorCodeExecutionViewResultBlockParamFileType = "image"
	BetaTextEditorCodeExecutionViewResultBlockParamFileTypePDF   BetaTextEditorCodeExecutionViewResultBlockParamFileType = "pdf"
)

type BetaThinkingBlock

type BetaThinkingBlock struct {
	// A value used to verify that this thinking block was generated by haijun when it
	// is passed back to the API.
	//
	// This is an opaque field and should not be interpreted or parsed. When passing
	// thinking blocks back to the API (required when using tools with extended
	// thinking), pass them back exactly as received, with this field intact.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	Signature string `json:"signature" api:"required"`
	// The text of haijun's thinking process for this block.
	Thinking string            `json:"thinking" api:"required"`
	Type     constant.Thinking `json:"type" default:"thinking"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Signature   respjson.Field
		Thinking    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaThinkingBlock) RawJSON

func (r BetaThinkingBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaThinkingBlock) ToParam

func (*BetaThinkingBlock) UnmarshalJSON

func (r *BetaThinkingBlock) UnmarshalJSON(data []byte) error

type BetaThinkingBlockParam

type BetaThinkingBlockParam struct {
	// The `signature` value of this thinking block, exactly as returned by the API in
	// a previous response. Used to verify that the block was generated by haijun.
	//
	// Thinking blocks must be passed back unmodified and in their original order; a
	// modified block results in a 400 `invalid_request_error`.
	Signature string `json:"signature" api:"required"`
	// The `thinking` text of this block as returned by the API.
	Thinking string `json:"thinking" api:"required"`
	// This field can be elided, and will marshal its zero value as "thinking".
	Type constant.Thinking `json:"type" default:"thinking"`
	// contains filtered or unexported fields
}

The properties Signature, Thinking, Type are required.

func (BetaThinkingBlockParam) MarshalJSON

func (r BetaThinkingBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaThinkingBlockParam) UnmarshalJSON

func (r *BetaThinkingBlockParam) UnmarshalJSON(data []byte) error

type BetaThinkingCapability

type BetaThinkingCapability struct {
	// Whether this capability is supported by the model.
	Supported bool `json:"supported" api:"required"`
	// Supported thinking type configurations.
	Types BetaThinkingTypes `json:"types" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Supported   respjson.Field
		Types       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Thinking capability details.

func (BetaThinkingCapability) RawJSON

func (r BetaThinkingCapability) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaThinkingCapability) UnmarshalJSON

func (r *BetaThinkingCapability) UnmarshalJSON(data []byte) error

type BetaThinkingConfigAdaptiveDisplay

type BetaThinkingConfigAdaptiveDisplay string

Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.

const (
	BetaThinkingConfigAdaptiveDisplaySummarized BetaThinkingConfigAdaptiveDisplay = "summarized"
	BetaThinkingConfigAdaptiveDisplayOmitted    BetaThinkingConfigAdaptiveDisplay = "omitted"
)

type BetaThinkingConfigAdaptiveParam

type BetaThinkingConfigAdaptiveParam struct {
	// Controls how thinking content appears in the response. When set to `summarized`,
	// thinking is returned normally. When set to `omitted`, thinking content is
	// redacted but a signature is returned for multi-turn continuity. Defaults to
	// `summarized`.
	//
	// Any of "summarized", "omitted".
	Display BetaThinkingConfigAdaptiveDisplay `json:"display,omitzero"`
	// This field can be elided, and will marshal its zero value as "adaptive".
	Type constant.Adaptive `json:"type" default:"adaptive"`
	// contains filtered or unexported fields
}

The property Type is required.

func (BetaThinkingConfigAdaptiveParam) MarshalJSON

func (r BetaThinkingConfigAdaptiveParam) MarshalJSON() (data []byte, err error)

func (*BetaThinkingConfigAdaptiveParam) UnmarshalJSON

func (r *BetaThinkingConfigAdaptiveParam) UnmarshalJSON(data []byte) error

type BetaThinkingConfigDisabledParam

type BetaThinkingConfigDisabledParam struct {
	Type constant.Disabled `json:"type" default:"disabled"`
	// contains filtered or unexported fields
}

This struct has a constant value, construct it with NewBetaThinkingConfigDisabledParam.

func NewBetaThinkingConfigDisabledParam

func NewBetaThinkingConfigDisabledParam() BetaThinkingConfigDisabledParam

func (BetaThinkingConfigDisabledParam) MarshalJSON

func (r BetaThinkingConfigDisabledParam) MarshalJSON() (data []byte, err error)

func (*BetaThinkingConfigDisabledParam) UnmarshalJSON

func (r *BetaThinkingConfigDisabledParam) UnmarshalJSON(data []byte) error

type BetaThinkingConfigEnabledDisplay

type BetaThinkingConfigEnabledDisplay string

Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.

const (
	BetaThinkingConfigEnabledDisplaySummarized BetaThinkingConfigEnabledDisplay = "summarized"
	BetaThinkingConfigEnabledDisplayOmitted    BetaThinkingConfigEnabledDisplay = "omitted"
)

type BetaThinkingConfigEnabledParam

type BetaThinkingConfigEnabledParam struct {
	// Determines how many tokens haijun can use for its internal reasoning process.
	// Larger budgets can enable more thorough analysis for complex problems, improving
	// response quality.
	//
	// Must be ≥1024 and less than `max_tokens`.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	BudgetTokens int64 `json:"budget_tokens" api:"required"`
	// Controls how thinking content appears in the response. When set to `summarized`,
	// thinking is returned normally. When set to `omitted`, thinking content is
	// redacted but a signature is returned for multi-turn continuity. Defaults to
	// `summarized`.
	//
	// Any of "summarized", "omitted".
	Display BetaThinkingConfigEnabledDisplay `json:"display,omitzero"`
	// This field can be elided, and will marshal its zero value as "enabled".
	Type constant.Enabled `json:"type" default:"enabled"`
	// contains filtered or unexported fields
}

The properties BudgetTokens, Type are required.

func (BetaThinkingConfigEnabledParam) MarshalJSON

func (r BetaThinkingConfigEnabledParam) MarshalJSON() (data []byte, err error)

func (*BetaThinkingConfigEnabledParam) UnmarshalJSON

func (r *BetaThinkingConfigEnabledParam) UnmarshalJSON(data []byte) error

type BetaThinkingConfigParamUnion

type BetaThinkingConfigParamUnion struct {
	OfEnabled  *BetaThinkingConfigEnabledParam  `json:",omitzero,inline"`
	OfDisabled *BetaThinkingConfigDisabledParam `json:",omitzero,inline"`
	OfAdaptive *BetaThinkingConfigAdaptiveParam `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 BetaThinkingConfigParamOfEnabled

func BetaThinkingConfigParamOfEnabled(budgetTokens int64) BetaThinkingConfigParamUnion

func (BetaThinkingConfigParamUnion) GetBudgetTokens

func (u BetaThinkingConfigParamUnion) GetBudgetTokens() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaThinkingConfigParamUnion) GetDisplay

func (u BetaThinkingConfigParamUnion) GetDisplay() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaThinkingConfigParamUnion) GetType

func (u BetaThinkingConfigParamUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaThinkingConfigParamUnion) MarshalJSON

func (u BetaThinkingConfigParamUnion) MarshalJSON() ([]byte, error)

func (*BetaThinkingConfigParamUnion) UnmarshalJSON

func (u *BetaThinkingConfigParamUnion) UnmarshalJSON(data []byte) error

type BetaThinkingDelta

type BetaThinkingDelta struct {
	// Per-frame increment of a coarse, running estimate of the tokens this thinking
	// block has produced so far. Present whenever the
	// `thinking-token-count-2026-05-13` beta is set; `null` unless `thinking.display`
	// resolves to `"omitted"` and a count is due this frame. Sum the increments across
	// `thinking_delta` frames on this block for a progress indicator. Each increment
	// is a non-negative multiple of a fixed quantum and the cadence is rate-limited,
	// so this is a deliberately lossy display hint, not a billable count;
	// `usage.output_tokens` remains authoritative.
	EstimatedTokens int64 `json:"estimated_tokens" api:"required"`
	// The incremental `thinking` text for this content block. Concatenate the
	// `thinking` values of successive `thinking_delta` events to assemble the block's
	// full `thinking` value.
	Thinking string                 `json:"thinking" api:"required"`
	Type     constant.ThinkingDelta `json:"type" default:"thinking_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimatedTokens respjson.Field
		Thinking        respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaThinkingDelta) RawJSON

func (r BetaThinkingDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaThinkingDelta) UnmarshalJSON

func (r *BetaThinkingDelta) UnmarshalJSON(data []byte) error

type BetaThinkingTurnsParam

type BetaThinkingTurnsParam struct {
	Value int64 `json:"value" api:"required"`
	// This field can be elided, and will marshal its zero value as "thinking_turns".
	Type constant.ThinkingTurns `json:"type" default:"thinking_turns"`
	// contains filtered or unexported fields
}

The properties Type, Value are required.

func (BetaThinkingTurnsParam) MarshalJSON

func (r BetaThinkingTurnsParam) MarshalJSON() (data []byte, err error)

func (*BetaThinkingTurnsParam) UnmarshalJSON

func (r *BetaThinkingTurnsParam) UnmarshalJSON(data []byte) error

type BetaThinkingTypes

type BetaThinkingTypes struct {
	// Whether the model supports thinking with type 'adaptive' (auto).
	Adaptive BetaCapabilitySupport `json:"adaptive" api:"required"`
	// Whether the model supports thinking with type 'enabled'.
	Enabled BetaCapabilitySupport `json:"enabled" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Adaptive    respjson.Field
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Supported thinking type configurations.

func (BetaThinkingTypes) RawJSON

func (r BetaThinkingTypes) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaThinkingTypes) UnmarshalJSON

func (r *BetaThinkingTypes) UnmarshalJSON(data []byte) error

type BetaTokenTaskBudgetParam

type BetaTokenTaskBudgetParam struct {
	// Total token budget across all contexts in the session.
	Total int64 `json:"total" api:"required"`
	// Remaining tokens in the budget. Use this to track usage across contexts when
	// implementing compaction client-side. Defaults to total if not provided.
	Remaining param.Opt[int64] `json:"remaining,omitzero"`
	// The budget type. Currently only 'tokens' is supported.
	//
	// This field can be elided, and will marshal its zero value as "tokens".
	Type constant.Tokens `json:"type" default:"tokens"`
	// contains filtered or unexported fields
}

User-configurable total token budget across contexts.

The properties Total, Type are required.

func (BetaTokenTaskBudgetParam) MarshalJSON

func (r BetaTokenTaskBudgetParam) MarshalJSON() (data []byte, err error)

func (*BetaTokenTaskBudgetParam) UnmarshalJSON

func (r *BetaTokenTaskBudgetParam) UnmarshalJSON(data []byte) error

type BetaTool

type BetaTool interface {
	// Name returns the tool's name
	Name() string
	// Description returns the tool's description
	Description() string
	// InputSchema returns the JSON schema for the tool's input
	InputSchema() BetaToolInputSchemaParam
	// Execute runs the tool with raw JSON input and returns one or more result blocks.
	Execute(ctx context.Context, input json.RawMessage) ([]BetaToolResultBlockParamContentUnion, error)
}

BetaTool represents a tool that can be executed by the BetaToolRunner.

type BetaToolBash20241022Param

type BetaToolBash20241022Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "bash".
	Name constant.Bash `json:"name" default:"bash"`
	// This field can be elided, and will marshal its zero value as "bash_20241022".
	Type constant.Bash20241022 `json:"type" default:"bash_20241022"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaToolBash20241022Param) MarshalJSON

func (r BetaToolBash20241022Param) MarshalJSON() (data []byte, err error)

func (*BetaToolBash20241022Param) UnmarshalJSON

func (r *BetaToolBash20241022Param) UnmarshalJSON(data []byte) error

type BetaToolBash20250124Param

type BetaToolBash20250124Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "bash".
	Name constant.Bash `json:"name" default:"bash"`
	// This field can be elided, and will marshal its zero value as "bash_20250124".
	Type constant.Bash20250124 `json:"type" default:"bash_20250124"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaToolBash20250124Param) MarshalJSON

func (r BetaToolBash20250124Param) MarshalJSON() (data []byte, err error)

func (*BetaToolBash20250124Param) UnmarshalJSON

func (r *BetaToolBash20250124Param) UnmarshalJSON(data []byte) error

type BetaToolChangeMCPToolReferenceParam

type BetaToolChangeMCPToolReferenceParam struct {
	Name       string `json:"name" api:"required"`
	ServerName string `json:"server_name" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "mcp_tool_reference".
	Type constant.MCPToolReference `json:"type" default:"mcp_tool_reference"`
	// contains filtered or unexported fields
}

Reference to a single MCP tool by its server and remote name — the same `server_name`/`name` pair `mcp_tool_use` carries.

The properties Name, ServerName, Type are required.

func (BetaToolChangeMCPToolReferenceParam) MarshalJSON

func (r BetaToolChangeMCPToolReferenceParam) MarshalJSON() (data []byte, err error)

func (*BetaToolChangeMCPToolReferenceParam) UnmarshalJSON

func (r *BetaToolChangeMCPToolReferenceParam) UnmarshalJSON(data []byte) error

type BetaToolChangeMCPToolsetReferenceParam

type BetaToolChangeMCPToolsetReferenceParam struct {
	ServerName string `json:"server_name" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "mcp_toolset_reference".
	Type constant.MCPToolsetReference `json:"type" default:"mcp_toolset_reference"`
	// contains filtered or unexported fields
}

Reference to every tool in the named MCP server's toolset.

The properties ServerName, Type are required.

func (BetaToolChangeMCPToolsetReferenceParam) MarshalJSON

func (r BetaToolChangeMCPToolsetReferenceParam) MarshalJSON() (data []byte, err error)

func (*BetaToolChangeMCPToolsetReferenceParam) UnmarshalJSON

func (r *BetaToolChangeMCPToolsetReferenceParam) UnmarshalJSON(data []byte) error

type BetaToolChangeToolReferenceParam

type BetaToolChangeToolReferenceParam struct {
	Name string `json:"name" api:"required"`
	// This field can be elided, and will marshal its zero value as "tool_reference".
	Type constant.ToolReference `json:"type" default:"tool_reference"`
	// contains filtered or unexported fields
}

Reference to a single tool the caller declared directly in `tools[]`. Does not accept the composed `{server}_{name}` form the server assigns to MCP-resolved tools — use `mcp_tool_reference` or `mcp_toolset_reference` for those.

The properties Name, Type are required.

func (BetaToolChangeToolReferenceParam) MarshalJSON

func (r BetaToolChangeToolReferenceParam) MarshalJSON() (data []byte, err error)

func (*BetaToolChangeToolReferenceParam) UnmarshalJSON

func (r *BetaToolChangeToolReferenceParam) UnmarshalJSON(data []byte) error

type BetaToolChoiceAnyParam

type BetaToolChoiceAnyParam struct {
	// Whether to disable parallel tool use.
	//
	// Defaults to `false`. If set to `true`, the model will output exactly one tool
	// use.
	DisableParallelToolUse param.Opt[bool] `json:"disable_parallel_tool_use,omitzero"`
	// This field can be elided, and will marshal its zero value as "any".
	Type constant.Any `json:"type" default:"any"`
	// contains filtered or unexported fields
}

The model will use any available tools.

The property Type is required.

func (BetaToolChoiceAnyParam) MarshalJSON

func (r BetaToolChoiceAnyParam) MarshalJSON() (data []byte, err error)

func (*BetaToolChoiceAnyParam) UnmarshalJSON

func (r *BetaToolChoiceAnyParam) UnmarshalJSON(data []byte) error

type BetaToolChoiceAutoParam

type BetaToolChoiceAutoParam struct {
	// Whether to disable parallel tool use.
	//
	// Defaults to `false`. If set to `true`, the model will output at most one tool
	// use.
	DisableParallelToolUse param.Opt[bool] `json:"disable_parallel_tool_use,omitzero"`
	// This field can be elided, and will marshal its zero value as "auto".
	Type constant.Auto `json:"type" default:"auto"`
	// contains filtered or unexported fields
}

The model will automatically decide whether to use tools.

The property Type is required.

func (BetaToolChoiceAutoParam) MarshalJSON

func (r BetaToolChoiceAutoParam) MarshalJSON() (data []byte, err error)

func (*BetaToolChoiceAutoParam) UnmarshalJSON

func (r *BetaToolChoiceAutoParam) UnmarshalJSON(data []byte) error

type BetaToolChoiceNoneParam

type BetaToolChoiceNoneParam struct {
	Type constant.None `json:"type" default:"none"`
	// contains filtered or unexported fields
}

The model will not be allowed to use tools.

This struct has a constant value, construct it with NewBetaToolChoiceNoneParam.

func NewBetaToolChoiceNoneParam

func NewBetaToolChoiceNoneParam() BetaToolChoiceNoneParam

func (BetaToolChoiceNoneParam) MarshalJSON

func (r BetaToolChoiceNoneParam) MarshalJSON() (data []byte, err error)

func (*BetaToolChoiceNoneParam) UnmarshalJSON

func (r *BetaToolChoiceNoneParam) UnmarshalJSON(data []byte) error

type BetaToolChoiceToolParam

type BetaToolChoiceToolParam struct {
	// The name of the tool to use.
	Name string `json:"name" api:"required"`
	// Whether to disable parallel tool use.
	//
	// Defaults to `false`. If set to `true`, the model will output exactly one tool
	// use.
	DisableParallelToolUse param.Opt[bool] `json:"disable_parallel_tool_use,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool".
	Type constant.Tool `json:"type" default:"tool"`
	// contains filtered or unexported fields
}

The model will use the specified tool with `tool_choice.name`.

The properties Name, Type are required.

func (BetaToolChoiceToolParam) MarshalJSON

func (r BetaToolChoiceToolParam) MarshalJSON() (data []byte, err error)

func (*BetaToolChoiceToolParam) UnmarshalJSON

func (r *BetaToolChoiceToolParam) UnmarshalJSON(data []byte) error

type BetaToolChoiceUnionParam

type BetaToolChoiceUnionParam struct {
	OfAuto *BetaToolChoiceAutoParam `json:",omitzero,inline"`
	OfAny  *BetaToolChoiceAnyParam  `json:",omitzero,inline"`
	OfTool *BetaToolChoiceToolParam `json:",omitzero,inline"`
	OfNone *BetaToolChoiceNoneParam `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 BetaToolChoiceParamOfTool

func BetaToolChoiceParamOfTool(name string) BetaToolChoiceUnionParam

func (BetaToolChoiceUnionParam) GetDisableParallelToolUse

func (u BetaToolChoiceUnionParam) GetDisableParallelToolUse() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaToolChoiceUnionParam) GetName

func (u BetaToolChoiceUnionParam) GetName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaToolChoiceUnionParam) GetType

func (u BetaToolChoiceUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaToolChoiceUnionParam) MarshalJSON

func (u BetaToolChoiceUnionParam) MarshalJSON() ([]byte, error)

func (*BetaToolChoiceUnionParam) UnmarshalJSON

func (u *BetaToolChoiceUnionParam) UnmarshalJSON(data []byte) error

type BetaToolComputerUse20241022Param

type BetaToolComputerUse20241022Param struct {
	// The height of the display in pixels.
	DisplayHeightPx int64 `json:"display_height_px" api:"required"`
	// The width of the display in pixels.
	DisplayWidthPx int64 `json:"display_width_px" api:"required"`
	// The X11 display number (e.g. 0, 1) for the display.
	DisplayNumber param.Opt[int64] `json:"display_number,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "computer".
	Name constant.Computer `json:"name" default:"computer"`
	// This field can be elided, and will marshal its zero value as
	// "computer_20241022".
	Type constant.Computer20241022 `json:"type" default:"computer_20241022"`
	// contains filtered or unexported fields
}

The properties DisplayHeightPx, DisplayWidthPx, Name, Type are required.

func (BetaToolComputerUse20241022Param) MarshalJSON

func (r BetaToolComputerUse20241022Param) MarshalJSON() (data []byte, err error)

func (*BetaToolComputerUse20241022Param) UnmarshalJSON

func (r *BetaToolComputerUse20241022Param) UnmarshalJSON(data []byte) error

type BetaToolComputerUse20250124Param

type BetaToolComputerUse20250124Param struct {
	// The height of the display in pixels.
	DisplayHeightPx int64 `json:"display_height_px" api:"required"`
	// The width of the display in pixels.
	DisplayWidthPx int64 `json:"display_width_px" api:"required"`
	// The X11 display number (e.g. 0, 1) for the display.
	DisplayNumber param.Opt[int64] `json:"display_number,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "computer".
	Name constant.Computer `json:"name" default:"computer"`
	// This field can be elided, and will marshal its zero value as
	// "computer_20250124".
	Type constant.Computer20250124 `json:"type" default:"computer_20250124"`
	// contains filtered or unexported fields
}

The properties DisplayHeightPx, DisplayWidthPx, Name, Type are required.

func (BetaToolComputerUse20250124Param) MarshalJSON

func (r BetaToolComputerUse20250124Param) MarshalJSON() (data []byte, err error)

func (*BetaToolComputerUse20250124Param) UnmarshalJSON

func (r *BetaToolComputerUse20250124Param) UnmarshalJSON(data []byte) error

type BetaToolComputerUse20251124Param

type BetaToolComputerUse20251124Param struct {
	// The height of the display in pixels.
	DisplayHeightPx int64 `json:"display_height_px" api:"required"`
	// The width of the display in pixels.
	DisplayWidthPx int64 `json:"display_width_px" api:"required"`
	// The X11 display number (e.g. 0, 1) for the display.
	DisplayNumber param.Opt[int64] `json:"display_number,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// Whether to enable an action to take a zoomed-in screenshot of the screen.
	EnableZoom param.Opt[bool] `json:"enable_zoom,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "computer".
	Name constant.Computer `json:"name" default:"computer"`
	// This field can be elided, and will marshal its zero value as
	// "computer_20251124".
	Type constant.Computer20251124 `json:"type" default:"computer_20251124"`
	// contains filtered or unexported fields
}

The properties DisplayHeightPx, DisplayWidthPx, Name, Type are required.

func (BetaToolComputerUse20251124Param) MarshalJSON

func (r BetaToolComputerUse20251124Param) MarshalJSON() (data []byte, err error)

func (*BetaToolComputerUse20251124Param) UnmarshalJSON

func (r *BetaToolComputerUse20251124Param) UnmarshalJSON(data []byte) error

type BetaToolInputSchemaParam

type BetaToolInputSchemaParam struct {
	Properties any      `json:"properties,omitzero"`
	Required   []string `json:"required,omitzero"`
	// This field can be elided, and will marshal its zero value as "object".
	Type        constant.Object `json:"type" default:"object"`
	ExtraFields map[string]any  `json:"-"`
	// contains filtered or unexported fields
}

[JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.

This defines the shape of the `input` that your tool accepts and that the model will produce.

The property Type is required.

func BetaToolInputSchema

func BetaToolInputSchema(jsonSchema map[string]any) BetaToolInputSchemaParam

BetaToolInputSchema creates a BetaToolInputSchemaParam from a JSON schema map. It transforms the schema to ensure compatibility with Juglow's tool calling requirements.

func (BetaToolInputSchemaParam) MarshalJSON

func (r BetaToolInputSchemaParam) MarshalJSON() (data []byte, err error)

func (*BetaToolInputSchemaParam) UnmarshalJSON

func (r *BetaToolInputSchemaParam) UnmarshalJSON(data []byte) error

type BetaToolParam

type BetaToolParam struct {
	// [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
	//
	// This defines the shape of the `input` that your tool accepts and that the model
	// will produce.
	InputSchema BetaToolInputSchemaParam `json:"input_schema,omitzero" api:"required"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	Name string `json:"name" api:"required"`
	// Enable eager input streaming for this tool. When true, tool input parameters
	// will be streamed incrementally as they are generated, and types will be inferred
	// on-the-fly rather than buffering the full JSON output. When false, streaming is
	// disabled for this tool even if the fine-grained-tool-streaming beta is active.
	// When null (default), uses the default behavior based on beta headers.
	EagerInputStreaming param.Opt[bool] `json:"eager_input_streaming,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// Description of what this tool does.
	//
	// Tool descriptions should be as detailed as possible. The more information that
	// the model has about what the tool is and how to use it, the better it will
	// perform. You can use natural language descriptions to reinforce important
	// aspects of the tool input JSON schema.
	Description param.Opt[string] `json:"description,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "custom".
	Type BetaToolType `json:"type,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// contains filtered or unexported fields
}

The properties InputSchema, Name are required.

func (BetaToolParam) MarshalJSON

func (r BetaToolParam) MarshalJSON() (data []byte, err error)

func (*BetaToolParam) UnmarshalJSON

func (r *BetaToolParam) UnmarshalJSON(data []byte) error

type BetaToolReferenceBlock

type BetaToolReferenceBlock struct {
	ToolName string                 `json:"tool_name" api:"required"`
	Type     constant.ToolReference `json:"type" default:"tool_reference"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ToolName    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaToolReferenceBlock) RawJSON

func (r BetaToolReferenceBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaToolReferenceBlock) ToParam

func (*BetaToolReferenceBlock) UnmarshalJSON

func (r *BetaToolReferenceBlock) UnmarshalJSON(data []byte) error

type BetaToolReferenceBlockParam

type BetaToolReferenceBlockParam struct {
	ToolName string `json:"tool_name" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool_reference".
	Type constant.ToolReference `json:"type" default:"tool_reference"`
	// contains filtered or unexported fields
}

Tool reference block that can be included in tool_result content.

The properties ToolName, Type are required.

func (BetaToolReferenceBlockParam) MarshalJSON

func (r BetaToolReferenceBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaToolReferenceBlockParam) UnmarshalJSON

func (r *BetaToolReferenceBlockParam) UnmarshalJSON(data []byte) error

type BetaToolResultBlockParam

type BetaToolResultBlockParam struct {
	ToolUseID string          `json:"tool_use_id" api:"required"`
	IsError   param.Opt[bool] `json:"is_error,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam         `json:"cache_control,omitzero"`
	Content      []BetaToolResultBlockParamContentUnion `json:"content,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool_result".
	Type constant.ToolResult `json:"type" default:"tool_result"`
	// contains filtered or unexported fields
}

The properties ToolUseID, Type are required.

func NewBetaToolResultTextBlockParam

func NewBetaToolResultTextBlockParam(toolUseID string, text string, isError bool) BetaToolResultBlockParam

func (BetaToolResultBlockParam) MarshalJSON

func (r BetaToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaToolResultBlockParam) UnmarshalJSON

func (r *BetaToolResultBlockParam) UnmarshalJSON(data []byte) error

type BetaToolResultBlockParamContentUnion

type BetaToolResultBlockParamContentUnion struct {
	OfText          *BetaTextBlockParam            `json:",omitzero,inline"`
	OfImage         *BetaImageBlockParam           `json:",omitzero,inline"`
	OfSearchResult  *BetaSearchResultBlockParam    `json:",omitzero,inline"`
	OfDocument      *BetaRequestDocumentBlockParam `json:",omitzero,inline"`
	OfToolReference *BetaToolReferenceBlockParam   `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 (BetaToolResultBlockParamContentUnion) GetCacheControl

Returns a pointer to the underlying variant's CacheControl property, if present.

func (BetaToolResultBlockParamContentUnion) GetCitations

func (u BetaToolResultBlockParamContentUnion) GetCitations() (res betaToolResultBlockParamContentUnionCitations)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BetaToolResultBlockParamContentUnion) GetContext

Returns a pointer to the underlying variant's property, if present.

func (BetaToolResultBlockParamContentUnion) GetSource

func (u BetaToolResultBlockParamContentUnion) GetSource() (res betaToolResultBlockParamContentUnionSource)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (BetaToolResultBlockParamContentUnion) GetText

Returns a pointer to the underlying variant's property, if present.

func (BetaToolResultBlockParamContentUnion) GetTitle

Returns a pointer to the underlying variant's property, if present.

func (BetaToolResultBlockParamContentUnion) GetToolName

Returns a pointer to the underlying variant's property, if present.

func (BetaToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaToolResultBlockParamContentUnion) MarshalJSON

func (u BetaToolResultBlockParamContentUnion) MarshalJSON() ([]byte, error)

func (*BetaToolResultBlockParamContentUnion) UnmarshalJSON

func (u *BetaToolResultBlockParamContentUnion) UnmarshalJSON(data []byte) error

type BetaToolRunner

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

BetaToolRunner manages the automatic conversation loop between the assistant and tools using non-streaming API calls. It implements an iterator pattern for processing conversation turns.

A BetaToolRunner is NOT safe for concurrent use. All methods must be called from a single goroutine. However, tool handlers ARE called concurrently when multiple tools are invoked in a single turn - ensure your handlers are thread-safe.

func (*BetaToolRunner) All

All returns an iterator that yields all messages until the conversation completes. This is a convenience method for iterating over the entire conversation.

Example usage:

for message, err := range runner.All(ctx) {
    if err != nil {
        return err
    }
    // process message
}

func (*BetaToolRunner) AppendMessages

func (b *BetaToolRunner) AppendMessages(messages ...BetaMessageParam)

AppendMessages adds messages to the conversation history. This is a convenience method equivalent to:

runner.Params.Messages = append(runner.Params.Messages, messages...)

func (*BetaToolRunner) Err

func (b *BetaToolRunner) Err() error

Err returns the last error that occurred during iteration, if any. This is useful when using All() or AllStreaming() to check for errors after the iteration completes.

func (*BetaToolRunner) IsCompleted

func (b *BetaToolRunner) IsCompleted() bool

IsCompleted returns true if the conversation has finished, either because the model stopped using tools or the maximum iteration limit was reached.

func (*BetaToolRunner) IterationCount

func (b *BetaToolRunner) IterationCount() int

IterationCount returns the number of API calls made so far. This is incremented each time a turn makes an API call.

func (*BetaToolRunner) LastMessage

func (b *BetaToolRunner) LastMessage() *BetaMessage

LastMessage returns the most recent assistant message, or nil if no messages have been received yet.

func (*BetaToolRunner) Messages

func (b *BetaToolRunner) Messages() []BetaMessageParam

Messages returns a copy of the current conversation history. The returned slice can be safely modified without affecting the runner's state.

func (*BetaToolRunner) NextMessage

func (r *BetaToolRunner) NextMessage(ctx context.Context) (*BetaMessage, error)

NextMessage advances the conversation by one turn. It executes any pending tool calls from the previous message, then makes an API call to get the model's next response.

Returns:

  • (message, nil) on success with the assistant's response
  • (nil, nil) when the conversation is complete (no more tool calls or max iterations reached)
  • (nil, error) if an error occurred during tool execution or API call

func (*BetaToolRunner) RunToCompletion

func (r *BetaToolRunner) RunToCompletion(ctx context.Context) (*BetaMessage, error)

RunToCompletion repeatedly calls NextMessage until the conversation is complete, either because the model stopped using tools or the maximum iteration limit was reached.

Returns the final assistant message and any error that occurred.

type BetaToolRunnerParams

type BetaToolRunnerParams struct {
	BetaMessageNewParams
	// MaxIterations limits the number of API calls. When set to 0 (the default),
	// there is no limit and the runner continues until the model stops using tools.
	MaxIterations int
}

BetaToolRunnerParams contains parameters for creating a BetaToolRunner or BetaToolRunnerStreaming.

type BetaToolRunnerStreaming

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

BetaToolRunnerStreaming manages the automatic conversation loop between the assistant and tools using streaming API calls. It implements an iterator pattern for processing streaming events across conversation turns.

A BetaToolRunnerStreaming is NOT safe for concurrent use. All methods must be called from a single goroutine. However, tool handlers ARE called concurrently when multiple tools are invoked in a single turn - ensure your handlers are thread-safe.

func (*BetaToolRunnerStreaming) AllStreaming

AllStreaming returns an iterator of iterators, where each inner iterator yields streaming events for a single turn of the conversation. The outer iterator continues until the conversation completes.

Example usage:

for events, err := range runner.AllStreaming(ctx) {
    if err != nil {
        return err
    }
    for event, err := range events {
        if err != nil {
            return err
        }
        // process streaming event
    }
}

func (*BetaToolRunnerStreaming) AppendMessages

func (b *BetaToolRunnerStreaming) AppendMessages(messages ...BetaMessageParam)

AppendMessages adds messages to the conversation history. This is a convenience method equivalent to:

runner.Params.Messages = append(runner.Params.Messages, messages...)

func (*BetaToolRunnerStreaming) Err

func (b *BetaToolRunnerStreaming) Err() error

Err returns the last error that occurred during iteration, if any. This is useful when using All() or AllStreaming() to check for errors after the iteration completes.

func (*BetaToolRunnerStreaming) IsCompleted

func (b *BetaToolRunnerStreaming) IsCompleted() bool

IsCompleted returns true if the conversation has finished, either because the model stopped using tools or the maximum iteration limit was reached.

func (*BetaToolRunnerStreaming) IterationCount

func (b *BetaToolRunnerStreaming) IterationCount() int

IterationCount returns the number of API calls made so far. This is incremented each time a turn makes an API call.

func (*BetaToolRunnerStreaming) LastMessage

func (b *BetaToolRunnerStreaming) LastMessage() *BetaMessage

LastMessage returns the most recent assistant message, or nil if no messages have been received yet.

func (*BetaToolRunnerStreaming) Messages

func (b *BetaToolRunnerStreaming) Messages() []BetaMessageParam

Messages returns a copy of the current conversation history. The returned slice can be safely modified without affecting the runner's state.

func (*BetaToolRunnerStreaming) NextStreaming

NextStreaming advances the conversation by one turn with streaming. It executes any pending tool calls from the previous message, then makes a streaming API call.

Returns an iterator that yields streaming events as they arrive. The iterator should be fully consumed to ensure the message is properly accumulated for subsequent turns.

If an error occurs, it will be yielded as the second value in the iterator pair. Check IsCompleted() after consuming the iterator to determine if the conversation has finished.

type BetaToolSearchToolBm25_20251119Param

type BetaToolSearchToolBm25_20251119Param struct {
	// Any of "tool_search_tool_bm25_20251119", "tool_search_tool_bm25".
	Type BetaToolSearchToolBm25_20251119Type `json:"type,omitzero" api:"required"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_bm25".
	Name constant.ToolSearchToolBm25 `json:"name" default:"tool_search_tool_bm25"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaToolSearchToolBm25_20251119Param) MarshalJSON

func (r BetaToolSearchToolBm25_20251119Param) MarshalJSON() (data []byte, err error)

func (*BetaToolSearchToolBm25_20251119Param) UnmarshalJSON

func (r *BetaToolSearchToolBm25_20251119Param) UnmarshalJSON(data []byte) error

type BetaToolSearchToolBm25_20251119Type

type BetaToolSearchToolBm25_20251119Type string
const (
	BetaToolSearchToolBm25_20251119TypeToolSearchToolBm25_20251119 BetaToolSearchToolBm25_20251119Type = "tool_search_tool_bm25_20251119"
	BetaToolSearchToolBm25_20251119TypeToolSearchToolBm25          BetaToolSearchToolBm25_20251119Type = "tool_search_tool_bm25"
)

type BetaToolSearchToolRegex20251119Param

type BetaToolSearchToolRegex20251119Param struct {
	// Any of "tool_search_tool_regex_20251119", "tool_search_tool_regex".
	Type BetaToolSearchToolRegex20251119Type `json:"type,omitzero" api:"required"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_regex".
	Name constant.ToolSearchToolRegex `json:"name" default:"tool_search_tool_regex"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaToolSearchToolRegex20251119Param) MarshalJSON

func (r BetaToolSearchToolRegex20251119Param) MarshalJSON() (data []byte, err error)

func (*BetaToolSearchToolRegex20251119Param) UnmarshalJSON

func (r *BetaToolSearchToolRegex20251119Param) UnmarshalJSON(data []byte) error

type BetaToolSearchToolRegex20251119Type

type BetaToolSearchToolRegex20251119Type string
const (
	BetaToolSearchToolRegex20251119TypeToolSearchToolRegex20251119 BetaToolSearchToolRegex20251119Type = "tool_search_tool_regex_20251119"
	BetaToolSearchToolRegex20251119TypeToolSearchToolRegex         BetaToolSearchToolRegex20251119Type = "tool_search_tool_regex"
)

type BetaToolSearchToolResultBlock

type BetaToolSearchToolResultBlock struct {
	Content   BetaToolSearchToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                    `json:"tool_use_id" api:"required"`
	Type      constant.ToolSearchToolResult             `json:"type" default:"tool_search_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaToolSearchToolResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaToolSearchToolResultBlock) ToParam

func (*BetaToolSearchToolResultBlock) UnmarshalJSON

func (r *BetaToolSearchToolResultBlock) UnmarshalJSON(data []byte) error

type BetaToolSearchToolResultBlockContentUnion

type BetaToolSearchToolResultBlockContentUnion struct {
	// This field is from variant [BetaToolSearchToolResultError].
	ErrorCode BetaToolSearchToolResultErrorErrorCode `json:"error_code"`
	// This field is from variant [BetaToolSearchToolResultError].
	ErrorMessage string `json:"error_message"`
	Type         string `json:"type"`
	// This field is from variant [BetaToolSearchToolSearchResultBlock].
	ToolReferences []BetaToolReferenceBlock `json:"tool_references"`
	JSON           struct {
		ErrorCode      respjson.Field
		ErrorMessage   respjson.Field
		Type           respjson.Field
		ToolReferences respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaToolSearchToolResultBlockContentUnion contains all possible properties and values from BetaToolSearchToolResultError, BetaToolSearchToolSearchResultBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaToolSearchToolResultBlockContentUnion) AsResponseToolSearchToolResultError

func (u BetaToolSearchToolResultBlockContentUnion) AsResponseToolSearchToolResultError() (v BetaToolSearchToolResultError)

func (BetaToolSearchToolResultBlockContentUnion) AsResponseToolSearchToolSearchResultBlock

func (u BetaToolSearchToolResultBlockContentUnion) AsResponseToolSearchToolSearchResultBlock() (v BetaToolSearchToolSearchResultBlock)

func (BetaToolSearchToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaToolSearchToolResultBlockContentUnion) UnmarshalJSON

func (r *BetaToolSearchToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type BetaToolSearchToolResultBlockParam

type BetaToolSearchToolResultBlockParam struct {
	Content   BetaToolSearchToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                         `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_result".
	Type constant.ToolSearchToolResult `json:"type" default:"tool_search_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (BetaToolSearchToolResultBlockParam) MarshalJSON

func (r BetaToolSearchToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaToolSearchToolResultBlockParam) UnmarshalJSON

func (r *BetaToolSearchToolResultBlockParam) UnmarshalJSON(data []byte) error

type BetaToolSearchToolResultBlockParamContentUnion

type BetaToolSearchToolResultBlockParamContentUnion struct {
	OfRequestToolSearchToolResultError       *BetaToolSearchToolResultErrorParam       `json:",omitzero,inline"`
	OfRequestToolSearchToolSearchResultBlock *BetaToolSearchToolSearchResultBlockParam `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 (BetaToolSearchToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (BetaToolSearchToolResultBlockParamContentUnion) GetErrorMessage

Returns a pointer to the underlying variant's property, if present.

func (BetaToolSearchToolResultBlockParamContentUnion) GetToolReferences

Returns a pointer to the underlying variant's property, if present.

func (BetaToolSearchToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaToolSearchToolResultBlockParamContentUnion) MarshalJSON

func (*BetaToolSearchToolResultBlockParamContentUnion) UnmarshalJSON

type BetaToolSearchToolResultError

type BetaToolSearchToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded".
	ErrorCode    BetaToolSearchToolResultErrorErrorCode `json:"error_code" api:"required"`
	ErrorMessage string                                 `json:"error_message" api:"required"`
	Type         constant.ToolSearchToolResultError     `json:"type" default:"tool_search_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode    respjson.Field
		ErrorMessage respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaToolSearchToolResultError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaToolSearchToolResultError) UnmarshalJSON

func (r *BetaToolSearchToolResultError) UnmarshalJSON(data []byte) error

type BetaToolSearchToolResultErrorErrorCode

type BetaToolSearchToolResultErrorErrorCode string
const (
	BetaToolSearchToolResultErrorErrorCodeInvalidToolInput      BetaToolSearchToolResultErrorErrorCode = "invalid_tool_input"
	BetaToolSearchToolResultErrorErrorCodeUnavailable           BetaToolSearchToolResultErrorErrorCode = "unavailable"
	BetaToolSearchToolResultErrorErrorCodeTooManyRequests       BetaToolSearchToolResultErrorErrorCode = "too_many_requests"
	BetaToolSearchToolResultErrorErrorCodeExecutionTimeExceeded BetaToolSearchToolResultErrorErrorCode = "execution_time_exceeded"
)

type BetaToolSearchToolResultErrorParam

type BetaToolSearchToolResultErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded".
	ErrorCode    BetaToolSearchToolResultErrorParamErrorCode `json:"error_code,omitzero" api:"required"`
	ErrorMessage param.Opt[string]                           `json:"error_message,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_result_error".
	Type constant.ToolSearchToolResultError `json:"type" default:"tool_search_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (BetaToolSearchToolResultErrorParam) MarshalJSON

func (r BetaToolSearchToolResultErrorParam) MarshalJSON() (data []byte, err error)

func (*BetaToolSearchToolResultErrorParam) UnmarshalJSON

func (r *BetaToolSearchToolResultErrorParam) UnmarshalJSON(data []byte) error

type BetaToolSearchToolResultErrorParamErrorCode

type BetaToolSearchToolResultErrorParamErrorCode string
const (
	BetaToolSearchToolResultErrorParamErrorCodeInvalidToolInput      BetaToolSearchToolResultErrorParamErrorCode = "invalid_tool_input"
	BetaToolSearchToolResultErrorParamErrorCodeUnavailable           BetaToolSearchToolResultErrorParamErrorCode = "unavailable"
	BetaToolSearchToolResultErrorParamErrorCodeTooManyRequests       BetaToolSearchToolResultErrorParamErrorCode = "too_many_requests"
	BetaToolSearchToolResultErrorParamErrorCodeExecutionTimeExceeded BetaToolSearchToolResultErrorParamErrorCode = "execution_time_exceeded"
)

type BetaToolSearchToolSearchResultBlock

type BetaToolSearchToolSearchResultBlock struct {
	ToolReferences []BetaToolReferenceBlock            `json:"tool_references" api:"required"`
	Type           constant.ToolSearchToolSearchResult `json:"type" default:"tool_search_tool_search_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ToolReferences respjson.Field
		Type           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaToolSearchToolSearchResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BetaToolSearchToolSearchResultBlock) UnmarshalJSON

func (r *BetaToolSearchToolSearchResultBlock) UnmarshalJSON(data []byte) error

type BetaToolSearchToolSearchResultBlockParam

type BetaToolSearchToolSearchResultBlockParam struct {
	ToolReferences []BetaToolReferenceBlockParam `json:"tool_references,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_search_result".
	Type constant.ToolSearchToolSearchResult `json:"type" default:"tool_search_tool_search_result"`
	// contains filtered or unexported fields
}

The properties ToolReferences, Type are required.

func (BetaToolSearchToolSearchResultBlockParam) MarshalJSON

func (r BetaToolSearchToolSearchResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaToolSearchToolSearchResultBlockParam) UnmarshalJSON

func (r *BetaToolSearchToolSearchResultBlockParam) UnmarshalJSON(data []byte) error

type BetaToolTextEditor20241022Param

type BetaToolTextEditor20241022Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "str_replace_editor".
	Name constant.StrReplaceEditor `json:"name" default:"str_replace_editor"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_20241022".
	Type constant.TextEditor20241022 `json:"type" default:"text_editor_20241022"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaToolTextEditor20241022Param) MarshalJSON

func (r BetaToolTextEditor20241022Param) MarshalJSON() (data []byte, err error)

func (*BetaToolTextEditor20241022Param) UnmarshalJSON

func (r *BetaToolTextEditor20241022Param) UnmarshalJSON(data []byte) error

type BetaToolTextEditor20250124Param

type BetaToolTextEditor20250124Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "str_replace_editor".
	Name constant.StrReplaceEditor `json:"name" default:"str_replace_editor"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_20250124".
	Type constant.TextEditor20250124 `json:"type" default:"text_editor_20250124"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaToolTextEditor20250124Param) MarshalJSON

func (r BetaToolTextEditor20250124Param) MarshalJSON() (data []byte, err error)

func (*BetaToolTextEditor20250124Param) UnmarshalJSON

func (r *BetaToolTextEditor20250124Param) UnmarshalJSON(data []byte) error

type BetaToolTextEditor20250429Param

type BetaToolTextEditor20250429Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "str_replace_based_edit_tool".
	Name constant.StrReplaceBasedEditTool `json:"name" default:"str_replace_based_edit_tool"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_20250429".
	Type constant.TextEditor20250429 `json:"type" default:"text_editor_20250429"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaToolTextEditor20250429Param) MarshalJSON

func (r BetaToolTextEditor20250429Param) MarshalJSON() (data []byte, err error)

func (*BetaToolTextEditor20250429Param) UnmarshalJSON

func (r *BetaToolTextEditor20250429Param) UnmarshalJSON(data []byte) error

type BetaToolTextEditor20250728Param

type BetaToolTextEditor20250728Param struct {
	// Maximum number of characters to display when viewing a file. If not specified,
	// defaults to displaying the full file.
	MaxCharacters param.Opt[int64] `json:"max_characters,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any               `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "str_replace_based_edit_tool".
	Name constant.StrReplaceBasedEditTool `json:"name" default:"str_replace_based_edit_tool"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_20250728".
	Type constant.TextEditor20250728 `json:"type" default:"text_editor_20250728"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaToolTextEditor20250728Param) MarshalJSON

func (r BetaToolTextEditor20250728Param) MarshalJSON() (data []byte, err error)

func (*BetaToolTextEditor20250728Param) UnmarshalJSON

func (r *BetaToolTextEditor20250728Param) UnmarshalJSON(data []byte) error

type BetaToolType

type BetaToolType string
const (
	BetaToolTypeCustom BetaToolType = "custom"
)

type BetaToolUnionParam

type BetaToolUnionParam struct {
	OfTool                        *BetaToolParam                        `json:",omitzero,inline"`
	OfBashTool20241022            *BetaToolBash20241022Param            `json:",omitzero,inline"`
	OfBashTool20250124            *BetaToolBash20250124Param            `json:",omitzero,inline"`
	OfCodeExecutionTool20250522   *BetaCodeExecutionTool20250522Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20250825   *BetaCodeExecutionTool20250825Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20260120   *BetaCodeExecutionTool20260120Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20260521   *BetaCodeExecutionTool20260521Param   `json:",omitzero,inline"`
	OfComputerUseTool20241022     *BetaToolComputerUse20241022Param     `json:",omitzero,inline"`
	OfMemoryTool20250818          *BetaMemoryTool20250818Param          `json:",omitzero,inline"`
	OfComputerUseTool20250124     *BetaToolComputerUse20250124Param     `json:",omitzero,inline"`
	OfTextEditor20241022          *BetaToolTextEditor20241022Param      `json:",omitzero,inline"`
	OfComputerUseTool20251124     *BetaToolComputerUse20251124Param     `json:",omitzero,inline"`
	OfTextEditor20250124          *BetaToolTextEditor20250124Param      `json:",omitzero,inline"`
	OfTextEditor20250429          *BetaToolTextEditor20250429Param      `json:",omitzero,inline"`
	OfTextEditor20250728          *BetaToolTextEditor20250728Param      `json:",omitzero,inline"`
	OfWebSearchTool20250305       *BetaWebSearchTool20250305Param       `json:",omitzero,inline"`
	OfWebFetchTool20250910        *BetaWebFetchTool20250910Param        `json:",omitzero,inline"`
	OfWebSearchTool20260209       *BetaWebSearchTool20260209Param       `json:",omitzero,inline"`
	OfWebFetchTool20260209        *BetaWebFetchTool20260209Param        `json:",omitzero,inline"`
	OfWebFetchTool20260309        *BetaWebFetchTool20260309Param        `json:",omitzero,inline"`
	OfWebSearchTool20260318       *BetaWebSearchTool20260318Param       `json:",omitzero,inline"`
	OfWebFetchTool20260318        *BetaWebFetchTool20260318Param        `json:",omitzero,inline"`
	OfAdvisorTool20260301         *BetaAdvisorTool20260301Param         `json:",omitzero,inline"`
	OfToolSearchToolBm25_20251119 *BetaToolSearchToolBm25_20251119Param `json:",omitzero,inline"`
	OfToolSearchToolRegex20251119 *BetaToolSearchToolRegex20251119Param `json:",omitzero,inline"`
	OfMCPToolset                  *BetaMCPToolsetParam                  `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 BetaToolUnionParamOfAdvisorTool20260301

func BetaToolUnionParamOfAdvisorTool20260301(model Model) BetaToolUnionParam

func BetaToolUnionParamOfComputerUseTool20241022

func BetaToolUnionParamOfComputerUseTool20241022(displayHeightPx int64, displayWidthPx int64) BetaToolUnionParam

func BetaToolUnionParamOfComputerUseTool20250124

func BetaToolUnionParamOfComputerUseTool20250124(displayHeightPx int64, displayWidthPx int64) BetaToolUnionParam

func BetaToolUnionParamOfComputerUseTool20251124

func BetaToolUnionParamOfComputerUseTool20251124(displayHeightPx int64, displayWidthPx int64) BetaToolUnionParam

func BetaToolUnionParamOfMCPToolset

func BetaToolUnionParamOfMCPToolset(mcpServerName string) BetaToolUnionParam

func BetaToolUnionParamOfTool

func BetaToolUnionParamOfTool(inputSchema BetaToolInputSchemaParam, name string) BetaToolUnionParam

func BetaToolUnionParamOfToolSearchToolBm25_20251119

func BetaToolUnionParamOfToolSearchToolBm25_20251119(type_ BetaToolSearchToolBm25_20251119Type) BetaToolUnionParam

func BetaToolUnionParamOfToolSearchToolRegex20251119

func BetaToolUnionParamOfToolSearchToolRegex20251119(type_ BetaToolSearchToolRegex20251119Type) BetaToolUnionParam

func (BetaToolUnionParam) GetAllowedCallers

func (u BetaToolUnionParam) GetAllowedCallers() []string

Returns a pointer to the underlying variant's AllowedCallers property, if present.

func (BetaToolUnionParam) GetAllowedDomains

func (u BetaToolUnionParam) GetAllowedDomains() []string

Returns a pointer to the underlying variant's AllowedDomains property, if present.

func (BetaToolUnionParam) GetBlockedDomains

func (u BetaToolUnionParam) GetBlockedDomains() []string

Returns a pointer to the underlying variant's BlockedDomains property, if present.

func (BetaToolUnionParam) GetCacheControl

Returns a pointer to the underlying variant's CacheControl property, if present.

func (BetaToolUnionParam) GetCaching

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetCitations

func (u BetaToolUnionParam) GetCitations() *BetaCitationsConfigParam

Returns a pointer to the underlying variant's Citations property, if present.

func (BetaToolUnionParam) GetConfigs

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetDefaultConfig

func (u BetaToolUnionParam) GetDefaultConfig() *BetaMCPToolDefaultConfigParam

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetDeferLoading

func (u BetaToolUnionParam) GetDeferLoading() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetDescription

func (u BetaToolUnionParam) GetDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetDisplayHeightPx

func (u BetaToolUnionParam) GetDisplayHeightPx() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetDisplayNumber

func (u BetaToolUnionParam) GetDisplayNumber() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetDisplayWidthPx

func (u BetaToolUnionParam) GetDisplayWidthPx() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetEagerInputStreaming

func (u BetaToolUnionParam) GetEagerInputStreaming() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetEnableZoom

func (u BetaToolUnionParam) GetEnableZoom() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetInputExamples

func (u BetaToolUnionParam) GetInputExamples() []map[string]any

Returns a pointer to the underlying variant's InputExamples property, if present.

func (BetaToolUnionParam) GetInputSchema

func (u BetaToolUnionParam) GetInputSchema() *BetaToolInputSchemaParam

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetMCPServerName

func (u BetaToolUnionParam) GetMCPServerName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetMaxCharacters

func (u BetaToolUnionParam) GetMaxCharacters() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetMaxContentTokens

func (u BetaToolUnionParam) GetMaxContentTokens() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetMaxTokens

func (u BetaToolUnionParam) GetMaxTokens() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetMaxUses

func (u BetaToolUnionParam) GetMaxUses() *int64

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetModel

func (u BetaToolUnionParam) GetModel() *Model

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetName

func (u BetaToolUnionParam) GetName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetResponseInclusion

func (u BetaToolUnionParam) GetResponseInclusion() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetStrict

func (u BetaToolUnionParam) GetStrict() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetType

func (u BetaToolUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetUseCache

func (u BetaToolUnionParam) GetUseCache() *bool

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUnionParam) GetUserLocation

func (u BetaToolUnionParam) GetUserLocation() *BetaUserLocationParam

Returns a pointer to the underlying variant's UserLocation property, if present.

func (BetaToolUnionParam) MarshalJSON

func (u BetaToolUnionParam) MarshalJSON() ([]byte, error)

func (*BetaToolUnionParam) UnmarshalJSON

func (u *BetaToolUnionParam) UnmarshalJSON(data []byte) error

type BetaToolUseBlock

type BetaToolUseBlock struct {
	ID    string           `json:"id" api:"required"`
	Input any              `json:"input" api:"required"`
	Name  string           `json:"name" api:"required"`
	Type  constant.ToolUse `json:"type" default:"tool_use"`
	// Tool invocation directly from the model.
	Caller BetaToolUseBlockCallerUnion `json:"caller"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Input       respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		Caller      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaToolUseBlock) RawJSON

func (r BetaToolUseBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaToolUseBlock) ToParam

func (*BetaToolUseBlock) UnmarshalJSON

func (r *BetaToolUseBlock) UnmarshalJSON(data []byte) error

type BetaToolUseBlockCallerUnion

type BetaToolUseBlockCallerUnion struct {
	// Any of "direct", "code_execution_20250825", "code_execution_20260120".
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaToolUseBlockCallerUnion contains all possible properties and values from BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller20260120.

Use the BetaToolUseBlockCallerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaToolUseBlockCallerUnion) AsAny

func (u BetaToolUseBlockCallerUnion) AsAny() anyBetaToolUseBlockCaller

Use the following switch statement to find the correct variant

switch variant := BetaToolUseBlockCallerUnion.AsAny().(type) {
case Juglow.BetaDirectCaller:
case Juglow.BetaServerToolCaller:
case Juglow.BetaServerToolCaller20260120:
default:
  fmt.Errorf("no variant present")
}

func (BetaToolUseBlockCallerUnion) AsCodeExecution20250825

func (u BetaToolUseBlockCallerUnion) AsCodeExecution20250825() (v BetaServerToolCaller)

func (BetaToolUseBlockCallerUnion) AsCodeExecution20260120

func (u BetaToolUseBlockCallerUnion) AsCodeExecution20260120() (v BetaServerToolCaller20260120)

func (BetaToolUseBlockCallerUnion) AsDirect

func (BetaToolUseBlockCallerUnion) RawJSON

func (u BetaToolUseBlockCallerUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaToolUseBlockCallerUnion) UnmarshalJSON

func (r *BetaToolUseBlockCallerUnion) UnmarshalJSON(data []byte) error

type BetaToolUseBlockParam

type BetaToolUseBlockParam struct {
	ID    string `json:"id" api:"required"`
	Input any    `json:"input,omitzero" api:"required"`
	Name  string `json:"name" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Tool invocation directly from the model.
	Caller BetaToolUseBlockParamCallerUnion `json:"caller,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool_use".
	Type constant.ToolUse `json:"type" default:"tool_use"`
	// contains filtered or unexported fields
}

The properties ID, Input, Name, Type are required.

func (BetaToolUseBlockParam) MarshalJSON

func (r BetaToolUseBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaToolUseBlockParam) UnmarshalJSON

func (r *BetaToolUseBlockParam) UnmarshalJSON(data []byte) error

type BetaToolUseBlockParamCallerUnion

type BetaToolUseBlockParamCallerUnion struct {
	OfDirect                *BetaDirectCallerParam             `json:",omitzero,inline"`
	OfCodeExecution20250825 *BetaServerToolCallerParam         `json:",omitzero,inline"`
	OfCodeExecution20260120 *BetaServerToolCaller20260120Param `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 (BetaToolUseBlockParamCallerUnion) GetToolID

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUseBlockParamCallerUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaToolUseBlockParamCallerUnion) MarshalJSON

func (u BetaToolUseBlockParamCallerUnion) MarshalJSON() ([]byte, error)

func (*BetaToolUseBlockParamCallerUnion) UnmarshalJSON

func (u *BetaToolUseBlockParamCallerUnion) UnmarshalJSON(data []byte) error

type BetaToolUsesKeepParam

type BetaToolUsesKeepParam struct {
	Value int64 `json:"value" api:"required"`
	// This field can be elided, and will marshal its zero value as "tool_uses".
	Type constant.ToolUses `json:"type" default:"tool_uses"`
	// contains filtered or unexported fields
}

The properties Type, Value are required.

func (BetaToolUsesKeepParam) MarshalJSON

func (r BetaToolUsesKeepParam) MarshalJSON() (data []byte, err error)

func (*BetaToolUsesKeepParam) UnmarshalJSON

func (r *BetaToolUsesKeepParam) UnmarshalJSON(data []byte) error

type BetaToolUsesTriggerParam

type BetaToolUsesTriggerParam struct {
	Value int64 `json:"value" api:"required"`
	// This field can be elided, and will marshal its zero value as "tool_uses".
	Type constant.ToolUses `json:"type" default:"tool_uses"`
	// contains filtered or unexported fields
}

The properties Type, Value are required.

func (BetaToolUsesTriggerParam) MarshalJSON

func (r BetaToolUsesTriggerParam) MarshalJSON() (data []byte, err error)

func (*BetaToolUsesTriggerParam) UnmarshalJSON

func (r *BetaToolUsesTriggerParam) UnmarshalJSON(data []byte) error

type BetaTrack added in v1.71.2

type BetaTrack struct {
	// Track ID
	TrackID string `json:"track_id" api:"required"`
	// Type of track - either 'Juglow' (built-in) or 'custom' (user-defined)
	//
	// Any of "Juglow", "custom".
	Type BetaTrackType `json:"type" api:"required"`
	// Track version or 'latest' for most recent version
	Version string `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TrackID     respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A track that was loaded in a container (response model).

func (BetaTrack) RawJSON added in v1.71.2

func (r BetaTrack) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTrack) UnmarshalJSON added in v1.71.2

func (r *BetaTrack) UnmarshalJSON(data []byte) error

type BetaTrackDeleteParams added in v1.71.2

type BetaTrackDeleteParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTrackDeleteResponse added in v1.71.2

type BetaTrackDeleteResponse struct {
	// Unique identifier for the track.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// Deleted object type.
	//
	// For tracks, this is always `"track_deleted"`.
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTrackDeleteResponse) RawJSON added in v1.71.2

func (r BetaTrackDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTrackDeleteResponse) UnmarshalJSON added in v1.71.2

func (r *BetaTrackDeleteResponse) UnmarshalJSON(data []byte) error

type BetaTrackGetParams added in v1.71.2

type BetaTrackGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTrackGetResponse added in v1.71.2

type BetaTrackGetResponse struct {
	// Unique identifier for the track.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// ISO 8601 timestamp of when the track was created.
	CreatedAt string `json:"created_at" api:"required"`
	// Display title for the track.
	//
	// This is a human-readable label that is not included in the prompt sent to the
	// model.
	DisplayTitle string `json:"display_title" api:"required"`
	// The latest version identifier for the track.
	//
	// This represents the most recent version of the track that has been created.
	LatestVersion string `json:"latest_version" api:"required"`
	// Source of the track.
	//
	// This may be one of the following values:
	//
	// - `"custom"`: the track was created by a user
	// - `"Juglow"`: the track was created by Juglow
	Source string `json:"source" api:"required"`
	// Object type.
	//
	// For tracks, this is always `"track"`.
	Type string `json:"type" api:"required"`
	// ISO 8601 timestamp of when the track was last updated.
	UpdatedAt string `json:"updated_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		DisplayTitle  respjson.Field
		LatestVersion respjson.Field
		Source        respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTrackGetResponse) RawJSON added in v1.71.2

func (r BetaTrackGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTrackGetResponse) UnmarshalJSON added in v1.71.2

func (r *BetaTrackGetResponse) UnmarshalJSON(data []byte) error

type BetaTrackListParams added in v1.71.2

type BetaTrackListParams struct {
	// Pagination token for fetching a specific page of results.
	//
	// Pass the value from a previous response's `next_page` field to get the next page
	// of results.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Filter tracks by source.
	//
	// If provided, only tracks from the specified source will be returned:
	//
	// - `"custom"`: only return user-created tracks
	// - `"Juglow"`: only return Juglow-created tracks
	Source param.Opt[string] `query:"source,omitzero" json:"-"`
	// Number of results to return per page.
	//
	// Maximum value is 100. Defaults to 20.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaTrackListParams) URLQuery added in v1.71.2

func (r BetaTrackListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaTrackListParams's query parameters as `url.Values`.

type BetaTrackListResponse added in v1.71.2

type BetaTrackListResponse struct {
	// Unique identifier for the track.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// ISO 8601 timestamp of when the track was created.
	CreatedAt string `json:"created_at" api:"required"`
	// Display title for the track.
	//
	// This is a human-readable label that is not included in the prompt sent to the
	// model.
	DisplayTitle string `json:"display_title" api:"required"`
	// The latest version identifier for the track.
	//
	// This represents the most recent version of the track that has been created.
	LatestVersion string `json:"latest_version" api:"required"`
	// Source of the track.
	//
	// This may be one of the following values:
	//
	// - `"custom"`: the track was created by a user
	// - `"Juglow"`: the track was created by Juglow
	Source string `json:"source" api:"required"`
	// Object type.
	//
	// For tracks, this is always `"track"`.
	Type string `json:"type" api:"required"`
	// ISO 8601 timestamp of when the track was last updated.
	UpdatedAt string `json:"updated_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		DisplayTitle  respjson.Field
		LatestVersion respjson.Field
		Source        respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTrackListResponse) RawJSON added in v1.71.2

func (r BetaTrackListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTrackListResponse) UnmarshalJSON added in v1.71.2

func (r *BetaTrackListResponse) UnmarshalJSON(data []byte) error

type BetaTrackNewParams added in v1.71.2

type BetaTrackNewParams struct {
	// Files to upload for the track.
	//
	// All files must be in the same top-level directory and must include a TRACK.md
	// file at the root of that directory.
	Files []io.Reader `json:"files,omitzero" api:"required" format:"binary"`
	// Display title for the track.
	//
	// This is a human-readable label that is not included in the prompt sent to the
	// model.
	DisplayTitle param.Opt[string] `json:"display_title,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaTrackNewParams) MarshalMultipart added in v1.71.2

func (r BetaTrackNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type BetaTrackNewResponse added in v1.71.2

type BetaTrackNewResponse struct {
	// Unique identifier for the track.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// ISO 8601 timestamp of when the track was created.
	CreatedAt string `json:"created_at" api:"required"`
	// Display title for the track.
	//
	// This is a human-readable label that is not included in the prompt sent to the
	// model.
	DisplayTitle string `json:"display_title" api:"required"`
	// The latest version identifier for the track.
	//
	// This represents the most recent version of the track that has been created.
	LatestVersion string `json:"latest_version" api:"required"`
	// Source of the track.
	//
	// This may be one of the following values:
	//
	// - `"custom"`: the track was created by a user
	// - `"Juglow"`: the track was created by Juglow
	Source string `json:"source" api:"required"`
	// Object type.
	//
	// For tracks, this is always `"track"`.
	Type string `json:"type" api:"required"`
	// ISO 8601 timestamp of when the track was last updated.
	UpdatedAt string `json:"updated_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		DisplayTitle  respjson.Field
		LatestVersion respjson.Field
		Source        respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTrackNewResponse) RawJSON added in v1.71.2

func (r BetaTrackNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTrackNewResponse) UnmarshalJSON added in v1.71.2

func (r *BetaTrackNewResponse) UnmarshalJSON(data []byte) error

type BetaTrackParams added in v1.71.2

type BetaTrackParams struct {
	// Track ID
	TrackID string `json:"track_id" api:"required"`
	// Type of track - either 'Juglow' (built-in) or 'custom' (user-defined)
	//
	// Any of "Juglow", "custom".
	Type BetaTrackParamsType `json:"type,omitzero" api:"required"`
	// Track version or 'latest' for most recent version
	Version param.Opt[string] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

Specification for a track to be loaded in a container (request model).

The properties TrackID, Type are required.

func (BetaTrackParams) MarshalJSON added in v1.71.2

func (r BetaTrackParams) MarshalJSON() (data []byte, err error)

func (*BetaTrackParams) UnmarshalJSON added in v1.71.2

func (r *BetaTrackParams) UnmarshalJSON(data []byte) error

type BetaTrackParamsType added in v1.71.2

type BetaTrackParamsType string

Type of track - either 'Juglow' (built-in) or 'custom' (user-defined)

const (
	BetaTrackParamsTypeJuglow BetaTrackParamsType = "Juglow"
	BetaTrackParamsTypeCustom BetaTrackParamsType = "custom"
)

type BetaTrackService added in v1.71.2

type BetaTrackService struct {
	Options  []option.RequestOption
	Versions BetaTrackVersionService
}

BetaTrackService contains methods and other services that help with interacting with the Juglow 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 NewBetaTrackService method instead.

func NewBetaTrackService added in v1.71.2

func NewBetaTrackService(opts ...option.RequestOption) (r BetaTrackService)

NewBetaTrackService 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 (*BetaTrackService) Delete added in v1.71.2

Delete Track

func (*BetaTrackService) Get added in v1.71.2

func (r *BetaTrackService) Get(ctx context.Context, trackID string, query BetaTrackGetParams, opts ...option.RequestOption) (res *BetaTrackGetResponse, err error)

Get Track

func (*BetaTrackService) List added in v1.71.2

List tracks

func (*BetaTrackService) ListAutoPaging added in v1.71.2

List tracks

func (*BetaTrackService) New added in v1.71.2

Create Track

type BetaTrackType added in v1.71.2

type BetaTrackType string

Type of track - either 'Juglow' (built-in) or 'custom' (user-defined)

const (
	BetaTrackTypeJuglow BetaTrackType = "Juglow"
	BetaTrackTypeCustom BetaTrackType = "custom"
)

type BetaTrackVersionDeleteParams added in v1.71.2

type BetaTrackVersionDeleteParams struct {
	// Unique identifier for the track.
	//
	// The format and length of IDs may change over time.
	TrackID string `path:"track_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTrackVersionDeleteResponse added in v1.71.2

type BetaTrackVersionDeleteResponse struct {
	// Version identifier for the track.
	//
	// Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
	ID string `json:"id" api:"required"`
	// Deleted object type.
	//
	// For Track Versions, this is always `"track_version_deleted"`.
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTrackVersionDeleteResponse) RawJSON added in v1.71.2

Returns the unmodified JSON received from the API

func (*BetaTrackVersionDeleteResponse) UnmarshalJSON added in v1.71.2

func (r *BetaTrackVersionDeleteResponse) UnmarshalJSON(data []byte) error

type BetaTrackVersionDownloadParams added in v1.71.2

type BetaTrackVersionDownloadParams struct {
	// Unique identifier for the track.
	//
	// The format and length of IDs may change over time.
	TrackID string `path:"track_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTrackVersionGetParams added in v1.71.2

type BetaTrackVersionGetParams struct {
	// Unique identifier for the track.
	//
	// The format and length of IDs may change over time.
	TrackID string `path:"track_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTrackVersionGetResponse added in v1.71.2

type BetaTrackVersionGetResponse struct {
	// Unique identifier for the track version.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// ISO 8601 timestamp of when the track version was created.
	CreatedAt string `json:"created_at" api:"required"`
	// Description of the track version.
	//
	// This is extracted from the TRACK.md file in the track upload.
	Description string `json:"description" api:"required"`
	// Directory name of the track version.
	//
	// This is the top-level directory name that was extracted from the uploaded files.
	Directory string `json:"directory" api:"required"`
	// Human-readable name of the track version.
	//
	// This is extracted from the TRACK.md file in the track upload.
	Name string `json:"name" api:"required"`
	// Identifier for the track that this version belongs to.
	TrackID string `json:"track_id" api:"required"`
	// Object type.
	//
	// For Track Versions, this is always `"track_version"`.
	Type string `json:"type" api:"required"`
	// Version identifier for the track.
	//
	// Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
	Version string `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Description respjson.Field
		Directory   respjson.Field
		Name        respjson.Field
		TrackID     respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTrackVersionGetResponse) RawJSON added in v1.71.2

func (r BetaTrackVersionGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTrackVersionGetResponse) UnmarshalJSON added in v1.71.2

func (r *BetaTrackVersionGetResponse) UnmarshalJSON(data []byte) error

type BetaTrackVersionListParams added in v1.71.2

type BetaTrackVersionListParams struct {
	// Number of items to return per page.
	//
	// Defaults to `20`. Ranges from `1` to `1000`.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Optionally set to the `next_page` token from the previous response.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaTrackVersionListParams) URLQuery added in v1.71.2

func (r BetaTrackVersionListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaTrackVersionListParams's query parameters as `url.Values`.

type BetaTrackVersionListResponse added in v1.71.2

type BetaTrackVersionListResponse struct {
	// Unique identifier for the track version.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// ISO 8601 timestamp of when the track version was created.
	CreatedAt string `json:"created_at" api:"required"`
	// Description of the track version.
	//
	// This is extracted from the TRACK.md file in the track upload.
	Description string `json:"description" api:"required"`
	// Directory name of the track version.
	//
	// This is the top-level directory name that was extracted from the uploaded files.
	Directory string `json:"directory" api:"required"`
	// Human-readable name of the track version.
	//
	// This is extracted from the TRACK.md file in the track upload.
	Name string `json:"name" api:"required"`
	// Identifier for the track that this version belongs to.
	TrackID string `json:"track_id" api:"required"`
	// Object type.
	//
	// For Track Versions, this is always `"track_version"`.
	Type string `json:"type" api:"required"`
	// Version identifier for the track.
	//
	// Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
	Version string `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Description respjson.Field
		Directory   respjson.Field
		Name        respjson.Field
		TrackID     respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTrackVersionListResponse) RawJSON added in v1.71.2

Returns the unmodified JSON received from the API

func (*BetaTrackVersionListResponse) UnmarshalJSON added in v1.71.2

func (r *BetaTrackVersionListResponse) UnmarshalJSON(data []byte) error

type BetaTrackVersionNewParams added in v1.71.2

type BetaTrackVersionNewParams struct {
	// Files to upload for the track.
	//
	// All files must be in the same top-level directory and must include a TRACK.md
	// file at the root of that directory.
	Files []io.Reader `json:"files,omitzero" api:"required" format:"binary"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaTrackVersionNewParams) MarshalMultipart added in v1.71.2

func (r BetaTrackVersionNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type BetaTrackVersionNewResponse added in v1.71.2

type BetaTrackVersionNewResponse struct {
	// Unique identifier for the track version.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// ISO 8601 timestamp of when the track version was created.
	CreatedAt string `json:"created_at" api:"required"`
	// Description of the track version.
	//
	// This is extracted from the TRACK.md file in the track upload.
	Description string `json:"description" api:"required"`
	// Directory name of the track version.
	//
	// This is the top-level directory name that was extracted from the uploaded files.
	Directory string `json:"directory" api:"required"`
	// Human-readable name of the track version.
	//
	// This is extracted from the TRACK.md file in the track upload.
	Name string `json:"name" api:"required"`
	// Identifier for the track that this version belongs to.
	TrackID string `json:"track_id" api:"required"`
	// Object type.
	//
	// For Track Versions, this is always `"track_version"`.
	Type string `json:"type" api:"required"`
	// Version identifier for the track.
	//
	// Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
	Version string `json:"version" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Description respjson.Field
		Directory   respjson.Field
		Name        respjson.Field
		TrackID     respjson.Field
		Type        respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaTrackVersionNewResponse) RawJSON added in v1.71.2

func (r BetaTrackVersionNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTrackVersionNewResponse) UnmarshalJSON added in v1.71.2

func (r *BetaTrackVersionNewResponse) UnmarshalJSON(data []byte) error

type BetaTrackVersionService added in v1.71.2

type BetaTrackVersionService struct {
	Options []option.RequestOption
}

BetaTrackVersionService contains methods and other services that help with interacting with the Juglow 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 NewBetaTrackVersionService method instead.

func NewBetaTrackVersionService added in v1.71.2

func NewBetaTrackVersionService(opts ...option.RequestOption) (r BetaTrackVersionService)

NewBetaTrackVersionService 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 (*BetaTrackVersionService) Delete added in v1.71.2

Delete Track Version

func (*BetaTrackVersionService) Download added in v1.71.2

func (r *BetaTrackVersionService) Download(ctx context.Context, version string, params BetaTrackVersionDownloadParams, opts ...option.RequestOption) (res *http.Response, err error)

Download a track version's content as a zip archive.

func (*BetaTrackVersionService) Get added in v1.71.2

Get Track Version

func (*BetaTrackVersionService) List added in v1.71.2

List Track Versions

func (*BetaTrackVersionService) ListAutoPaging added in v1.71.2

List Track Versions

func (*BetaTrackVersionService) New added in v1.71.2

Create Track Version

type BetaTunnel

type BetaTunnel struct {
	// Unique identifier for the tunnel, prefixed with `tnl_`.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Human-readable name for the tunnel (1-255 characters). Null if unset.
	DisplayName string `json:"display_name" api:"required"`
	// Juglow-assigned hostname for the tunnel. MCP server URLs whose host is a
	// subdomain of this value are routed through the tunnel. Globally unique and never
	// reused, even after the tunnel is archived.
	Domain string          `json:"domain" api:"required"`
	Type   constant.Tunnel `json:"type" default:"tunnel"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ArchivedAt  respjson.Field
		CreatedAt   respjson.Field
		DisplayName respjson.Field
		Domain      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An MCP tunnel.

func (BetaTunnel) RawJSON

func (r BetaTunnel) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTunnel) UnmarshalJSON

func (r *BetaTunnel) UnmarshalJSON(data []byte) error

type BetaTunnelArchiveParams

type BetaTunnelArchiveParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTunnelCertificate

type BetaTunnelCertificate struct {
	// Unique identifier for the certificate, prefixed with `tcrt_`.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// A timestamp in RFC 3339 format
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// Lowercase hex SHA-256 fingerprint of the certificate's DER encoding.
	Fingerprint string `json:"fingerprint" api:"required"`
	// ID of the tunnel the certificate is registered against.
	TunnelID string                     `json:"tunnel_id" api:"required"`
	Type     constant.TunnelCertificate `json:"type" default:"tunnel_certificate"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ArchivedAt  respjson.Field
		CreatedAt   respjson.Field
		ExpiresAt   respjson.Field
		Fingerprint respjson.Field
		TunnelID    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A CA certificate attached to a tunnel.

func (BetaTunnelCertificate) RawJSON

func (r BetaTunnelCertificate) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTunnelCertificate) UnmarshalJSON

func (r *BetaTunnelCertificate) UnmarshalJSON(data []byte) error

type BetaTunnelCertificateArchiveParams

type BetaTunnelCertificateArchiveParams struct {
	TunnelID string `path:"tunnel_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTunnelCertificateGetParams

type BetaTunnelCertificateGetParams struct {
	TunnelID string `path:"tunnel_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTunnelCertificateListParams

type BetaTunnelCertificateListParams struct {
	// Whether to include archived certificates in the results. Defaults to false.
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Maximum number of certificates to return per page. Defaults to 20, maximum 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor from a previous `list_tunnel_certificates` response.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaTunnelCertificateListParams) URLQuery

func (r BetaTunnelCertificateListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaTunnelCertificateListParams's query parameters as `url.Values`.

type BetaTunnelCertificateNewParams

type BetaTunnelCertificateNewParams struct {
	// PEM-encoded X.509 CA certificate. Must contain exactly one certificate and no
	// private-key material. Maximum 8KB.
	CaCertificatePem string `json:"ca_certificate_pem" api:"required"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaTunnelCertificateNewParams) MarshalJSON

func (r BetaTunnelCertificateNewParams) MarshalJSON() (data []byte, err error)

func (*BetaTunnelCertificateNewParams) UnmarshalJSON

func (r *BetaTunnelCertificateNewParams) UnmarshalJSON(data []byte) error

type BetaTunnelCertificateService

type BetaTunnelCertificateService struct {
	Options []option.RequestOption
}

BetaTunnelCertificateService contains methods and other services that help with interacting with the Juglow 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 NewBetaTunnelCertificateService method instead.

func NewBetaTunnelCertificateService

func NewBetaTunnelCertificateService(opts ...option.RequestOption) (r BetaTunnelCertificateService)

NewBetaTunnelCertificateService 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 (*BetaTunnelCertificateService) Archive

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Archives a tunnel certificate, removing it from the set Juglow trusts for the tunnel. The certificate record is retained. Archiving the last non-archived certificate is permitted; the tunnel rejects MCP traffic until a new certificate is added.

func (*BetaTunnelCertificateService) Get

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Fetches a tunnel certificate by ID.

func (*BetaTunnelCertificateService) List

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Lists the certificates registered on a tunnel. Archived certificates are excluded unless include_archived is set.

func (*BetaTunnelCertificateService) ListAutoPaging

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Lists the certificates registered on a tunnel. Archived certificates are excluded unless include_archived is set.

func (*BetaTunnelCertificateService) New

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Registers a public CA certificate on a tunnel. Juglow verifies the gateway's server certificate against this CA when it terminates the inner TLS session. A tunnel holds at most two non-archived certificates.

type BetaTunnelGetParams

type BetaTunnelGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTunnelListParams

type BetaTunnelListParams struct {
	// Whether to include archived tunnels in the results. Defaults to false.
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Maximum number of tunnels to return per page. Defaults to 20, maximum 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination cursor from a previous `list_tunnels` response.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaTunnelListParams) URLQuery

func (r BetaTunnelListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaTunnelListParams's query parameters as `url.Values`.

type BetaTunnelNewParams

type BetaTunnelNewParams struct {
	// Optional human-readable name for the tunnel (1-255 characters).
	DisplayName param.Opt[string] `json:"display_name,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaTunnelNewParams) MarshalJSON

func (r BetaTunnelNewParams) MarshalJSON() (data []byte, err error)

func (*BetaTunnelNewParams) UnmarshalJSON

func (r *BetaTunnelNewParams) UnmarshalJSON(data []byte) error

type BetaTunnelRevealTokenParams

type BetaTunnelRevealTokenParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaTunnelRotateTokenParams

type BetaTunnelRotateTokenParams struct {
	// Optional free-text reason for the rotation, recorded for audit.
	Reason param.Opt[string] `json:"reason,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaTunnelRotateTokenParams) MarshalJSON

func (r BetaTunnelRotateTokenParams) MarshalJSON() (data []byte, err error)

func (*BetaTunnelRotateTokenParams) UnmarshalJSON

func (r *BetaTunnelRotateTokenParams) UnmarshalJSON(data []byte) error

type BetaTunnelService

type BetaTunnelService struct {
	Options      []option.RequestOption
	Certificates BetaTunnelCertificateService
}

BetaTunnelService contains methods and other services that help with interacting with the Juglow 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 NewBetaTunnelService method instead.

func NewBetaTunnelService

func NewBetaTunnelService(opts ...option.RequestOption) (r BetaTunnelService)

NewBetaTunnelService 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 (*BetaTunnelService) Archive

func (r *BetaTunnelService) Archive(ctx context.Context, tunnelID string, body BetaTunnelArchiveParams, opts ...option.RequestOption) (res *BetaTunnel, err error)

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Archives a tunnel. Archival is irreversible: every non-archived certificate on the tunnel is archived in the same operation, the hostname is retired and never re-allocated, and the tunnel token is invalidated. Retrying against an already-archived tunnel returns the existing record unchanged.

func (*BetaTunnelService) Get

func (r *BetaTunnelService) Get(ctx context.Context, tunnelID string, query BetaTunnelGetParams, opts ...option.RequestOption) (res *BetaTunnel, err error)

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Fetches a tunnel by ID.

func (*BetaTunnelService) List

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Lists tunnels. Results are ordered by creation time, newest first; archived tunnels are excluded unless include_archived is set.

func (*BetaTunnelService) ListAutoPaging

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Lists tunnels. Results are ordered by creation time, newest first; archived tunnels are excluded unless include_archived is set.

func (*BetaTunnelService) New

func (r *BetaTunnelService) New(ctx context.Context, params BetaTunnelNewParams, opts ...option.RequestOption) (res *BetaTunnel, err error)

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel; it is not idempotent. The new tunnel rejects MCP traffic until at least one CA certificate is added.

func (*BetaTunnelService) RevealToken

func (r *BetaTunnelService) RevealToken(ctx context.Context, tunnelID string, body BetaTunnelRevealTokenParams, opts ...option.RequestOption) (res *BetaTunnelToken, err error)

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Reveals a tunnel's connector token. The value is fetched live on each call; Juglow does not store it. Repeated calls return the same value until the token is rotated. Exposed as POST so the token does not appear in intermediary access logs.

func (*BetaTunnelService) RotateToken

func (r *BetaTunnelService) RotateToken(ctx context.Context, tunnelID string, params BetaTunnelRotateTokenParams, opts ...option.RequestOption) (res *BetaTunnelToken, err error)

The Tunnels API is in research preview. It requires the `Juglow-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.

Rotates a tunnel's connector token. Rotation invalidates the current token for new connections and returns a fresh value; established connections are not severed. A connector restarted after rotation must use the new value.

type BetaTunnelToken

type BetaTunnelToken struct {
	// Stable identifier for the current token value. Changes when the token is
	// rotated.
	ID string `json:"id" api:"required"`
	// The connector token used to run the tunnel. Treat as a credential.
	TunnelToken string               `json:"tunnel_token" api:"required"`
	Type        constant.TunnelToken `json:"type" default:"tunnel_token"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		TunnelToken respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A tunnel's connector token.

func (BetaTunnelToken) RawJSON

func (r BetaTunnelToken) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaTunnelToken) UnmarshalJSON

func (r *BetaTunnelToken) UnmarshalJSON(data []byte) error

type BetaURLImageSourceParam

type BetaURLImageSourceParam struct {
	URL string `json:"url" api:"required"`
	// This field can be elided, and will marshal its zero value as "url".
	Type constant.URL `json:"type" default:"url"`
	// contains filtered or unexported fields
}

The properties Type, URL are required.

func (BetaURLImageSourceParam) MarshalJSON

func (r BetaURLImageSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaURLImageSourceParam) UnmarshalJSON

func (r *BetaURLImageSourceParam) UnmarshalJSON(data []byte) error

type BetaURLPDFSourceParam

type BetaURLPDFSourceParam struct {
	URL string `json:"url" api:"required"`
	// This field can be elided, and will marshal its zero value as "url".
	Type constant.URL `json:"type" default:"url"`
	// contains filtered or unexported fields
}

The properties Type, URL are required.

func (BetaURLPDFSourceParam) MarshalJSON

func (r BetaURLPDFSourceParam) MarshalJSON() (data []byte, err error)

func (*BetaURLPDFSourceParam) UnmarshalJSON

func (r *BetaURLPDFSourceParam) UnmarshalJSON(data []byte) error

type BetaUnrestrictedNetwork

type BetaUnrestrictedNetwork struct {
	// Network policy type
	Type constant.Unrestricted `json:"type" default:"unrestricted"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Unrestricted network access.

func (BetaUnrestrictedNetwork) RawJSON

func (r BetaUnrestrictedNetwork) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaUnrestrictedNetwork) ToParam

ToParam converts this BetaUnrestrictedNetwork to a BetaUnrestrictedNetworkParam.

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 BetaUnrestrictedNetworkParam.Overrides()

func (*BetaUnrestrictedNetwork) UnmarshalJSON

func (r *BetaUnrestrictedNetwork) UnmarshalJSON(data []byte) error

type BetaUnrestrictedNetworkParam

type BetaUnrestrictedNetworkParam struct {
	// Network policy type
	Type constant.Unrestricted `json:"type" default:"unrestricted"`
	// contains filtered or unexported fields
}

Unrestricted network access.

This struct has a constant value, construct it with NewBetaUnrestrictedNetworkParam.

func NewBetaUnrestrictedNetworkParam

func NewBetaUnrestrictedNetworkParam() BetaUnrestrictedNetworkParam

func (BetaUnrestrictedNetworkParam) MarshalJSON

func (r BetaUnrestrictedNetworkParam) MarshalJSON() (data []byte, err error)

func (*BetaUnrestrictedNetworkParam) UnmarshalJSON

func (r *BetaUnrestrictedNetworkParam) UnmarshalJSON(data []byte) error

type BetaUsage

type BetaUsage struct {
	// Breakdown of cached tokens by TTL
	CacheCreation BetaCacheCreation `json:"cache_creation" api:"required"`
	// The number of input tokens used to create the cache entry.
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// The number of input tokens read from the cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// Outcome of the `fallback_credit_token` presented on this request.
	FallbackCredit BetaFallbackCreditUsage `json:"fallback_credit" api:"required"`
	// The geographic region where inference was performed for this request.
	InferenceGeo string `json:"inference_geo" api:"required"`
	// The number of input tokens which were used.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// Per-iteration token usage breakdown.
	//
	// Each entry represents one sampling iteration, with its own input/output token
	// counts and cache statistics. This allows you to:
	//
	// - Determine which iterations exceeded long context thresholds (>=200k tokens)
	// - Calculate the true context window size from the last iteration
	// - Understand token accumulation across server-side tool use loops
	Iterations BetaIterationsUsage `json:"iterations" api:"required"`
	// The number of output tokens which were used.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// Breakdown of output tokens by category.
	//
	// `output_tokens` remains the inclusive, authoritative total used for billing.
	// This object provides a read-only decomposition for observability — for example,
	// how many of the billed output tokens were spent on internal reasoning that may
	// have been summarized before being returned to you.
	OutputTokensDetails BetaOutputTokensDetails `json:"output_tokens_details" api:"required"`
	// The number of server tool requests.
	ServerToolUse BetaServerToolUsage `json:"server_tool_use" api:"required"`
	// If the request used the priority, standard, or batch tier.
	//
	// Any of "standard", "priority", "batch".
	ServiceTier BetaUsageServiceTier `json:"service_tier" api:"required"`
	// Inference speed mode. `fast` provides significantly faster output token
	// generation at premium pricing. Not all models support `fast`; invalid
	// combinations are rejected at create time.
	//
	// Any of "standard", "fast".
	Speed BetaUsageSpeed `json:"speed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreation            respjson.Field
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		FallbackCredit           respjson.Field
		InferenceGeo             respjson.Field
		InputTokens              respjson.Field
		Iterations               respjson.Field
		OutputTokens             respjson.Field
		OutputTokensDetails      respjson.Field
		ServerToolUse            respjson.Field
		ServiceTier              respjson.Field
		Speed                    respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaUsage) RawJSON

func (r BetaUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaUsage) UnmarshalJSON

func (r *BetaUsage) UnmarshalJSON(data []byte) error

type BetaUsageServiceTier

type BetaUsageServiceTier string

If the request used the priority, standard, or batch tier.

const (
	BetaUsageServiceTierStandard BetaUsageServiceTier = "standard"
	BetaUsageServiceTierPriority BetaUsageServiceTier = "priority"
	BetaUsageServiceTierBatch    BetaUsageServiceTier = "batch"
)

type BetaUsageSpeed

type BetaUsageSpeed string

Inference speed mode. `fast` provides significantly faster output token generation at premium pricing. Not all models support `fast`; invalid combinations are rejected at create time.

const (
	BetaUsageSpeedStandard BetaUsageSpeed = "standard"
	BetaUsageSpeedFast     BetaUsageSpeed = "fast"
)

type BetaUserLocationParam

type BetaUserLocationParam struct {
	// The city of the user.
	City param.Opt[string] `json:"city,omitzero"`
	// The two letter
	// [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the
	// user.
	Country param.Opt[string] `json:"country,omitzero"`
	// The region of the user.
	Region param.Opt[string] `json:"region,omitzero"`
	// The [IANA timezone](https://nodatime.org/TimeZones) of the user.
	Timezone param.Opt[string] `json:"timezone,omitzero"`
	// This field can be elided, and will marshal its zero value as "approximate".
	Type constant.Approximate `json:"type" default:"approximate"`
	// contains filtered or unexported fields
}

The property Type is required.

func (BetaUserLocationParam) MarshalJSON

func (r BetaUserLocationParam) MarshalJSON() (data []byte, err error)

func (*BetaUserLocationParam) UnmarshalJSON

func (r *BetaUserLocationParam) UnmarshalJSON(data []byte) error

type BetaUserProfile

type BetaUserProfile struct {
	// Unique identifier for this user profile, prefixed `uprof_`.
	ID string `json:"id" api:"required"`
	// A timestamp in RFC 3339 format
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up
	// to 512 chars.
	Metadata map[string]string `json:"metadata" api:"required"`
	// How the entity behind a user profile relates to the platform that owns the API
	// key. `external`: an individual end-user of the platform. `resold`: a company the
	// platform resells haijun access to. `internal`: the platform's own usage.
	//
	// Any of "external", "resold", "internal".
	Relationship BetaUserProfileRelationship `json:"relationship" api:"required"`
	// Trust grants for this profile, keyed by grant name. Key omitted when no grant is
	// active or in flight.
	TrustGrants map[string]BetaUserProfileTrustGrant `json:"trust_grants" api:"required"`
	// Object type. Always `user_profile`.
	//
	// Any of "user_profile".
	Type BetaUserProfileType `json:"type" api:"required"`
	// A timestamp in RFC 3339 format
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Platform's own identifier for this user. Not enforced unique.
	ExternalID string `json:"external_id" api:"nullable"`
	// Display name of the entity this profile represents. For `resold` this is the
	// resold-to company's name.
	Name string `json:"name" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		CreatedAt    respjson.Field
		Metadata     respjson.Field
		Relationship respjson.Field
		TrustGrants  respjson.Field
		Type         respjson.Field
		UpdatedAt    respjson.Field
		ExternalID   respjson.Field
		Name         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaUserProfile) RawJSON

func (r BetaUserProfile) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaUserProfile) UnmarshalJSON

func (r *BetaUserProfile) UnmarshalJSON(data []byte) error

type BetaUserProfileEnrollmentURL

type BetaUserProfileEnrollmentURL struct {
	// A timestamp in RFC 3339 format
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// Object type. Always `enrollment_url`.
	//
	// Any of "enrollment_url".
	Type BetaUserProfileEnrollmentURLType `json:"type" api:"required"`
	// Enrollment URL to send to the end user. Valid until `expires_at`.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt   respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaUserProfileEnrollmentURL) RawJSON

Returns the unmodified JSON received from the API

func (*BetaUserProfileEnrollmentURL) UnmarshalJSON

func (r *BetaUserProfileEnrollmentURL) UnmarshalJSON(data []byte) error

type BetaUserProfileEnrollmentURLType

type BetaUserProfileEnrollmentURLType string

Object type. Always `enrollment_url`.

const (
	BetaUserProfileEnrollmentURLTypeEnrollmentURL BetaUserProfileEnrollmentURLType = "enrollment_url"
)

type BetaUserProfileGetParams

type BetaUserProfileGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaUserProfileListParams

type BetaUserProfileListParams struct {
	// Query parameter for limit
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Query parameter for page
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Query parameter for order
	//
	// Any of "asc", "desc".
	Order BetaUserProfileListParamsOrder `query:"order,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaUserProfileListParams) URLQuery

func (r BetaUserProfileListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaUserProfileListParams's query parameters as `url.Values`.

type BetaUserProfileListParamsOrder

type BetaUserProfileListParamsOrder string

Query parameter for order

const (
	BetaUserProfileListParamsOrderAsc  BetaUserProfileListParamsOrder = "asc"
	BetaUserProfileListParamsOrderDesc BetaUserProfileListParamsOrder = "desc"
)

type BetaUserProfileNewEnrollmentURLParams

type BetaUserProfileNewEnrollmentURLParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaUserProfileNewParams

type BetaUserProfileNewParams struct {
	// Platform's own identifier for this user. Not enforced unique. Maximum 255
	// characters.
	ExternalID param.Opt[string] `json:"external_id,omitzero"`
	// Display name of the entity this profile represents. Required when relationship
	// is `resold` (the resold-to company's name); optional otherwise. Maximum 255
	// characters.
	Name param.Opt[string] `json:"name,omitzero"`
	// Free-form key-value data to attach to this user profile. Maximum 16 keys, with
	// keys up to 64 characters and values up to 512 characters. Values must be
	// non-empty strings.
	Metadata map[string]string `json:"metadata,omitzero"`
	// How the entity behind a user profile relates to the platform that owns the API
	// key. `external`: an individual end-user of the platform. `resold`: a company the
	// platform resells haijun access to. `internal`: the platform's own usage.
	//
	// Any of "external", "resold", "internal".
	Relationship BetaUserProfileNewParamsRelationship `json:"relationship,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaUserProfileNewParams) MarshalJSON

func (r BetaUserProfileNewParams) MarshalJSON() (data []byte, err error)

func (*BetaUserProfileNewParams) UnmarshalJSON

func (r *BetaUserProfileNewParams) UnmarshalJSON(data []byte) error

type BetaUserProfileNewParamsRelationship

type BetaUserProfileNewParamsRelationship string

How the entity behind a user profile relates to the platform that owns the API key. `external`: an individual end-user of the platform. `resold`: a company the platform resells haijun access to. `internal`: the platform's own usage.

const (
	BetaUserProfileNewParamsRelationshipExternal BetaUserProfileNewParamsRelationship = "external"
	BetaUserProfileNewParamsRelationshipResold   BetaUserProfileNewParamsRelationship = "resold"
	BetaUserProfileNewParamsRelationshipInternal BetaUserProfileNewParamsRelationship = "internal"
)

type BetaUserProfileRelationship

type BetaUserProfileRelationship string

How the entity behind a user profile relates to the platform that owns the API key. `external`: an individual end-user of the platform. `resold`: a company the platform resells haijun access to. `internal`: the platform's own usage.

const (
	BetaUserProfileRelationshipExternal BetaUserProfileRelationship = "external"
	BetaUserProfileRelationshipResold   BetaUserProfileRelationship = "resold"
	BetaUserProfileRelationshipInternal BetaUserProfileRelationship = "internal"
)

type BetaUserProfileService

type BetaUserProfileService struct {
	Options []option.RequestOption
}

BetaUserProfileService contains methods and other services that help with interacting with the Juglow 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 NewBetaUserProfileService method instead.

func NewBetaUserProfileService

func NewBetaUserProfileService(opts ...option.RequestOption) (r BetaUserProfileService)

NewBetaUserProfileService 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 (*BetaUserProfileService) Get

func (r *BetaUserProfileService) Get(ctx context.Context, userProfileID string, query BetaUserProfileGetParams, opts ...option.RequestOption) (res *BetaUserProfile, err error)

Get User Profile

func (*BetaUserProfileService) List

List User Profiles

func (*BetaUserProfileService) ListAutoPaging

List User Profiles

func (*BetaUserProfileService) New

Create User Profile

func (*BetaUserProfileService) NewEnrollmentURL

Create Enrollment URL

func (*BetaUserProfileService) Update

func (r *BetaUserProfileService) Update(ctx context.Context, userProfileID string, params BetaUserProfileUpdateParams, opts ...option.RequestOption) (res *BetaUserProfile, err error)

Update User Profile

type BetaUserProfileTrustGrant

type BetaUserProfileTrustGrant struct {
	// Status of the trust grant.
	//
	// Any of "active", "pending", "rejected".
	Status BetaUserProfileTrustGrantStatus `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaUserProfileTrustGrant) RawJSON

func (r BetaUserProfileTrustGrant) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaUserProfileTrustGrant) UnmarshalJSON

func (r *BetaUserProfileTrustGrant) UnmarshalJSON(data []byte) error

type BetaUserProfileTrustGrantStatus

type BetaUserProfileTrustGrantStatus string

Status of the trust grant.

const (
	BetaUserProfileTrustGrantStatusActive   BetaUserProfileTrustGrantStatus = "active"
	BetaUserProfileTrustGrantStatusPending  BetaUserProfileTrustGrantStatus = "pending"
	BetaUserProfileTrustGrantStatusRejected BetaUserProfileTrustGrantStatus = "rejected"
)

type BetaUserProfileType

type BetaUserProfileType string

Object type. Always `user_profile`.

const (
	BetaUserProfileTypeUserProfile BetaUserProfileType = "user_profile"
)

type BetaUserProfileUpdateParams

type BetaUserProfileUpdateParams struct {
	// If present, replaces the stored external_id. Omit to leave unchanged. Maximum
	// 255 characters.
	ExternalID param.Opt[string] `json:"external_id,omitzero"`
	// If present, replaces the stored name. Omit to leave unchanged. Maximum 255
	// characters.
	Name param.Opt[string] `json:"name,omitzero"`
	// How the entity behind a user profile relates to the platform that owns the API
	// key. `external`: an individual end-user of the platform. `resold`: a company the
	// platform resells haijun access to. `internal`: the platform's own usage.
	//
	// Any of "external", "resold", "internal".
	Relationship BetaUserProfileUpdateParamsRelationship `json:"relationship,omitzero"`
	// Key-value pairs to merge into the stored metadata. Keys provided overwrite
	// existing values. To remove a key, set its value to an empty string. Keys not
	// provided are left unchanged. Maximum 16 keys, with keys up to 64 characters and
	// values up to 512 characters.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaUserProfileUpdateParams) MarshalJSON

func (r BetaUserProfileUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaUserProfileUpdateParams) UnmarshalJSON

func (r *BetaUserProfileUpdateParams) UnmarshalJSON(data []byte) error

type BetaUserProfileUpdateParamsRelationship

type BetaUserProfileUpdateParamsRelationship string

How the entity behind a user profile relates to the platform that owns the API key. `external`: an individual end-user of the platform. `resold`: a company the platform resells haijun access to. `internal`: the platform's own usage.

const (
	BetaUserProfileUpdateParamsRelationshipExternal BetaUserProfileUpdateParamsRelationship = "external"
	BetaUserProfileUpdateParamsRelationshipResold   BetaUserProfileUpdateParamsRelationship = "resold"
	BetaUserProfileUpdateParamsRelationshipInternal BetaUserProfileUpdateParamsRelationship = "internal"
)

type BetaVaultArchiveParams

type BetaVaultArchiveParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaVaultCredentialArchiveParams

type BetaVaultCredentialArchiveParams struct {
	VaultID string `path:"vault_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaVaultCredentialDeleteParams

type BetaVaultCredentialDeleteParams struct {
	VaultID string `path:"vault_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaVaultCredentialGetParams

type BetaVaultCredentialGetParams struct {
	VaultID string `path:"vault_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaVaultCredentialListParams

type BetaVaultCredentialListParams struct {
	// Whether to include archived credentials in the results.
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Maximum number of credentials to return per page. Defaults to 20, maximum 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination token from a previous `list_credentials` response.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaVaultCredentialListParams) URLQuery

func (r BetaVaultCredentialListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaVaultCredentialListParams's query parameters as `url.Values`.

type BetaVaultCredentialMCPOAuthValidateParams

type BetaVaultCredentialMCPOAuthValidateParams struct {
	VaultID string `path:"vault_id" api:"required" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaVaultCredentialNewParams

type BetaVaultCredentialNewParams struct {
	// Authentication details for creating a credential.
	Auth BetaVaultCredentialNewParamsAuthUnion `json:"auth,omitzero" api:"required"`
	// Human-readable name for the credential. Up to 255 characters.
	DisplayName param.Opt[string] `json:"display_name,omitzero"`
	// Arbitrary key-value metadata to attach to the credential. Maximum 16 pairs, keys
	// up to 64 chars, values up to 512 chars.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaVaultCredentialNewParams) MarshalJSON

func (r BetaVaultCredentialNewParams) MarshalJSON() (data []byte, err error)

func (*BetaVaultCredentialNewParams) UnmarshalJSON

func (r *BetaVaultCredentialNewParams) UnmarshalJSON(data []byte) error

type BetaVaultCredentialNewParamsAuthUnion

type BetaVaultCredentialNewParamsAuthUnion struct {
	OfMCPOAuth            *BetaManagedAgentsMCPOAuthCreateParams            `json:",omitzero,inline"`
	OfStaticBearer        *BetaManagedAgentsStaticBearerCreateParams        `json:",omitzero,inline"`
	OfEnvironmentVariable *BetaManagedAgentsEnvironmentVariableCreateParams `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 (BetaVaultCredentialNewParamsAuthUnion) GetAccessToken

func (u BetaVaultCredentialNewParamsAuthUnion) GetAccessToken() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) GetExpiresAt

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) GetInjectionLocation

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) GetMCPServerURL

func (u BetaVaultCredentialNewParamsAuthUnion) GetMCPServerURL() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) GetNetworking

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) GetRefresh

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) GetSecretName

func (u BetaVaultCredentialNewParamsAuthUnion) GetSecretName() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) GetSecretValue

func (u BetaVaultCredentialNewParamsAuthUnion) GetSecretValue() *string

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) GetToken

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialNewParamsAuthUnion) MarshalJSON

func (u BetaVaultCredentialNewParamsAuthUnion) MarshalJSON() ([]byte, error)

func (*BetaVaultCredentialNewParamsAuthUnion) UnmarshalJSON

func (u *BetaVaultCredentialNewParamsAuthUnion) UnmarshalJSON(data []byte) error

type BetaVaultCredentialService

type BetaVaultCredentialService struct {
	Options []option.RequestOption
}

BetaVaultCredentialService contains methods and other services that help with interacting with the Juglow 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 NewBetaVaultCredentialService method instead.

func NewBetaVaultCredentialService

func NewBetaVaultCredentialService(opts ...option.RequestOption) (r BetaVaultCredentialService)

NewBetaVaultCredentialService 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 (*BetaVaultCredentialService) Archive

Archive Credential

func (*BetaVaultCredentialService) Delete

Delete Credential

func (*BetaVaultCredentialService) Get

Get Credential

func (*BetaVaultCredentialService) List

List Credentials

func (*BetaVaultCredentialService) ListAutoPaging

List Credentials

func (*BetaVaultCredentialService) MCPOAuthValidate

Validate Credential

func (*BetaVaultCredentialService) New

Create Credential

func (*BetaVaultCredentialService) Update

Update Credential

type BetaVaultCredentialUpdateParams

type BetaVaultCredentialUpdateParams struct {
	VaultID string `path:"vault_id" api:"required" json:"-"`
	// Updated human-readable name for the credential. 1-255 characters.
	DisplayName param.Opt[string] `json:"display_name,omitzero"`
	// Metadata patch. Set a key to a string to upsert it, or to null to delete it.
	// Omitted keys are preserved.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Updated authentication details for a credential.
	Auth BetaVaultCredentialUpdateParamsAuthUnion `json:"auth,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaVaultCredentialUpdateParams) MarshalJSON

func (r BetaVaultCredentialUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaVaultCredentialUpdateParams) UnmarshalJSON

func (r *BetaVaultCredentialUpdateParams) UnmarshalJSON(data []byte) error

type BetaVaultCredentialUpdateParamsAuthUnion

type BetaVaultCredentialUpdateParamsAuthUnion struct {
	OfMCPOAuth            *BetaManagedAgentsMCPOAuthUpdateParams            `json:",omitzero,inline"`
	OfStaticBearer        *BetaManagedAgentsStaticBearerUpdateParams        `json:",omitzero,inline"`
	OfEnvironmentVariable *BetaManagedAgentsEnvironmentVariableUpdateParams `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 (BetaVaultCredentialUpdateParamsAuthUnion) GetAccessToken

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialUpdateParamsAuthUnion) GetExpiresAt

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialUpdateParamsAuthUnion) GetInjectionLocation

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialUpdateParamsAuthUnion) GetNetworking

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialUpdateParamsAuthUnion) GetRefresh

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialUpdateParamsAuthUnion) GetSecretValue

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialUpdateParamsAuthUnion) GetToken

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialUpdateParamsAuthUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaVaultCredentialUpdateParamsAuthUnion) MarshalJSON

func (*BetaVaultCredentialUpdateParamsAuthUnion) UnmarshalJSON

func (u *BetaVaultCredentialUpdateParamsAuthUnion) UnmarshalJSON(data []byte) error

type BetaVaultDeleteParams

type BetaVaultDeleteParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaVaultGetParams

type BetaVaultGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type BetaVaultListParams

type BetaVaultListParams struct {
	// Whether to include archived vaults in the results.
	IncludeArchived param.Opt[bool] `query:"include_archived,omitzero" json:"-"`
	// Maximum number of vaults to return per page. Defaults to 20, maximum 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Opaque pagination token from a previous `list_vaults` response.
	Page param.Opt[string] `query:"page,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaVaultListParams) URLQuery

func (r BetaVaultListParams) URLQuery() (v url.Values, err error)

URLQuery serializes BetaVaultListParams's query parameters as `url.Values`.

type BetaVaultNewParams

type BetaVaultNewParams struct {
	// Human-readable name for the vault. 1-255 characters.
	DisplayName string `json:"display_name" api:"required"`
	// Arbitrary key-value metadata to attach to the vault. Maximum 16 pairs, keys up
	// to 64 chars, values up to 512 chars.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaVaultNewParams) MarshalJSON

func (r BetaVaultNewParams) MarshalJSON() (data []byte, err error)

func (*BetaVaultNewParams) UnmarshalJSON

func (r *BetaVaultNewParams) UnmarshalJSON(data []byte) error

type BetaVaultService

type BetaVaultService struct {
	Options     []option.RequestOption
	Credentials BetaVaultCredentialService
}

BetaVaultService contains methods and other services that help with interacting with the Juglow 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 NewBetaVaultService method instead.

func NewBetaVaultService

func NewBetaVaultService(opts ...option.RequestOption) (r BetaVaultService)

NewBetaVaultService 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 (*BetaVaultService) Archive

Archive Vault

func (*BetaVaultService) Delete

Delete Vault

func (*BetaVaultService) Get

Get Vault

func (*BetaVaultService) List

List Vaults

func (*BetaVaultService) ListAutoPaging

List Vaults

func (*BetaVaultService) New

Create Vault

func (*BetaVaultService) Update

func (r *BetaVaultService) Update(ctx context.Context, vaultID string, params BetaVaultUpdateParams, opts ...option.RequestOption) (res *BetaManagedAgentsVault, err error)

Update Vault

type BetaVaultUpdateParams

type BetaVaultUpdateParams struct {
	// Updated human-readable name for the vault. 1-255 characters.
	DisplayName param.Opt[string] `json:"display_name,omitzero"`
	// Metadata patch. Set a key to a string to upsert it, or to null to delete it.
	// Omitted keys are preserved.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BetaVaultUpdateParams) MarshalJSON

func (r BetaVaultUpdateParams) MarshalJSON() (data []byte, err error)

func (*BetaVaultUpdateParams) UnmarshalJSON

func (r *BetaVaultUpdateParams) UnmarshalJSON(data []byte) error

type BetaWebFetchBlock

type BetaWebFetchBlock struct {
	Content BetaDocumentBlock `json:"content" api:"required"`
	// ISO 8601 timestamp when the content was retrieved
	RetrievedAt string                  `json:"retrieved_at" api:"required"`
	Type        constant.WebFetchResult `json:"type" default:"web_fetch_result"`
	// Fetched content URL
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		RetrievedAt respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebFetchBlock) RawJSON

func (r BetaWebFetchBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaWebFetchBlock) UnmarshalJSON

func (r *BetaWebFetchBlock) UnmarshalJSON(data []byte) error

type BetaWebFetchBlockParam

type BetaWebFetchBlockParam struct {
	Content BetaRequestDocumentBlockParam `json:"content,omitzero" api:"required"`
	// Fetched content URL
	URL string `json:"url" api:"required"`
	// ISO 8601 timestamp when the content was retrieved
	RetrievedAt param.Opt[string] `json:"retrieved_at,omitzero"`
	// This field can be elided, and will marshal its zero value as "web_fetch_result".
	Type constant.WebFetchResult `json:"type" default:"web_fetch_result"`
	// contains filtered or unexported fields
}

The properties Content, Type, URL are required.

func (BetaWebFetchBlockParam) MarshalJSON

func (r BetaWebFetchBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaWebFetchBlockParam) UnmarshalJSON

func (r *BetaWebFetchBlockParam) UnmarshalJSON(data []byte) error

type BetaWebFetchTool20250910Param

type BetaWebFetchTool20250910Param struct {
	// Maximum number of tokens used by including web page text content in the context.
	// The limit is approximate and does not apply to binary content such as PDFs.
	MaxContentTokens param.Opt[int64] `json:"max_content_tokens,omitzero"`
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// List of domains to allow fetching from
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// List of domains to block fetching from
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Citations configuration for fetched documents. Citations are disabled by
	// default.
	Citations BetaCitationsConfigParam `json:"citations,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_fetch".
	Name constant.WebFetch `json:"name" default:"web_fetch"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_20250910".
	Type constant.WebFetch20250910 `json:"type" default:"web_fetch_20250910"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaWebFetchTool20250910Param) MarshalJSON

func (r BetaWebFetchTool20250910Param) MarshalJSON() (data []byte, err error)

func (*BetaWebFetchTool20250910Param) UnmarshalJSON

func (r *BetaWebFetchTool20250910Param) UnmarshalJSON(data []byte) error

type BetaWebFetchTool20260209Param

type BetaWebFetchTool20260209Param struct {
	// Maximum number of tokens used by including web page text content in the context.
	// The limit is approximate and does not apply to binary content such as PDFs.
	MaxContentTokens param.Opt[int64] `json:"max_content_tokens,omitzero"`
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// List of domains to allow fetching from
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// List of domains to block fetching from
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Citations configuration for fetched documents. Citations are disabled by
	// default.
	Citations BetaCitationsConfigParam `json:"citations,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_fetch".
	Name constant.WebFetch `json:"name" default:"web_fetch"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_20260209".
	Type constant.WebFetch20260209 `json:"type" default:"web_fetch_20260209"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaWebFetchTool20260209Param) MarshalJSON

func (r BetaWebFetchTool20260209Param) MarshalJSON() (data []byte, err error)

func (*BetaWebFetchTool20260209Param) UnmarshalJSON

func (r *BetaWebFetchTool20260209Param) UnmarshalJSON(data []byte) error

type BetaWebFetchTool20260309Param

type BetaWebFetchTool20260309Param struct {
	// Maximum number of tokens used by including web page text content in the context.
	// The limit is approximate and does not apply to binary content such as PDFs.
	MaxContentTokens param.Opt[int64] `json:"max_content_tokens,omitzero"`
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Whether to use cached content. Set to false to bypass the cache and fetch fresh
	// content. Only set to false when the user explicitly requests fresh content or
	// when fetching rapidly-changing sources.
	UseCache param.Opt[bool] `json:"use_cache,omitzero"`
	// List of domains to allow fetching from
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// List of domains to block fetching from
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Citations configuration for fetched documents. Citations are disabled by
	// default.
	Citations BetaCitationsConfigParam `json:"citations,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_fetch".
	Name constant.WebFetch `json:"name" default:"web_fetch"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_20260309".
	Type constant.WebFetch20260309 `json:"type" default:"web_fetch_20260309"`
	// contains filtered or unexported fields
}

Web fetch tool with use_cache parameter for bypassing cached content.

The properties Name, Type are required.

func (BetaWebFetchTool20260309Param) MarshalJSON

func (r BetaWebFetchTool20260309Param) MarshalJSON() (data []byte, err error)

func (*BetaWebFetchTool20260309Param) UnmarshalJSON

func (r *BetaWebFetchTool20260309Param) UnmarshalJSON(data []byte) error

type BetaWebFetchTool20260318Param

type BetaWebFetchTool20260318Param struct {
	// Maximum number of tokens used by including web page text content in the context.
	// The limit is approximate and does not apply to binary content such as PDFs.
	MaxContentTokens param.Opt[int64] `json:"max_content_tokens,omitzero"`
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Whether to use cached content. Set to false to bypass the cache and fetch fresh
	// content. Only set to false when the user explicitly requests fresh content or
	// when fetching rapidly-changing sources.
	UseCache param.Opt[bool] `json:"use_cache,omitzero"`
	// List of domains to allow fetching from
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// List of domains to block fetching from
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Citations configuration for fetched documents. Citations are disabled by
	// default.
	Citations BetaCitationsConfigParam `json:"citations,omitzero"`
	// How this tool's result blocks appear in the API response when the result was
	// consumed by a completed code_execution call in the same turn. 'full' returns the
	// complete content (default). 'excluded' drops the nested server_tool_use and
	// result block pair entirely. Results from direct calls, or from code_execution
	// calls that paused before completing, are always returned in full so they can be
	// sent back on the next turn.
	//
	// Any of "full", "excluded".
	ResponseInclusion BetaWebFetchTool20260318ResponseInclusion `json:"response_inclusion,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_fetch".
	Name constant.WebFetch `json:"name" default:"web_fetch"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_20260318".
	Type constant.WebFetch20260318 `json:"type" default:"web_fetch_20260318"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaWebFetchTool20260318Param) MarshalJSON

func (r BetaWebFetchTool20260318Param) MarshalJSON() (data []byte, err error)

func (*BetaWebFetchTool20260318Param) UnmarshalJSON

func (r *BetaWebFetchTool20260318Param) UnmarshalJSON(data []byte) error

type BetaWebFetchTool20260318ResponseInclusion

type BetaWebFetchTool20260318ResponseInclusion string

How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.

const (
	BetaWebFetchTool20260318ResponseInclusionFull     BetaWebFetchTool20260318ResponseInclusion = "full"
	BetaWebFetchTool20260318ResponseInclusionExcluded BetaWebFetchTool20260318ResponseInclusion = "excluded"
)

type BetaWebFetchToolResultBlock

type BetaWebFetchToolResultBlock struct {
	Content   BetaWebFetchToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                  `json:"tool_use_id" api:"required"`
	Type      constant.WebFetchToolResult             `json:"type" default:"web_fetch_tool_result"`
	// Tool invocation directly from the model.
	Caller BetaWebFetchToolResultBlockCallerUnion `json:"caller"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		Caller      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebFetchToolResultBlock) RawJSON

func (r BetaWebFetchToolResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaWebFetchToolResultBlock) ToParam

func (*BetaWebFetchToolResultBlock) UnmarshalJSON

func (r *BetaWebFetchToolResultBlock) UnmarshalJSON(data []byte) error

type BetaWebFetchToolResultBlockCallerUnion

type BetaWebFetchToolResultBlockCallerUnion struct {
	// Any of "direct", "code_execution_20250825", "code_execution_20260120".
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaWebFetchToolResultBlockCallerUnion contains all possible properties and values from BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller20260120.

Use the BetaWebFetchToolResultBlockCallerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaWebFetchToolResultBlockCallerUnion) AsAny

func (u BetaWebFetchToolResultBlockCallerUnion) AsAny() anyBetaWebFetchToolResultBlockCaller

Use the following switch statement to find the correct variant

switch variant := BetaWebFetchToolResultBlockCallerUnion.AsAny().(type) {
case Juglow.BetaDirectCaller:
case Juglow.BetaServerToolCaller:
case Juglow.BetaServerToolCaller20260120:
default:
  fmt.Errorf("no variant present")
}

func (BetaWebFetchToolResultBlockCallerUnion) AsCodeExecution20250825

func (u BetaWebFetchToolResultBlockCallerUnion) AsCodeExecution20250825() (v BetaServerToolCaller)

func (BetaWebFetchToolResultBlockCallerUnion) AsCodeExecution20260120

func (BetaWebFetchToolResultBlockCallerUnion) AsDirect

func (BetaWebFetchToolResultBlockCallerUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebFetchToolResultBlockCallerUnion) UnmarshalJSON

func (r *BetaWebFetchToolResultBlockCallerUnion) UnmarshalJSON(data []byte) error

type BetaWebFetchToolResultBlockContentUnion

type BetaWebFetchToolResultBlockContentUnion struct {
	// This field is from variant [BetaWebFetchToolResultErrorBlock].
	ErrorCode BetaWebFetchToolResultErrorCode `json:"error_code"`
	Type      string                          `json:"type"`
	// This field is from variant [BetaWebFetchBlock].
	Content BetaDocumentBlock `json:"content"`
	// This field is from variant [BetaWebFetchBlock].
	RetrievedAt string `json:"retrieved_at"`
	// This field is from variant [BetaWebFetchBlock].
	URL  string `json:"url"`
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		Content     respjson.Field
		RetrievedAt respjson.Field
		URL         respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaWebFetchToolResultBlockContentUnion contains all possible properties and values from BetaWebFetchToolResultErrorBlock, BetaWebFetchBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaWebFetchToolResultBlockContentUnion) AsResponseWebFetchResultBlock

func (u BetaWebFetchToolResultBlockContentUnion) AsResponseWebFetchResultBlock() (v BetaWebFetchBlock)

func (BetaWebFetchToolResultBlockContentUnion) AsResponseWebFetchToolResultError

func (u BetaWebFetchToolResultBlockContentUnion) AsResponseWebFetchToolResultError() (v BetaWebFetchToolResultErrorBlock)

func (BetaWebFetchToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebFetchToolResultBlockContentUnion) UnmarshalJSON

func (r *BetaWebFetchToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type BetaWebFetchToolResultBlockParam

type BetaWebFetchToolResultBlockParam struct {
	Content   BetaWebFetchToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                       `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Tool invocation directly from the model.
	Caller BetaWebFetchToolResultBlockParamCallerUnion `json:"caller,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_tool_result".
	Type constant.WebFetchToolResult `json:"type" default:"web_fetch_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (BetaWebFetchToolResultBlockParam) MarshalJSON

func (r BetaWebFetchToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaWebFetchToolResultBlockParam) UnmarshalJSON

func (r *BetaWebFetchToolResultBlockParam) UnmarshalJSON(data []byte) error

type BetaWebFetchToolResultBlockParamCallerUnion

type BetaWebFetchToolResultBlockParamCallerUnion struct {
	OfDirect                *BetaDirectCallerParam             `json:",omitzero,inline"`
	OfCodeExecution20250825 *BetaServerToolCallerParam         `json:",omitzero,inline"`
	OfCodeExecution20260120 *BetaServerToolCaller20260120Param `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 (BetaWebFetchToolResultBlockParamCallerUnion) GetToolID

Returns a pointer to the underlying variant's property, if present.

func (BetaWebFetchToolResultBlockParamCallerUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaWebFetchToolResultBlockParamCallerUnion) MarshalJSON

func (*BetaWebFetchToolResultBlockParamCallerUnion) UnmarshalJSON

func (u *BetaWebFetchToolResultBlockParamCallerUnion) UnmarshalJSON(data []byte) error

type BetaWebFetchToolResultBlockParamContentUnion

type BetaWebFetchToolResultBlockParamContentUnion struct {
	OfRequestWebFetchToolResultError *BetaWebFetchToolResultErrorBlockParam `json:",omitzero,inline"`
	OfRequestWebFetchResultBlock     *BetaWebFetchBlockParam                `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 (BetaWebFetchToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (BetaWebFetchToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (BetaWebFetchToolResultBlockParamContentUnion) GetRetrievedAt

Returns a pointer to the underlying variant's property, if present.

func (BetaWebFetchToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaWebFetchToolResultBlockParamContentUnion) GetURL

Returns a pointer to the underlying variant's property, if present.

func (BetaWebFetchToolResultBlockParamContentUnion) MarshalJSON

func (*BetaWebFetchToolResultBlockParamContentUnion) UnmarshalJSON

func (u *BetaWebFetchToolResultBlockParamContentUnion) UnmarshalJSON(data []byte) error

type BetaWebFetchToolResultErrorBlock

type BetaWebFetchToolResultErrorBlock struct {
	// Any of "invalid_tool_input", "url_too_long", "url_not_allowed",
	// "url_not_in_prior_context", "url_not_accessible", "unsupported_content_type",
	// "too_many_requests", "max_uses_exceeded", "unavailable".
	ErrorCode BetaWebFetchToolResultErrorCode  `json:"error_code" api:"required"`
	Type      constant.WebFetchToolResultError `json:"type" default:"web_fetch_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebFetchToolResultErrorBlock) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebFetchToolResultErrorBlock) UnmarshalJSON

func (r *BetaWebFetchToolResultErrorBlock) UnmarshalJSON(data []byte) error

type BetaWebFetchToolResultErrorBlockParam

type BetaWebFetchToolResultErrorBlockParam struct {
	// Any of "invalid_tool_input", "url_too_long", "url_not_allowed",
	// "url_not_in_prior_context", "url_not_accessible", "unsupported_content_type",
	// "too_many_requests", "max_uses_exceeded", "unavailable".
	ErrorCode BetaWebFetchToolResultErrorCode `json:"error_code,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_tool_result_error".
	Type constant.WebFetchToolResultError `json:"type" default:"web_fetch_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (BetaWebFetchToolResultErrorBlockParam) MarshalJSON

func (r BetaWebFetchToolResultErrorBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaWebFetchToolResultErrorBlockParam) UnmarshalJSON

func (r *BetaWebFetchToolResultErrorBlockParam) UnmarshalJSON(data []byte) error

type BetaWebFetchToolResultErrorCode

type BetaWebFetchToolResultErrorCode string
const (
	BetaWebFetchToolResultErrorCodeInvalidToolInput       BetaWebFetchToolResultErrorCode = "invalid_tool_input"
	BetaWebFetchToolResultErrorCodeURLTooLong             BetaWebFetchToolResultErrorCode = "url_too_long"
	BetaWebFetchToolResultErrorCodeURLNotAllowed          BetaWebFetchToolResultErrorCode = "url_not_allowed"
	BetaWebFetchToolResultErrorCodeURLNotInPriorContext   BetaWebFetchToolResultErrorCode = "url_not_in_prior_context"
	BetaWebFetchToolResultErrorCodeURLNotAccessible       BetaWebFetchToolResultErrorCode = "url_not_accessible"
	BetaWebFetchToolResultErrorCodeUnsupportedContentType BetaWebFetchToolResultErrorCode = "unsupported_content_type"
	BetaWebFetchToolResultErrorCodeTooManyRequests        BetaWebFetchToolResultErrorCode = "too_many_requests"
	BetaWebFetchToolResultErrorCodeMaxUsesExceeded        BetaWebFetchToolResultErrorCode = "max_uses_exceeded"
	BetaWebFetchToolResultErrorCodeUnavailable            BetaWebFetchToolResultErrorCode = "unavailable"
)

type BetaWebSearchResultBlock

type BetaWebSearchResultBlock struct {
	EncryptedContent string                   `json:"encrypted_content" api:"required"`
	PageAge          string                   `json:"page_age" api:"required"`
	Title            string                   `json:"title" api:"required"`
	Type             constant.WebSearchResult `json:"type" default:"web_search_result"`
	URL              string                   `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EncryptedContent respjson.Field
		PageAge          respjson.Field
		Title            respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebSearchResultBlock) RawJSON

func (r BetaWebSearchResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (BetaWebSearchResultBlock) ToParam

func (*BetaWebSearchResultBlock) UnmarshalJSON

func (r *BetaWebSearchResultBlock) UnmarshalJSON(data []byte) error

type BetaWebSearchResultBlockParam

type BetaWebSearchResultBlockParam struct {
	EncryptedContent string            `json:"encrypted_content" api:"required"`
	Title            string            `json:"title" api:"required"`
	URL              string            `json:"url" api:"required"`
	PageAge          param.Opt[string] `json:"page_age,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_result".
	Type constant.WebSearchResult `json:"type" default:"web_search_result"`
	// contains filtered or unexported fields
}

The properties EncryptedContent, Title, Type, URL are required.

func (BetaWebSearchResultBlockParam) MarshalJSON

func (r BetaWebSearchResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaWebSearchResultBlockParam) UnmarshalJSON

func (r *BetaWebSearchResultBlockParam) UnmarshalJSON(data []byte) error

type BetaWebSearchTool20250305Param

type BetaWebSearchTool20250305Param struct {
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// If provided, only these domains will be included in results. Cannot be used
	// alongside `blocked_domains`.
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// If provided, these domains will never appear in results. Cannot be used
	// alongside `allowed_domains`.
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Parameters for the user's location. Used to provide more relevant search
	// results.
	UserLocation BetaUserLocationParam `json:"user_location,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_search".
	Name constant.WebSearch `json:"name" default:"web_search"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_20250305".
	Type constant.WebSearch20250305 `json:"type" default:"web_search_20250305"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaWebSearchTool20250305Param) MarshalJSON

func (r BetaWebSearchTool20250305Param) MarshalJSON() (data []byte, err error)

func (*BetaWebSearchTool20250305Param) UnmarshalJSON

func (r *BetaWebSearchTool20250305Param) UnmarshalJSON(data []byte) error

type BetaWebSearchTool20260209Param

type BetaWebSearchTool20260209Param struct {
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// If provided, only these domains will be included in results. Cannot be used
	// alongside `blocked_domains`.
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// If provided, these domains will never appear in results. Cannot be used
	// alongside `allowed_domains`.
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Parameters for the user's location. Used to provide more relevant search
	// results.
	UserLocation BetaUserLocationParam `json:"user_location,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_search".
	Name constant.WebSearch `json:"name" default:"web_search"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_20260209".
	Type constant.WebSearch20260209 `json:"type" default:"web_search_20260209"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaWebSearchTool20260209Param) MarshalJSON

func (r BetaWebSearchTool20260209Param) MarshalJSON() (data []byte, err error)

func (*BetaWebSearchTool20260209Param) UnmarshalJSON

func (r *BetaWebSearchTool20260209Param) UnmarshalJSON(data []byte) error

type BetaWebSearchTool20260318Param

type BetaWebSearchTool20260318Param struct {
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// If provided, only these domains will be included in results. Cannot be used
	// alongside `blocked_domains`.
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// If provided, these domains will never appear in results. Cannot be used
	// alongside `allowed_domains`.
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// How this tool's result blocks appear in the API response when the result was
	// consumed by a completed code_execution call in the same turn. 'full' returns the
	// complete content (default). 'excluded' drops the nested server_tool_use and
	// result block pair entirely. Results from direct calls, or from code_execution
	// calls that paused before completing, are always returned in full so they can be
	// sent back on the next turn.
	//
	// Any of "full", "excluded".
	ResponseInclusion BetaWebSearchTool20260318ResponseInclusion `json:"response_inclusion,omitzero"`
	// Parameters for the user's location. Used to provide more relevant search
	// results.
	UserLocation BetaUserLocationParam `json:"user_location,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_search".
	Name constant.WebSearch `json:"name" default:"web_search"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_20260318".
	Type constant.WebSearch20260318 `json:"type" default:"web_search_20260318"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (BetaWebSearchTool20260318Param) MarshalJSON

func (r BetaWebSearchTool20260318Param) MarshalJSON() (data []byte, err error)

func (*BetaWebSearchTool20260318Param) UnmarshalJSON

func (r *BetaWebSearchTool20260318Param) UnmarshalJSON(data []byte) error

type BetaWebSearchTool20260318ResponseInclusion

type BetaWebSearchTool20260318ResponseInclusion string

How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.

const (
	BetaWebSearchTool20260318ResponseInclusionFull     BetaWebSearchTool20260318ResponseInclusion = "full"
	BetaWebSearchTool20260318ResponseInclusionExcluded BetaWebSearchTool20260318ResponseInclusion = "excluded"
)

type BetaWebSearchToolRequestErrorParam

type BetaWebSearchToolRequestErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "max_uses_exceeded",
	// "too_many_requests", "query_too_long", "request_too_large".
	ErrorCode BetaWebSearchToolResultErrorCode `json:"error_code,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_tool_result_error".
	Type constant.WebSearchToolResultError `json:"type" default:"web_search_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (BetaWebSearchToolRequestErrorParam) MarshalJSON

func (r BetaWebSearchToolRequestErrorParam) MarshalJSON() (data []byte, err error)

func (*BetaWebSearchToolRequestErrorParam) UnmarshalJSON

func (r *BetaWebSearchToolRequestErrorParam) UnmarshalJSON(data []byte) error

type BetaWebSearchToolResultBlock

type BetaWebSearchToolResultBlock struct {
	Content   BetaWebSearchToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                   `json:"tool_use_id" api:"required"`
	Type      constant.WebSearchToolResult             `json:"type" default:"web_search_tool_result"`
	// Tool invocation directly from the model.
	Caller BetaWebSearchToolResultBlockCallerUnion `json:"caller"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		Caller      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebSearchToolResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (BetaWebSearchToolResultBlock) ToParam

func (*BetaWebSearchToolResultBlock) UnmarshalJSON

func (r *BetaWebSearchToolResultBlock) UnmarshalJSON(data []byte) error

type BetaWebSearchToolResultBlockCallerUnion

type BetaWebSearchToolResultBlockCallerUnion struct {
	// Any of "direct", "code_execution_20250825", "code_execution_20260120".
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaWebSearchToolResultBlockCallerUnion contains all possible properties and values from BetaDirectCaller, BetaServerToolCaller, BetaServerToolCaller20260120.

Use the BetaWebSearchToolResultBlockCallerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaWebSearchToolResultBlockCallerUnion) AsAny

func (u BetaWebSearchToolResultBlockCallerUnion) AsAny() anyBetaWebSearchToolResultBlockCaller

Use the following switch statement to find the correct variant

switch variant := BetaWebSearchToolResultBlockCallerUnion.AsAny().(type) {
case Juglow.BetaDirectCaller:
case Juglow.BetaServerToolCaller:
case Juglow.BetaServerToolCaller20260120:
default:
  fmt.Errorf("no variant present")
}

func (BetaWebSearchToolResultBlockCallerUnion) AsCodeExecution20250825

func (u BetaWebSearchToolResultBlockCallerUnion) AsCodeExecution20250825() (v BetaServerToolCaller)

func (BetaWebSearchToolResultBlockCallerUnion) AsCodeExecution20260120

func (BetaWebSearchToolResultBlockCallerUnion) AsDirect

func (BetaWebSearchToolResultBlockCallerUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebSearchToolResultBlockCallerUnion) UnmarshalJSON

func (r *BetaWebSearchToolResultBlockCallerUnion) UnmarshalJSON(data []byte) error

type BetaWebSearchToolResultBlockContentUnion

type BetaWebSearchToolResultBlockContentUnion struct {
	// This field will be present if the value is a [[]BetaWebSearchResultBlock]
	// instead of an object.
	OfBetaWebSearchResultBlockArray []BetaWebSearchResultBlock `json:",inline"`
	// This field is from variant [BetaWebSearchToolResultError].
	ErrorCode BetaWebSearchToolResultErrorCode `json:"error_code"`
	// This field is from variant [BetaWebSearchToolResultError].
	Type constant.WebSearchToolResultError `json:"type"`
	JSON struct {
		OfBetaWebSearchResultBlockArray respjson.Field
		ErrorCode                       respjson.Field
		Type                            respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaWebSearchToolResultBlockContentUnion contains all possible properties and values from BetaWebSearchToolResultError, [[]BetaWebSearchResultBlock].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfBetaWebSearchResultBlockArray]

func (BetaWebSearchToolResultBlockContentUnion) AsBetaWebSearchResultBlockArray

func (u BetaWebSearchToolResultBlockContentUnion) AsBetaWebSearchResultBlockArray() (v []BetaWebSearchResultBlock)

func (BetaWebSearchToolResultBlockContentUnion) AsResponseWebSearchToolResultError

func (u BetaWebSearchToolResultBlockContentUnion) AsResponseWebSearchToolResultError() (v BetaWebSearchToolResultError)

func (BetaWebSearchToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebSearchToolResultBlockContentUnion) UnmarshalJSON

func (r *BetaWebSearchToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type BetaWebSearchToolResultBlockParam

type BetaWebSearchToolResultBlockParam struct {
	Content   BetaWebSearchToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                        `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl BetaCacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Tool invocation directly from the model.
	Caller BetaWebSearchToolResultBlockParamCallerUnion `json:"caller,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_tool_result".
	Type constant.WebSearchToolResult `json:"type" default:"web_search_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (BetaWebSearchToolResultBlockParam) MarshalJSON

func (r BetaWebSearchToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*BetaWebSearchToolResultBlockParam) UnmarshalJSON

func (r *BetaWebSearchToolResultBlockParam) UnmarshalJSON(data []byte) error

type BetaWebSearchToolResultBlockParamCallerUnion

type BetaWebSearchToolResultBlockParamCallerUnion struct {
	OfDirect                *BetaDirectCallerParam             `json:",omitzero,inline"`
	OfCodeExecution20250825 *BetaServerToolCallerParam         `json:",omitzero,inline"`
	OfCodeExecution20260120 *BetaServerToolCaller20260120Param `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 (BetaWebSearchToolResultBlockParamCallerUnion) GetToolID

Returns a pointer to the underlying variant's property, if present.

func (BetaWebSearchToolResultBlockParamCallerUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (BetaWebSearchToolResultBlockParamCallerUnion) MarshalJSON

func (*BetaWebSearchToolResultBlockParamCallerUnion) UnmarshalJSON

func (u *BetaWebSearchToolResultBlockParamCallerUnion) UnmarshalJSON(data []byte) error

type BetaWebSearchToolResultBlockParamContentUnion

type BetaWebSearchToolResultBlockParamContentUnion struct {
	OfResultBlock []BetaWebSearchResultBlockParam     `json:",omitzero,inline"`
	OfError       *BetaWebSearchToolRequestErrorParam `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 (BetaWebSearchToolResultBlockParamContentUnion) MarshalJSON

func (*BetaWebSearchToolResultBlockParamContentUnion) UnmarshalJSON

func (u *BetaWebSearchToolResultBlockParamContentUnion) UnmarshalJSON(data []byte) error

type BetaWebSearchToolResultError

type BetaWebSearchToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "max_uses_exceeded",
	// "too_many_requests", "query_too_long", "request_too_large".
	ErrorCode BetaWebSearchToolResultErrorCode  `json:"error_code" api:"required"`
	Type      constant.WebSearchToolResultError `json:"type" default:"web_search_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebSearchToolResultError) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebSearchToolResultError) UnmarshalJSON

func (r *BetaWebSearchToolResultError) UnmarshalJSON(data []byte) error

type BetaWebSearchToolResultErrorCode

type BetaWebSearchToolResultErrorCode string
const (
	BetaWebSearchToolResultErrorCodeInvalidToolInput BetaWebSearchToolResultErrorCode = "invalid_tool_input"
	BetaWebSearchToolResultErrorCodeUnavailable      BetaWebSearchToolResultErrorCode = "unavailable"
	BetaWebSearchToolResultErrorCodeMaxUsesExceeded  BetaWebSearchToolResultErrorCode = "max_uses_exceeded"
	BetaWebSearchToolResultErrorCodeTooManyRequests  BetaWebSearchToolResultErrorCode = "too_many_requests"
	BetaWebSearchToolResultErrorCodeQueryTooLong     BetaWebSearchToolResultErrorCode = "query_too_long"
	BetaWebSearchToolResultErrorCodeRequestTooLarge  BetaWebSearchToolResultErrorCode = "request_too_large"
)

type BetaWebhookAgentArchivedEventData

type BetaWebhookAgentArchivedEventData struct {
	// ID of the agent that triggered the event.
	ID             string                 `json:"id" api:"required"`
	OrganizationID string                 `json:"organization_id" api:"required"`
	Type           constant.AgentArchived `json:"type" default:"agent.archived"`
	WorkspaceID    string                 `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookAgentArchivedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookAgentArchivedEventData) UnmarshalJSON

func (r *BetaWebhookAgentArchivedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookAgentCreatedEventData

type BetaWebhookAgentCreatedEventData struct {
	// ID of the agent that triggered the event.
	ID             string                `json:"id" api:"required"`
	OrganizationID string                `json:"organization_id" api:"required"`
	Type           constant.AgentCreated `json:"type" default:"agent.created"`
	WorkspaceID    string                `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookAgentCreatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookAgentCreatedEventData) UnmarshalJSON

func (r *BetaWebhookAgentCreatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookAgentDeletedEventData

type BetaWebhookAgentDeletedEventData struct {
	// ID of the agent that triggered the event.
	ID             string                `json:"id" api:"required"`
	OrganizationID string                `json:"organization_id" api:"required"`
	Type           constant.AgentDeleted `json:"type" default:"agent.deleted"`
	WorkspaceID    string                `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookAgentDeletedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookAgentDeletedEventData) UnmarshalJSON

func (r *BetaWebhookAgentDeletedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookAgentUpdatedEventData

type BetaWebhookAgentUpdatedEventData struct {
	// ID of the agent that triggered the event.
	ID             string                `json:"id" api:"required"`
	OrganizationID string                `json:"organization_id" api:"required"`
	Type           constant.AgentUpdated `json:"type" default:"agent.updated"`
	WorkspaceID    string                `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookAgentUpdatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookAgentUpdatedEventData) UnmarshalJSON

func (r *BetaWebhookAgentUpdatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookDeploymentArchivedEventData

type BetaWebhookDeploymentArchivedEventData struct {
	// ID of the deployment that triggered the event.
	ID             string                      `json:"id" api:"required"`
	OrganizationID string                      `json:"organization_id" api:"required"`
	Type           constant.DeploymentArchived `json:"type" default:"deployment.archived"`
	WorkspaceID    string                      `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookDeploymentArchivedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookDeploymentArchivedEventData) UnmarshalJSON

func (r *BetaWebhookDeploymentArchivedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookDeploymentCreatedEventData

type BetaWebhookDeploymentCreatedEventData struct {
	// ID of the deployment that triggered the event.
	ID             string                     `json:"id" api:"required"`
	OrganizationID string                     `json:"organization_id" api:"required"`
	Type           constant.DeploymentCreated `json:"type" default:"deployment.created"`
	WorkspaceID    string                     `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookDeploymentCreatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookDeploymentCreatedEventData) UnmarshalJSON

func (r *BetaWebhookDeploymentCreatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookDeploymentDeletedEventData

type BetaWebhookDeploymentDeletedEventData struct {
	// ID of the deployment that triggered the event.
	ID             string                     `json:"id" api:"required"`
	OrganizationID string                     `json:"organization_id" api:"required"`
	Type           constant.DeploymentDeleted `json:"type" default:"deployment.deleted"`
	WorkspaceID    string                     `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookDeploymentDeletedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookDeploymentDeletedEventData) UnmarshalJSON

func (r *BetaWebhookDeploymentDeletedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookDeploymentPausedEventData

type BetaWebhookDeploymentPausedEventData struct {
	// ID of the deployment that triggered the event.
	ID             string                    `json:"id" api:"required"`
	OrganizationID string                    `json:"organization_id" api:"required"`
	Type           constant.DeploymentPaused `json:"type" default:"deployment.paused"`
	WorkspaceID    string                    `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookDeploymentPausedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookDeploymentPausedEventData) UnmarshalJSON

func (r *BetaWebhookDeploymentPausedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookDeploymentRunFailedEventData

type BetaWebhookDeploymentRunFailedEventData struct {
	// ID of the deployment run that triggered the event.
	ID             string                       `json:"id" api:"required"`
	OrganizationID string                       `json:"organization_id" api:"required"`
	Type           constant.DeploymentRunFailed `json:"type" default:"deployment_run.failed"`
	WorkspaceID    string                       `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookDeploymentRunFailedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookDeploymentRunFailedEventData) UnmarshalJSON

func (r *BetaWebhookDeploymentRunFailedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookDeploymentRunStartedEventData

type BetaWebhookDeploymentRunStartedEventData struct {
	// ID of the deployment run that triggered the event.
	ID             string                        `json:"id" api:"required"`
	OrganizationID string                        `json:"organization_id" api:"required"`
	Type           constant.DeploymentRunStarted `json:"type" default:"deployment_run.started"`
	WorkspaceID    string                        `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookDeploymentRunStartedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookDeploymentRunStartedEventData) UnmarshalJSON

func (r *BetaWebhookDeploymentRunStartedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookDeploymentRunSucceededEventData

type BetaWebhookDeploymentRunSucceededEventData struct {
	// ID of the deployment run that triggered the event.
	ID             string                          `json:"id" api:"required"`
	OrganizationID string                          `json:"organization_id" api:"required"`
	Type           constant.DeploymentRunSucceeded `json:"type" default:"deployment_run.succeeded"`
	WorkspaceID    string                          `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookDeploymentRunSucceededEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookDeploymentRunSucceededEventData) UnmarshalJSON

func (r *BetaWebhookDeploymentRunSucceededEventData) UnmarshalJSON(data []byte) error

type BetaWebhookDeploymentUnpausedEventData

type BetaWebhookDeploymentUnpausedEventData struct {
	// ID of the deployment that triggered the event.
	ID             string                      `json:"id" api:"required"`
	OrganizationID string                      `json:"organization_id" api:"required"`
	Type           constant.DeploymentUnpaused `json:"type" default:"deployment.unpaused"`
	WorkspaceID    string                      `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookDeploymentUnpausedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookDeploymentUnpausedEventData) UnmarshalJSON

func (r *BetaWebhookDeploymentUnpausedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookDeploymentUpdatedEventData

type BetaWebhookDeploymentUpdatedEventData struct {
	// ID of the deployment that triggered the event.
	ID             string                     `json:"id" api:"required"`
	OrganizationID string                     `json:"organization_id" api:"required"`
	Type           constant.DeploymentUpdated `json:"type" default:"deployment.updated"`
	WorkspaceID    string                     `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookDeploymentUpdatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookDeploymentUpdatedEventData) UnmarshalJSON

func (r *BetaWebhookDeploymentUpdatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookEnvironmentArchivedEventData

type BetaWebhookEnvironmentArchivedEventData struct {
	// ID of the environment that triggered the event.
	ID             string                       `json:"id" api:"required"`
	OrganizationID string                       `json:"organization_id" api:"required"`
	Type           constant.EnvironmentArchived `json:"type" default:"environment.archived"`
	WorkspaceID    string                       `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookEnvironmentArchivedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookEnvironmentArchivedEventData) UnmarshalJSON

func (r *BetaWebhookEnvironmentArchivedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookEnvironmentCreatedEventData

type BetaWebhookEnvironmentCreatedEventData struct {
	// ID of the environment that triggered the event.
	ID             string                      `json:"id" api:"required"`
	OrganizationID string                      `json:"organization_id" api:"required"`
	Type           constant.EnvironmentCreated `json:"type" default:"environment.created"`
	WorkspaceID    string                      `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookEnvironmentCreatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookEnvironmentCreatedEventData) UnmarshalJSON

func (r *BetaWebhookEnvironmentCreatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookEnvironmentDeletedEventData

type BetaWebhookEnvironmentDeletedEventData struct {
	// ID of the environment that triggered the event.
	ID             string                      `json:"id" api:"required"`
	OrganizationID string                      `json:"organization_id" api:"required"`
	Type           constant.EnvironmentDeleted `json:"type" default:"environment.deleted"`
	WorkspaceID    string                      `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookEnvironmentDeletedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookEnvironmentDeletedEventData) UnmarshalJSON

func (r *BetaWebhookEnvironmentDeletedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookEnvironmentUpdatedEventData

type BetaWebhookEnvironmentUpdatedEventData struct {
	// ID of the environment that triggered the event.
	ID             string                      `json:"id" api:"required"`
	OrganizationID string                      `json:"organization_id" api:"required"`
	Type           constant.EnvironmentUpdated `json:"type" default:"environment.updated"`
	WorkspaceID    string                      `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookEnvironmentUpdatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookEnvironmentUpdatedEventData) UnmarshalJSON

func (r *BetaWebhookEnvironmentUpdatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookEventDataUnion

type BetaWebhookEventDataUnion struct {
	ID             string `json:"id"`
	OrganizationID string `json:"organization_id"`
	// Any of "session.created", "session.pending", "session.running", "session.idled",
	// "session.requires_action", "session.archived", "session.deleted",
	// "session.status_rescheduled", "session.status_run_started",
	// "session.status_idled", "session.status_terminated", "session.thread_created",
	// "session.thread_idled", "session.thread_terminated",
	// "session.outcome_evaluation_ended", "vault.created", "vault.archived",
	// "vault.deleted", "vault_credential.created", "vault_credential.archived",
	// "vault_credential.deleted", "vault_credential.refresh_failed",
	// "session.updated", "agent.created", "agent.archived", "agent.deleted",
	// "deployment.paused", "deployment_run.failed", "deployment.created",
	// "deployment.updated", "deployment.unpaused", "agent.updated",
	// "deployment.archived", "deployment_run.started", "deployment.deleted",
	// "deployment_run.succeeded", "environment.created", "environment.updated",
	// "environment.archived", "environment.deleted", "memory_store.created",
	// "memory_store.archived", "memory_store.deleted", "session.budget_reached".
	Type            string `json:"type"`
	WorkspaceID     string `json:"workspace_id"`
	SessionThreadID string `json:"session_thread_id"`
	VaultID         string `json:"vault_id"`
	JSON            struct {
		ID              respjson.Field
		OrganizationID  respjson.Field
		Type            respjson.Field
		WorkspaceID     respjson.Field
		SessionThreadID respjson.Field
		VaultID         respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BetaWebhookEventDataUnion contains all possible properties and values from BetaWebhookSessionCreatedEventData, BetaWebhookSessionPendingEventData, BetaWebhookSessionRunningEventData, BetaWebhookSessionIdledEventData, BetaWebhookSessionRequiresActionEventData, BetaWebhookSessionArchivedEventData, BetaWebhookSessionDeletedEventData, BetaWebhookSessionStatusRescheduledEventData, BetaWebhookSessionStatusRunStartedEventData, BetaWebhookSessionStatusIdledEventData, BetaWebhookSessionStatusTerminatedEventData, BetaWebhookSessionThreadCreatedEventData, BetaWebhookSessionThreadIdledEventData, BetaWebhookSessionThreadTerminatedEventData, BetaWebhookSessionOutcomeEvaluationEndedEventData, BetaWebhookVaultCreatedEventData, BetaWebhookVaultArchivedEventData, BetaWebhookVaultDeletedEventData, BetaWebhookVaultCredentialCreatedEventData, BetaWebhookVaultCredentialArchivedEventData, BetaWebhookVaultCredentialDeletedEventData, BetaWebhookVaultCredentialRefreshFailedEventData, BetaWebhookSessionUpdatedEventData, BetaWebhookAgentCreatedEventData, BetaWebhookAgentArchivedEventData, BetaWebhookAgentDeletedEventData, BetaWebhookDeploymentPausedEventData, BetaWebhookDeploymentRunFailedEventData, BetaWebhookDeploymentCreatedEventData, BetaWebhookDeploymentUpdatedEventData, BetaWebhookDeploymentUnpausedEventData, BetaWebhookAgentUpdatedEventData, BetaWebhookDeploymentArchivedEventData, BetaWebhookDeploymentRunStartedEventData, BetaWebhookDeploymentDeletedEventData, BetaWebhookDeploymentRunSucceededEventData, BetaWebhookEnvironmentCreatedEventData, BetaWebhookEnvironmentUpdatedEventData, BetaWebhookEnvironmentArchivedEventData, BetaWebhookEnvironmentDeletedEventData, BetaWebhookMemoryStoreCreatedEventData, BetaWebhookMemoryStoreArchivedEventData, BetaWebhookMemoryStoreDeletedEventData, BetaWebhookSessionBudgetReachedEventData.

Use the BetaWebhookEventDataUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (BetaWebhookEventDataUnion) AsAgentArchived

func (BetaWebhookEventDataUnion) AsAgentCreated

func (BetaWebhookEventDataUnion) AsAgentDeleted

func (BetaWebhookEventDataUnion) AsAgentUpdated

func (BetaWebhookEventDataUnion) AsAny

func (u BetaWebhookEventDataUnion) AsAny() anyBetaWebhookEventData

Use the following switch statement to find the correct variant

switch variant := BetaWebhookEventDataUnion.AsAny().(type) {
case Juglow.BetaWebhookSessionCreatedEventData:
case Juglow.BetaWebhookSessionPendingEventData:
case Juglow.BetaWebhookSessionRunningEventData:
case Juglow.BetaWebhookSessionIdledEventData:
case Juglow.BetaWebhookSessionRequiresActionEventData:
case Juglow.BetaWebhookSessionArchivedEventData:
case Juglow.BetaWebhookSessionDeletedEventData:
case Juglow.BetaWebhookSessionStatusRescheduledEventData:
case Juglow.BetaWebhookSessionStatusRunStartedEventData:
case Juglow.BetaWebhookSessionStatusIdledEventData:
case Juglow.BetaWebhookSessionStatusTerminatedEventData:
case Juglow.BetaWebhookSessionThreadCreatedEventData:
case Juglow.BetaWebhookSessionThreadIdledEventData:
case Juglow.BetaWebhookSessionThreadTerminatedEventData:
case Juglow.BetaWebhookSessionOutcomeEvaluationEndedEventData:
case Juglow.BetaWebhookVaultCreatedEventData:
case Juglow.BetaWebhookVaultArchivedEventData:
case Juglow.BetaWebhookVaultDeletedEventData:
case Juglow.BetaWebhookVaultCredentialCreatedEventData:
case Juglow.BetaWebhookVaultCredentialArchivedEventData:
case Juglow.BetaWebhookVaultCredentialDeletedEventData:
case Juglow.BetaWebhookVaultCredentialRefreshFailedEventData:
case Juglow.BetaWebhookSessionUpdatedEventData:
case Juglow.BetaWebhookAgentCreatedEventData:
case Juglow.BetaWebhookAgentArchivedEventData:
case Juglow.BetaWebhookAgentDeletedEventData:
case Juglow.BetaWebhookDeploymentPausedEventData:
case Juglow.BetaWebhookDeploymentRunFailedEventData:
case Juglow.BetaWebhookDeploymentCreatedEventData:
case Juglow.BetaWebhookDeploymentUpdatedEventData:
case Juglow.BetaWebhookDeploymentUnpausedEventData:
case Juglow.BetaWebhookAgentUpdatedEventData:
case Juglow.BetaWebhookDeploymentArchivedEventData:
case Juglow.BetaWebhookDeploymentRunStartedEventData:
case Juglow.BetaWebhookDeploymentDeletedEventData:
case Juglow.BetaWebhookDeploymentRunSucceededEventData:
case Juglow.BetaWebhookEnvironmentCreatedEventData:
case Juglow.BetaWebhookEnvironmentUpdatedEventData:
case Juglow.BetaWebhookEnvironmentArchivedEventData:
case Juglow.BetaWebhookEnvironmentDeletedEventData:
case Juglow.BetaWebhookMemoryStoreCreatedEventData:
case Juglow.BetaWebhookMemoryStoreArchivedEventData:
case Juglow.BetaWebhookMemoryStoreDeletedEventData:
case Juglow.BetaWebhookSessionBudgetReachedEventData:
default:
  fmt.Errorf("no variant present")
}

func (BetaWebhookEventDataUnion) AsDeploymentArchived

func (BetaWebhookEventDataUnion) AsDeploymentCreated

func (BetaWebhookEventDataUnion) AsDeploymentDeleted

func (BetaWebhookEventDataUnion) AsDeploymentPaused

func (BetaWebhookEventDataUnion) AsDeploymentRunFailed

func (BetaWebhookEventDataUnion) AsDeploymentRunStarted

func (BetaWebhookEventDataUnion) AsDeploymentRunSucceeded

func (BetaWebhookEventDataUnion) AsDeploymentUnpaused

func (BetaWebhookEventDataUnion) AsDeploymentUpdated

func (BetaWebhookEventDataUnion) AsEnvironmentArchived

func (BetaWebhookEventDataUnion) AsEnvironmentCreated

func (BetaWebhookEventDataUnion) AsEnvironmentDeleted

func (BetaWebhookEventDataUnion) AsEnvironmentUpdated

func (BetaWebhookEventDataUnion) AsMemoryStoreArchived

func (BetaWebhookEventDataUnion) AsMemoryStoreCreated

func (BetaWebhookEventDataUnion) AsMemoryStoreDeleted

func (BetaWebhookEventDataUnion) AsSessionArchived

func (BetaWebhookEventDataUnion) AsSessionBudgetReached

func (BetaWebhookEventDataUnion) AsSessionCreated

func (BetaWebhookEventDataUnion) AsSessionDeleted

func (BetaWebhookEventDataUnion) AsSessionIdled

func (BetaWebhookEventDataUnion) AsSessionOutcomeEvaluationEnded

func (u BetaWebhookEventDataUnion) AsSessionOutcomeEvaluationEnded() (v BetaWebhookSessionOutcomeEvaluationEndedEventData)

func (BetaWebhookEventDataUnion) AsSessionPending

func (BetaWebhookEventDataUnion) AsSessionRequiresAction

func (BetaWebhookEventDataUnion) AsSessionRunning

func (BetaWebhookEventDataUnion) AsSessionStatusIdled

func (BetaWebhookEventDataUnion) AsSessionStatusRescheduled

func (BetaWebhookEventDataUnion) AsSessionStatusRunStarted

func (BetaWebhookEventDataUnion) AsSessionStatusTerminated

func (BetaWebhookEventDataUnion) AsSessionThreadCreated

func (BetaWebhookEventDataUnion) AsSessionThreadIdled

func (BetaWebhookEventDataUnion) AsSessionThreadTerminated

func (BetaWebhookEventDataUnion) AsSessionUpdated

func (BetaWebhookEventDataUnion) AsVaultArchived

func (BetaWebhookEventDataUnion) AsVaultCreated

func (BetaWebhookEventDataUnion) AsVaultCredentialArchived

func (BetaWebhookEventDataUnion) AsVaultCredentialCreated

func (BetaWebhookEventDataUnion) AsVaultCredentialDeleted

func (BetaWebhookEventDataUnion) AsVaultCredentialRefreshFailed

func (u BetaWebhookEventDataUnion) AsVaultCredentialRefreshFailed() (v BetaWebhookVaultCredentialRefreshFailedEventData)

func (BetaWebhookEventDataUnion) AsVaultDeleted

func (BetaWebhookEventDataUnion) RawJSON

func (u BetaWebhookEventDataUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*BetaWebhookEventDataUnion) UnmarshalJSON

func (r *BetaWebhookEventDataUnion) UnmarshalJSON(data []byte) error

type BetaWebhookMemoryStoreArchivedEventData

type BetaWebhookMemoryStoreArchivedEventData struct {
	// ID of the memory store that triggered the event.
	ID             string                       `json:"id" api:"required"`
	OrganizationID string                       `json:"organization_id" api:"required"`
	Type           constant.MemoryStoreArchived `json:"type" default:"memory_store.archived"`
	WorkspaceID    string                       `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookMemoryStoreArchivedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookMemoryStoreArchivedEventData) UnmarshalJSON

func (r *BetaWebhookMemoryStoreArchivedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookMemoryStoreCreatedEventData

type BetaWebhookMemoryStoreCreatedEventData struct {
	// ID of the memory store that triggered the event.
	ID             string                      `json:"id" api:"required"`
	OrganizationID string                      `json:"organization_id" api:"required"`
	Type           constant.MemoryStoreCreated `json:"type" default:"memory_store.created"`
	WorkspaceID    string                      `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookMemoryStoreCreatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookMemoryStoreCreatedEventData) UnmarshalJSON

func (r *BetaWebhookMemoryStoreCreatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookMemoryStoreDeletedEventData

type BetaWebhookMemoryStoreDeletedEventData struct {
	// ID of the memory store that triggered the event.
	ID             string                      `json:"id" api:"required"`
	OrganizationID string                      `json:"organization_id" api:"required"`
	Type           constant.MemoryStoreDeleted `json:"type" default:"memory_store.deleted"`
	WorkspaceID    string                      `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookMemoryStoreDeletedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookMemoryStoreDeletedEventData) UnmarshalJSON

func (r *BetaWebhookMemoryStoreDeletedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookService

type BetaWebhookService struct {
	Options []option.RequestOption
}

BetaWebhookService contains methods and other services that help with interacting with the Juglow 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 NewBetaWebhookService method instead.

func NewBetaWebhookService

func NewBetaWebhookService(opts ...option.RequestOption) (r BetaWebhookService)

NewBetaWebhookService 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 (*BetaWebhookService) Unwrap

func (r *BetaWebhookService) Unwrap(payload []byte, headers http.Header, opts ...option.RequestOption) (*UnwrapWebhookEvent, error)

type BetaWebhookSessionArchivedEventData

type BetaWebhookSessionArchivedEventData struct {
	// ID of the session that triggered the event.
	ID             string                   `json:"id" api:"required"`
	OrganizationID string                   `json:"organization_id" api:"required"`
	Type           constant.SessionArchived `json:"type" default:"session.archived"`
	WorkspaceID    string                   `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionArchivedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionArchivedEventData) UnmarshalJSON

func (r *BetaWebhookSessionArchivedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionBudgetReachedEventData

type BetaWebhookSessionBudgetReachedEventData struct {
	// ID of the session that triggered the event.
	ID             string                        `json:"id" api:"required"`
	OrganizationID string                        `json:"organization_id" api:"required"`
	Type           constant.SessionBudgetReached `json:"type" default:"session.budget_reached"`
	WorkspaceID    string                        `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionBudgetReachedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionBudgetReachedEventData) UnmarshalJSON

func (r *BetaWebhookSessionBudgetReachedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionCreatedEventData

type BetaWebhookSessionCreatedEventData struct {
	// ID of the session that triggered the event.
	ID             string                  `json:"id" api:"required"`
	OrganizationID string                  `json:"organization_id" api:"required"`
	Type           constant.SessionCreated `json:"type" default:"session.created"`
	WorkspaceID    string                  `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionCreatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionCreatedEventData) UnmarshalJSON

func (r *BetaWebhookSessionCreatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionDeletedEventData

type BetaWebhookSessionDeletedEventData struct {
	// ID of the session that triggered the event.
	ID             string                  `json:"id" api:"required"`
	OrganizationID string                  `json:"organization_id" api:"required"`
	Type           constant.SessionDeleted `json:"type" default:"session.deleted"`
	WorkspaceID    string                  `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionDeletedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionDeletedEventData) UnmarshalJSON

func (r *BetaWebhookSessionDeletedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionIdledEventData

type BetaWebhookSessionIdledEventData struct {
	// ID of the session that triggered the event.
	ID             string                `json:"id" api:"required"`
	OrganizationID string                `json:"organization_id" api:"required"`
	Type           constant.SessionIdled `json:"type" default:"session.idled"`
	WorkspaceID    string                `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionIdledEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionIdledEventData) UnmarshalJSON

func (r *BetaWebhookSessionIdledEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionOutcomeEvaluationEndedEventData

type BetaWebhookSessionOutcomeEvaluationEndedEventData struct {
	// ID of the session that triggered the event.
	ID             string                                 `json:"id" api:"required"`
	OrganizationID string                                 `json:"organization_id" api:"required"`
	Type           constant.SessionOutcomeEvaluationEnded `json:"type" default:"session.outcome_evaluation_ended"`
	WorkspaceID    string                                 `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionOutcomeEvaluationEndedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionOutcomeEvaluationEndedEventData) UnmarshalJSON

type BetaWebhookSessionPendingEventData

type BetaWebhookSessionPendingEventData struct {
	// ID of the session that triggered the event.
	ID             string                  `json:"id" api:"required"`
	OrganizationID string                  `json:"organization_id" api:"required"`
	Type           constant.SessionPending `json:"type" default:"session.pending"`
	WorkspaceID    string                  `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionPendingEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionPendingEventData) UnmarshalJSON

func (r *BetaWebhookSessionPendingEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionRequiresActionEventData

type BetaWebhookSessionRequiresActionEventData struct {
	// ID of the session that triggered the event.
	ID             string                         `json:"id" api:"required"`
	OrganizationID string                         `json:"organization_id" api:"required"`
	Type           constant.SessionRequiresAction `json:"type" default:"session.requires_action"`
	WorkspaceID    string                         `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionRequiresActionEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionRequiresActionEventData) UnmarshalJSON

func (r *BetaWebhookSessionRequiresActionEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionRunningEventData

type BetaWebhookSessionRunningEventData struct {
	// ID of the session that triggered the event.
	ID             string                  `json:"id" api:"required"`
	OrganizationID string                  `json:"organization_id" api:"required"`
	Type           constant.SessionRunning `json:"type" default:"session.running"`
	WorkspaceID    string                  `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionRunningEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionRunningEventData) UnmarshalJSON

func (r *BetaWebhookSessionRunningEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionStatusIdledEventData

type BetaWebhookSessionStatusIdledEventData struct {
	// ID of the session that triggered the event.
	ID             string                      `json:"id" api:"required"`
	OrganizationID string                      `json:"organization_id" api:"required"`
	Type           constant.SessionStatusIdled `json:"type" default:"session.status_idled"`
	WorkspaceID    string                      `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionStatusIdledEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionStatusIdledEventData) UnmarshalJSON

func (r *BetaWebhookSessionStatusIdledEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionStatusRescheduledEventData

type BetaWebhookSessionStatusRescheduledEventData struct {
	// ID of the session that triggered the event.
	ID             string                            `json:"id" api:"required"`
	OrganizationID string                            `json:"organization_id" api:"required"`
	Type           constant.SessionStatusRescheduled `json:"type" default:"session.status_rescheduled"`
	WorkspaceID    string                            `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionStatusRescheduledEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionStatusRescheduledEventData) UnmarshalJSON

func (r *BetaWebhookSessionStatusRescheduledEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionStatusRunStartedEventData

type BetaWebhookSessionStatusRunStartedEventData struct {
	// ID of the session that triggered the event.
	ID             string                           `json:"id" api:"required"`
	OrganizationID string                           `json:"organization_id" api:"required"`
	Type           constant.SessionStatusRunStarted `json:"type" default:"session.status_run_started"`
	WorkspaceID    string                           `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionStatusRunStartedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionStatusRunStartedEventData) UnmarshalJSON

func (r *BetaWebhookSessionStatusRunStartedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionStatusTerminatedEventData

type BetaWebhookSessionStatusTerminatedEventData struct {
	// ID of the session that triggered the event.
	ID             string                           `json:"id" api:"required"`
	OrganizationID string                           `json:"organization_id" api:"required"`
	Type           constant.SessionStatusTerminated `json:"type" default:"session.status_terminated"`
	WorkspaceID    string                           `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionStatusTerminatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionStatusTerminatedEventData) UnmarshalJSON

func (r *BetaWebhookSessionStatusTerminatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionThreadCreatedEventData

type BetaWebhookSessionThreadCreatedEventData struct {
	// ID of the session that triggered the event.
	ID             string `json:"id" api:"required"`
	OrganizationID string `json:"organization_id" api:"required"`
	// ID of the session thread this event refers to.
	SessionThreadID string                        `json:"session_thread_id" api:"required"`
	Type            constant.SessionThreadCreated `json:"type" default:"session.thread_created"`
	WorkspaceID     string                        `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		OrganizationID  respjson.Field
		SessionThreadID respjson.Field
		Type            respjson.Field
		WorkspaceID     respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionThreadCreatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionThreadCreatedEventData) UnmarshalJSON

func (r *BetaWebhookSessionThreadCreatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionThreadIdledEventData

type BetaWebhookSessionThreadIdledEventData struct {
	// ID of the session that triggered the event.
	ID             string `json:"id" api:"required"`
	OrganizationID string `json:"organization_id" api:"required"`
	// ID of the session thread this event refers to.
	SessionThreadID string                      `json:"session_thread_id" api:"required"`
	Type            constant.SessionThreadIdled `json:"type" default:"session.thread_idled"`
	WorkspaceID     string                      `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		OrganizationID  respjson.Field
		SessionThreadID respjson.Field
		Type            respjson.Field
		WorkspaceID     respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionThreadIdledEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionThreadIdledEventData) UnmarshalJSON

func (r *BetaWebhookSessionThreadIdledEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionThreadTerminatedEventData

type BetaWebhookSessionThreadTerminatedEventData struct {
	// ID of the session that triggered the event.
	ID             string `json:"id" api:"required"`
	OrganizationID string `json:"organization_id" api:"required"`
	// ID of the session thread this event refers to.
	SessionThreadID string                           `json:"session_thread_id" api:"required"`
	Type            constant.SessionThreadTerminated `json:"type" default:"session.thread_terminated"`
	WorkspaceID     string                           `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		OrganizationID  respjson.Field
		SessionThreadID respjson.Field
		Type            respjson.Field
		WorkspaceID     respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionThreadTerminatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionThreadTerminatedEventData) UnmarshalJSON

func (r *BetaWebhookSessionThreadTerminatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookSessionUpdatedEventData

type BetaWebhookSessionUpdatedEventData struct {
	// ID of the session that triggered the event.
	ID             string                  `json:"id" api:"required"`
	OrganizationID string                  `json:"organization_id" api:"required"`
	Type           constant.SessionUpdated `json:"type" default:"session.updated"`
	WorkspaceID    string                  `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookSessionUpdatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookSessionUpdatedEventData) UnmarshalJSON

func (r *BetaWebhookSessionUpdatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookVaultArchivedEventData

type BetaWebhookVaultArchivedEventData struct {
	// ID of the vault that triggered the event.
	ID             string                 `json:"id" api:"required"`
	OrganizationID string                 `json:"organization_id" api:"required"`
	Type           constant.VaultArchived `json:"type" default:"vault.archived"`
	WorkspaceID    string                 `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookVaultArchivedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookVaultArchivedEventData) UnmarshalJSON

func (r *BetaWebhookVaultArchivedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookVaultCreatedEventData

type BetaWebhookVaultCreatedEventData struct {
	// ID of the vault that triggered the event.
	ID             string                `json:"id" api:"required"`
	OrganizationID string                `json:"organization_id" api:"required"`
	Type           constant.VaultCreated `json:"type" default:"vault.created"`
	WorkspaceID    string                `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookVaultCreatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookVaultCreatedEventData) UnmarshalJSON

func (r *BetaWebhookVaultCreatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookVaultCredentialArchivedEventData

type BetaWebhookVaultCredentialArchivedEventData struct {
	// ID of the vault credential that triggered the event.
	ID             string                           `json:"id" api:"required"`
	OrganizationID string                           `json:"organization_id" api:"required"`
	Type           constant.VaultCredentialArchived `json:"type" default:"vault_credential.archived"`
	// ID of the vault that owns this credential.
	VaultID     string `json:"vault_id" api:"required"`
	WorkspaceID string `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		VaultID        respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookVaultCredentialArchivedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookVaultCredentialArchivedEventData) UnmarshalJSON

func (r *BetaWebhookVaultCredentialArchivedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookVaultCredentialCreatedEventData

type BetaWebhookVaultCredentialCreatedEventData struct {
	// ID of the vault credential that triggered the event.
	ID             string                          `json:"id" api:"required"`
	OrganizationID string                          `json:"organization_id" api:"required"`
	Type           constant.VaultCredentialCreated `json:"type" default:"vault_credential.created"`
	// ID of the vault that owns this credential.
	VaultID     string `json:"vault_id" api:"required"`
	WorkspaceID string `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		VaultID        respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookVaultCredentialCreatedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookVaultCredentialCreatedEventData) UnmarshalJSON

func (r *BetaWebhookVaultCredentialCreatedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookVaultCredentialDeletedEventData

type BetaWebhookVaultCredentialDeletedEventData struct {
	// ID of the vault credential that triggered the event.
	ID             string                          `json:"id" api:"required"`
	OrganizationID string                          `json:"organization_id" api:"required"`
	Type           constant.VaultCredentialDeleted `json:"type" default:"vault_credential.deleted"`
	// ID of the vault that owns this credential.
	VaultID     string `json:"vault_id" api:"required"`
	WorkspaceID string `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		VaultID        respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookVaultCredentialDeletedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookVaultCredentialDeletedEventData) UnmarshalJSON

func (r *BetaWebhookVaultCredentialDeletedEventData) UnmarshalJSON(data []byte) error

type BetaWebhookVaultCredentialRefreshFailedEventData

type BetaWebhookVaultCredentialRefreshFailedEventData struct {
	// ID of the vault credential that triggered the event.
	ID             string                                `json:"id" api:"required"`
	OrganizationID string                                `json:"organization_id" api:"required"`
	Type           constant.VaultCredentialRefreshFailed `json:"type" default:"vault_credential.refresh_failed"`
	// ID of the vault that owns this credential.
	VaultID     string `json:"vault_id" api:"required"`
	WorkspaceID string `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		VaultID        respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookVaultCredentialRefreshFailedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookVaultCredentialRefreshFailedEventData) UnmarshalJSON

type BetaWebhookVaultDeletedEventData

type BetaWebhookVaultDeletedEventData struct {
	// ID of the vault that triggered the event.
	ID             string                `json:"id" api:"required"`
	OrganizationID string                `json:"organization_id" api:"required"`
	Type           constant.VaultDeleted `json:"type" default:"vault.deleted"`
	WorkspaceID    string                `json:"workspace_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Type           respjson.Field
		WorkspaceID    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BetaWebhookVaultDeletedEventData) RawJSON

Returns the unmodified JSON received from the API

func (*BetaWebhookVaultDeletedEventData) UnmarshalJSON

func (r *BetaWebhookVaultDeletedEventData) UnmarshalJSON(data []byte) error

type BillingError

type BillingError = shared.BillingError

This is an alias to an internal type.

type CacheControlEphemeralParam

type CacheControlEphemeralParam struct {
	// The time-to-live for the cache control breakpoint.
	//
	// This may be one the following values:
	//
	// - `5m`: 5 minutes
	// - `1h`: 1 hour
	//
	// Defaults to `5m`. See
	// [prompt caching pricing](https://platform.haijun.com/docs/en/build-with-haijun/prompt-caching)
	// for details.
	//
	// Any of "5m", "1h".
	TTL  CacheControlEphemeralTTL `json:"ttl,omitzero"`
	Type constant.Ephemeral       `json:"type" default:"ephemeral"`
	// contains filtered or unexported fields
}

This struct has a constant value, construct it with NewCacheControlEphemeralParam.

func NewCacheControlEphemeralParam

func NewCacheControlEphemeralParam() CacheControlEphemeralParam

func (CacheControlEphemeralParam) MarshalJSON

func (r CacheControlEphemeralParam) MarshalJSON() (data []byte, err error)

func (*CacheControlEphemeralParam) UnmarshalJSON

func (r *CacheControlEphemeralParam) UnmarshalJSON(data []byte) error

type CacheControlEphemeralTTL

type CacheControlEphemeralTTL string

The time-to-live for the cache control breakpoint.

This may be one the following values:

- `5m`: 5 minutes - `1h`: 1 hour

Defaults to `5m`. See [prompt caching pricing](https://platform.haijun.com/docs/en/build-with-haijun/prompt-caching) for details.

const (
	CacheControlEphemeralTTLTTL5m CacheControlEphemeralTTL = "5m"
	CacheControlEphemeralTTLTTL1h CacheControlEphemeralTTL = "1h"
)

type CacheCreation

type CacheCreation struct {
	// The number of input tokens used to create the 1 hour cache entry.
	Ephemeral1hInputTokens int64 `json:"ephemeral_1h_input_tokens" api:"required"`
	// The number of input tokens used to create the 5 minute cache entry.
	Ephemeral5mInputTokens int64 `json:"ephemeral_5m_input_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Ephemeral1hInputTokens respjson.Field
		Ephemeral5mInputTokens respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CacheCreation) RawJSON

func (r CacheCreation) RawJSON() string

Returns the unmodified JSON received from the API

func (*CacheCreation) UnmarshalJSON

func (r *CacheCreation) UnmarshalJSON(data []byte) error

type CapabilitySupport

type CapabilitySupport struct {
	// Whether this capability is supported by the model.
	Supported bool `json:"supported" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Supported   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Indicates whether a capability is supported.

func (CapabilitySupport) RawJSON

func (r CapabilitySupport) RawJSON() string

Returns the unmodified JSON received from the API

func (*CapabilitySupport) UnmarshalJSON

func (r *CapabilitySupport) UnmarshalJSON(data []byte) error

type CitationCharLocation

type CitationCharLocation struct {
	CitedText      string                `json:"cited_text" api:"required"`
	DocumentIndex  int64                 `json:"document_index" api:"required"`
	DocumentTitle  string                `json:"document_title" api:"required"`
	EndCharIndex   int64                 `json:"end_char_index" api:"required"`
	FileID         string                `json:"file_id" api:"required"`
	StartCharIndex int64                 `json:"start_char_index" api:"required"`
	Type           constant.CharLocation `json:"type" default:"char_location"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText      respjson.Field
		DocumentIndex  respjson.Field
		DocumentTitle  respjson.Field
		EndCharIndex   respjson.Field
		FileID         respjson.Field
		StartCharIndex respjson.Field
		Type           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CitationCharLocation) RawJSON

func (r CitationCharLocation) RawJSON() string

Returns the unmodified JSON received from the API

func (*CitationCharLocation) UnmarshalJSON

func (r *CitationCharLocation) UnmarshalJSON(data []byte) error

type CitationCharLocationParam

type CitationCharLocationParam struct {
	DocumentTitle  param.Opt[string] `json:"document_title,omitzero" api:"required"`
	CitedText      string            `json:"cited_text" api:"required"`
	DocumentIndex  int64             `json:"document_index" api:"required"`
	EndCharIndex   int64             `json:"end_char_index" api:"required"`
	StartCharIndex int64             `json:"start_char_index" api:"required"`
	// This field can be elided, and will marshal its zero value as "char_location".
	Type constant.CharLocation `json:"type" default:"char_location"`
	// contains filtered or unexported fields
}

The properties CitedText, DocumentIndex, DocumentTitle, EndCharIndex, StartCharIndex, Type are required.

func (CitationCharLocationParam) MarshalJSON

func (r CitationCharLocationParam) MarshalJSON() (data []byte, err error)

func (*CitationCharLocationParam) UnmarshalJSON

func (r *CitationCharLocationParam) UnmarshalJSON(data []byte) error

type CitationContentBlockLocation

type CitationContentBlockLocation struct {
	// The full text of the cited block range, concatenated.
	//
	// Always equals the contents of `content[start_block_index:end_block_index]`
	// joined together. The text block is the minimal citable unit; this field is never
	// a substring of a single block. Not counted toward output tokens, and not counted
	// toward input tokens when sent back in subsequent turns.
	CitedText     string `json:"cited_text" api:"required"`
	DocumentIndex int64  `json:"document_index" api:"required"`
	DocumentTitle string `json:"document_title" api:"required"`
	// Exclusive 0-based end index of the cited block range in the source's `content`
	// array.
	//
	// Always greater than `start_block_index`; a single-block citation has
	// `end_block_index = start_block_index + 1`.
	EndBlockIndex int64  `json:"end_block_index" api:"required"`
	FileID        string `json:"file_id" api:"required"`
	// 0-based index of the first cited block in the source's `content` array.
	StartBlockIndex int64                         `json:"start_block_index" api:"required"`
	Type            constant.ContentBlockLocation `json:"type" default:"content_block_location"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText       respjson.Field
		DocumentIndex   respjson.Field
		DocumentTitle   respjson.Field
		EndBlockIndex   respjson.Field
		FileID          respjson.Field
		StartBlockIndex respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CitationContentBlockLocation) RawJSON

Returns the unmodified JSON received from the API

func (*CitationContentBlockLocation) UnmarshalJSON

func (r *CitationContentBlockLocation) UnmarshalJSON(data []byte) error

type CitationContentBlockLocationParam

type CitationContentBlockLocationParam struct {
	DocumentTitle param.Opt[string] `json:"document_title,omitzero" api:"required"`
	// The full text of the cited block range, concatenated.
	//
	// Always equals the contents of `content[start_block_index:end_block_index]`
	// joined together. The text block is the minimal citable unit; this field is never
	// a substring of a single block. Not counted toward output tokens, and not counted
	// toward input tokens when sent back in subsequent turns.
	CitedText     string `json:"cited_text" api:"required"`
	DocumentIndex int64  `json:"document_index" api:"required"`
	// Exclusive 0-based end index of the cited block range in the source's `content`
	// array.
	//
	// Always greater than `start_block_index`; a single-block citation has
	// `end_block_index = start_block_index + 1`.
	EndBlockIndex int64 `json:"end_block_index" api:"required"`
	// 0-based index of the first cited block in the source's `content` array.
	StartBlockIndex int64 `json:"start_block_index" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "content_block_location".
	Type constant.ContentBlockLocation `json:"type" default:"content_block_location"`
	// contains filtered or unexported fields
}

The properties CitedText, DocumentIndex, DocumentTitle, EndBlockIndex, StartBlockIndex, Type are required.

func (CitationContentBlockLocationParam) MarshalJSON

func (r CitationContentBlockLocationParam) MarshalJSON() (data []byte, err error)

func (*CitationContentBlockLocationParam) UnmarshalJSON

func (r *CitationContentBlockLocationParam) UnmarshalJSON(data []byte) error

type CitationPageLocation

type CitationPageLocation struct {
	CitedText       string                `json:"cited_text" api:"required"`
	DocumentIndex   int64                 `json:"document_index" api:"required"`
	DocumentTitle   string                `json:"document_title" api:"required"`
	EndPageNumber   int64                 `json:"end_page_number" api:"required"`
	FileID          string                `json:"file_id" api:"required"`
	StartPageNumber int64                 `json:"start_page_number" api:"required"`
	Type            constant.PageLocation `json:"type" default:"page_location"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText       respjson.Field
		DocumentIndex   respjson.Field
		DocumentTitle   respjson.Field
		EndPageNumber   respjson.Field
		FileID          respjson.Field
		StartPageNumber respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CitationPageLocation) RawJSON

func (r CitationPageLocation) RawJSON() string

Returns the unmodified JSON received from the API

func (*CitationPageLocation) UnmarshalJSON

func (r *CitationPageLocation) UnmarshalJSON(data []byte) error

type CitationPageLocationParam

type CitationPageLocationParam struct {
	DocumentTitle   param.Opt[string] `json:"document_title,omitzero" api:"required"`
	CitedText       string            `json:"cited_text" api:"required"`
	DocumentIndex   int64             `json:"document_index" api:"required"`
	EndPageNumber   int64             `json:"end_page_number" api:"required"`
	StartPageNumber int64             `json:"start_page_number" api:"required"`
	// This field can be elided, and will marshal its zero value as "page_location".
	Type constant.PageLocation `json:"type" default:"page_location"`
	// contains filtered or unexported fields
}

The properties CitedText, DocumentIndex, DocumentTitle, EndPageNumber, StartPageNumber, Type are required.

func (CitationPageLocationParam) MarshalJSON

func (r CitationPageLocationParam) MarshalJSON() (data []byte, err error)

func (*CitationPageLocationParam) UnmarshalJSON

func (r *CitationPageLocationParam) UnmarshalJSON(data []byte) error

type CitationSearchResultLocationParam

type CitationSearchResultLocationParam struct {
	Title param.Opt[string] `json:"title,omitzero" api:"required"`
	// The full text of the cited block range, concatenated.
	//
	// Always equals the contents of `content[start_block_index:end_block_index]`
	// joined together. The text block is the minimal citable unit; this field is never
	// a substring of a single block. Not counted toward output tokens, and not counted
	// toward input tokens when sent back in subsequent turns.
	CitedText string `json:"cited_text" api:"required"`
	// Exclusive 0-based end index of the cited block range in the source's `content`
	// array.
	//
	// Always greater than `start_block_index`; a single-block citation has
	// `end_block_index = start_block_index + 1`.
	EndBlockIndex int64 `json:"end_block_index" api:"required"`
	// 0-based index of the cited search result among all `search_result` content
	// blocks in the request, in the order they appear across messages and tool
	// results.
	//
	// Counted separately from `document_index`; server-side web search results are not
	// included in this count.
	SearchResultIndex int64  `json:"search_result_index" api:"required"`
	Source            string `json:"source" api:"required"`
	// 0-based index of the first cited block in the source's `content` array.
	StartBlockIndex int64 `json:"start_block_index" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "search_result_location".
	Type constant.SearchResultLocation `json:"type" default:"search_result_location"`
	// contains filtered or unexported fields
}

The properties CitedText, EndBlockIndex, SearchResultIndex, Source, StartBlockIndex, Title, Type are required.

func (CitationSearchResultLocationParam) MarshalJSON

func (r CitationSearchResultLocationParam) MarshalJSON() (data []byte, err error)

func (*CitationSearchResultLocationParam) UnmarshalJSON

func (r *CitationSearchResultLocationParam) UnmarshalJSON(data []byte) error

type CitationWebSearchResultLocationParam

type CitationWebSearchResultLocationParam struct {
	Title          param.Opt[string] `json:"title,omitzero" api:"required"`
	CitedText      string            `json:"cited_text" api:"required"`
	EncryptedIndex string            `json:"encrypted_index" api:"required"`
	URL            string            `json:"url" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_result_location".
	Type constant.WebSearchResultLocation `json:"type" default:"web_search_result_location"`
	// contains filtered or unexported fields
}

The properties CitedText, EncryptedIndex, Title, Type, URL are required.

func (CitationWebSearchResultLocationParam) MarshalJSON

func (r CitationWebSearchResultLocationParam) MarshalJSON() (data []byte, err error)

func (*CitationWebSearchResultLocationParam) UnmarshalJSON

func (r *CitationWebSearchResultLocationParam) UnmarshalJSON(data []byte) error

type CitationsConfig

type CitationsConfig struct {
	Enabled bool `json:"enabled" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CitationsConfig) RawJSON

func (r CitationsConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*CitationsConfig) UnmarshalJSON

func (r *CitationsConfig) UnmarshalJSON(data []byte) error

type CitationsConfigParam

type CitationsConfigParam struct {
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

func (CitationsConfigParam) MarshalJSON

func (r CitationsConfigParam) MarshalJSON() (data []byte, err error)

func (*CitationsConfigParam) UnmarshalJSON

func (r *CitationsConfigParam) UnmarshalJSON(data []byte) error

type CitationsDelta

type CitationsDelta struct {
	Citation CitationsDeltaCitationUnion `json:"citation" api:"required"`
	Type     constant.CitationsDelta     `json:"type" default:"citations_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Citation    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CitationsDelta) RawJSON

func (r CitationsDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*CitationsDelta) UnmarshalJSON

func (r *CitationsDelta) UnmarshalJSON(data []byte) error

type CitationsDeltaCitationUnion

type CitationsDeltaCitationUnion struct {
	CitedText     string `json:"cited_text"`
	DocumentIndex int64  `json:"document_index"`
	DocumentTitle string `json:"document_title"`
	// This field is from variant [CitationCharLocation].
	EndCharIndex int64  `json:"end_char_index"`
	FileID       string `json:"file_id"`
	// This field is from variant [CitationCharLocation].
	StartCharIndex int64 `json:"start_char_index"`
	// Any of "char_location", "page_location", "content_block_location",
	// "web_search_result_location", "search_result_location".
	Type string `json:"type"`
	// This field is from variant [CitationPageLocation].
	EndPageNumber int64 `json:"end_page_number"`
	// This field is from variant [CitationPageLocation].
	StartPageNumber int64 `json:"start_page_number"`
	EndBlockIndex   int64 `json:"end_block_index"`
	StartBlockIndex int64 `json:"start_block_index"`
	// This field is from variant [CitationsWebSearchResultLocation].
	EncryptedIndex string `json:"encrypted_index"`
	Title          string `json:"title"`
	// This field is from variant [CitationsWebSearchResultLocation].
	URL string `json:"url"`
	// This field is from variant [CitationsSearchResultLocation].
	SearchResultIndex int64 `json:"search_result_index"`
	// This field is from variant [CitationsSearchResultLocation].
	Source string `json:"source"`
	JSON   struct {
		CitedText         respjson.Field
		DocumentIndex     respjson.Field
		DocumentTitle     respjson.Field
		EndCharIndex      respjson.Field
		FileID            respjson.Field
		StartCharIndex    respjson.Field
		Type              respjson.Field
		EndPageNumber     respjson.Field
		StartPageNumber   respjson.Field
		EndBlockIndex     respjson.Field
		StartBlockIndex   respjson.Field
		EncryptedIndex    respjson.Field
		Title             respjson.Field
		URL               respjson.Field
		SearchResultIndex respjson.Field
		Source            respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CitationsDeltaCitationUnion contains all possible properties and values from CitationCharLocation, CitationPageLocation, CitationContentBlockLocation, CitationsWebSearchResultLocation, CitationsSearchResultLocation.

Use the CitationsDeltaCitationUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (CitationsDeltaCitationUnion) AsAny

func (u CitationsDeltaCitationUnion) AsAny() anyCitationsDeltaCitation

Use the following switch statement to find the correct variant

switch variant := CitationsDeltaCitationUnion.AsAny().(type) {
case Juglow.CitationCharLocation:
case Juglow.CitationPageLocation:
case Juglow.CitationContentBlockLocation:
case Juglow.CitationsWebSearchResultLocation:
case Juglow.CitationsSearchResultLocation:
default:
  fmt.Errorf("no variant present")
}

func (CitationsDeltaCitationUnion) AsCharLocation

func (u CitationsDeltaCitationUnion) AsCharLocation() (v CitationCharLocation)

func (CitationsDeltaCitationUnion) AsContentBlockLocation

func (u CitationsDeltaCitationUnion) AsContentBlockLocation() (v CitationContentBlockLocation)

func (CitationsDeltaCitationUnion) AsPageLocation

func (u CitationsDeltaCitationUnion) AsPageLocation() (v CitationPageLocation)

func (CitationsDeltaCitationUnion) AsSearchResultLocation

func (u CitationsDeltaCitationUnion) AsSearchResultLocation() (v CitationsSearchResultLocation)

func (CitationsDeltaCitationUnion) AsWebSearchResultLocation

func (u CitationsDeltaCitationUnion) AsWebSearchResultLocation() (v CitationsWebSearchResultLocation)

func (CitationsDeltaCitationUnion) RawJSON

func (u CitationsDeltaCitationUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*CitationsDeltaCitationUnion) UnmarshalJSON

func (r *CitationsDeltaCitationUnion) UnmarshalJSON(data []byte) error

type CitationsSearchResultLocation

type CitationsSearchResultLocation struct {
	// The full text of the cited block range, concatenated.
	//
	// Always equals the contents of `content[start_block_index:end_block_index]`
	// joined together. The text block is the minimal citable unit; this field is never
	// a substring of a single block. Not counted toward output tokens, and not counted
	// toward input tokens when sent back in subsequent turns.
	CitedText string `json:"cited_text" api:"required"`
	// Exclusive 0-based end index of the cited block range in the source's `content`
	// array.
	//
	// Always greater than `start_block_index`; a single-block citation has
	// `end_block_index = start_block_index + 1`.
	EndBlockIndex int64 `json:"end_block_index" api:"required"`
	// 0-based index of the cited search result among all `search_result` content
	// blocks in the request, in the order they appear across messages and tool
	// results.
	//
	// Counted separately from `document_index`; server-side web search results are not
	// included in this count.
	SearchResultIndex int64  `json:"search_result_index" api:"required"`
	Source            string `json:"source" api:"required"`
	// 0-based index of the first cited block in the source's `content` array.
	StartBlockIndex int64                         `json:"start_block_index" api:"required"`
	Title           string                        `json:"title" api:"required"`
	Type            constant.SearchResultLocation `json:"type" default:"search_result_location"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText         respjson.Field
		EndBlockIndex     respjson.Field
		SearchResultIndex respjson.Field
		Source            respjson.Field
		StartBlockIndex   respjson.Field
		Title             respjson.Field
		Type              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CitationsSearchResultLocation) RawJSON

Returns the unmodified JSON received from the API

func (*CitationsSearchResultLocation) UnmarshalJSON

func (r *CitationsSearchResultLocation) UnmarshalJSON(data []byte) error

type CitationsWebSearchResultLocation

type CitationsWebSearchResultLocation struct {
	CitedText      string                           `json:"cited_text" api:"required"`
	EncryptedIndex string                           `json:"encrypted_index" api:"required"`
	Title          string                           `json:"title" api:"required"`
	Type           constant.WebSearchResultLocation `json:"type" default:"web_search_result_location"`
	URL            string                           `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CitedText      respjson.Field
		EncryptedIndex respjson.Field
		Title          respjson.Field
		Type           respjson.Field
		URL            respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CitationsWebSearchResultLocation) RawJSON

Returns the unmodified JSON received from the API

func (*CitationsWebSearchResultLocation) UnmarshalJSON

func (r *CitationsWebSearchResultLocation) UnmarshalJSON(data []byte) error

type Client

type Client struct {
	Options     []option.RequestOption
	Completions CompletionService
	Messages    MessageService
	Models      ModelService
	Beta        BetaService
}

Client creates a struct with services and top level methods that help with interacting with the Juglow 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 (Juglow_API_KEY, Juglow_WEBHOOK_SIGNING_KEY, Juglow_AUTH_TOKEN, Juglow_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.

Pass option.WithoutEnvironmentDefaults to skip the environment-based credential autoload entirely (only the hardcoded production base-URL default is kept). Use this when the caller does its own credential resolution and wants the SDK to contribute nothing from the environment.

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.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type CodeExecutionOutputBlock

type CodeExecutionOutputBlock struct {
	FileID string                       `json:"file_id" api:"required"`
	Type   constant.CodeExecutionOutput `json:"type" default:"code_execution_output"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CodeExecutionOutputBlock) RawJSON

func (r CodeExecutionOutputBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (CodeExecutionOutputBlock) ToParam

func (*CodeExecutionOutputBlock) UnmarshalJSON

func (r *CodeExecutionOutputBlock) UnmarshalJSON(data []byte) error

type CodeExecutionOutputBlockParam

type CodeExecutionOutputBlockParam struct {
	FileID string `json:"file_id" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_output".
	Type constant.CodeExecutionOutput `json:"type" default:"code_execution_output"`
	// contains filtered or unexported fields
}

The properties FileID, Type are required.

func (CodeExecutionOutputBlockParam) MarshalJSON

func (r CodeExecutionOutputBlockParam) MarshalJSON() (data []byte, err error)

func (*CodeExecutionOutputBlockParam) UnmarshalJSON

func (r *CodeExecutionOutputBlockParam) UnmarshalJSON(data []byte) error

type CodeExecutionResultBlock

type CodeExecutionResultBlock struct {
	Content    []CodeExecutionOutputBlock   `json:"content" api:"required"`
	ReturnCode int64                        `json:"return_code" api:"required"`
	Stderr     string                       `json:"stderr" api:"required"`
	Stdout     string                       `json:"stdout" api:"required"`
	Type       constant.CodeExecutionResult `json:"type" default:"code_execution_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ReturnCode  respjson.Field
		Stderr      respjson.Field
		Stdout      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CodeExecutionResultBlock) RawJSON

func (r CodeExecutionResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (*CodeExecutionResultBlock) UnmarshalJSON

func (r *CodeExecutionResultBlock) UnmarshalJSON(data []byte) error

type CodeExecutionResultBlockParam

type CodeExecutionResultBlockParam struct {
	Content    []CodeExecutionOutputBlockParam `json:"content,omitzero" api:"required"`
	ReturnCode int64                           `json:"return_code" api:"required"`
	Stderr     string                          `json:"stderr" api:"required"`
	Stdout     string                          `json:"stdout" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_result".
	Type constant.CodeExecutionResult `json:"type" default:"code_execution_result"`
	// contains filtered or unexported fields
}

The properties Content, ReturnCode, Stderr, Stdout, Type are required.

func (CodeExecutionResultBlockParam) MarshalJSON

func (r CodeExecutionResultBlockParam) MarshalJSON() (data []byte, err error)

func (*CodeExecutionResultBlockParam) UnmarshalJSON

func (r *CodeExecutionResultBlockParam) UnmarshalJSON(data []byte) error

type CodeExecutionTool20250522Param

type CodeExecutionTool20250522Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "code_execution".
	Name constant.CodeExecution `json:"name" default:"code_execution"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20250522".
	Type constant.CodeExecution20250522 `json:"type" default:"code_execution_20250522"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (CodeExecutionTool20250522Param) MarshalJSON

func (r CodeExecutionTool20250522Param) MarshalJSON() (data []byte, err error)

func (*CodeExecutionTool20250522Param) UnmarshalJSON

func (r *CodeExecutionTool20250522Param) UnmarshalJSON(data []byte) error

type CodeExecutionTool20250825Param

type CodeExecutionTool20250825Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "code_execution".
	Name constant.CodeExecution `json:"name" default:"code_execution"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20250825".
	Type constant.CodeExecution20250825 `json:"type" default:"code_execution_20250825"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (CodeExecutionTool20250825Param) MarshalJSON

func (r CodeExecutionTool20250825Param) MarshalJSON() (data []byte, err error)

func (*CodeExecutionTool20250825Param) UnmarshalJSON

func (r *CodeExecutionTool20250825Param) UnmarshalJSON(data []byte) error

type CodeExecutionTool20260120Param

type CodeExecutionTool20260120Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "code_execution".
	Name constant.CodeExecution `json:"name" default:"code_execution"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20260120".
	Type constant.CodeExecution20260120 `json:"type" default:"code_execution_20260120"`
	// contains filtered or unexported fields
}

Code execution tool with REPL state persistence (daemon mode + gVisor checkpoint).

The properties Name, Type are required.

func (CodeExecutionTool20260120Param) MarshalJSON

func (r CodeExecutionTool20260120Param) MarshalJSON() (data []byte, err error)

func (*CodeExecutionTool20260120Param) UnmarshalJSON

func (r *CodeExecutionTool20260120Param) UnmarshalJSON(data []byte) error

type CodeExecutionTool20260521Param

type CodeExecutionTool20260521Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "code_execution".
	Name constant.CodeExecution `json:"name" default:"code_execution"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20260521".
	Type constant.CodeExecution20260521 `json:"type" default:"code_execution_20260521"`
	// contains filtered or unexported fields
}

Code execution tool with REPL state persistence.

The properties Name, Type are required.

func (CodeExecutionTool20260521Param) MarshalJSON

func (r CodeExecutionTool20260521Param) MarshalJSON() (data []byte, err error)

func (*CodeExecutionTool20260521Param) UnmarshalJSON

func (r *CodeExecutionTool20260521Param) UnmarshalJSON(data []byte) error

type CodeExecutionToolResultBlock

type CodeExecutionToolResultBlock struct {
	// Code execution result with encrypted stdout for PFC + web_search results.
	Content   CodeExecutionToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                   `json:"tool_use_id" api:"required"`
	Type      constant.CodeExecutionToolResult         `json:"type" default:"code_execution_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CodeExecutionToolResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (CodeExecutionToolResultBlock) ToParam

func (*CodeExecutionToolResultBlock) UnmarshalJSON

func (r *CodeExecutionToolResultBlock) UnmarshalJSON(data []byte) error

type CodeExecutionToolResultBlockContentUnion

type CodeExecutionToolResultBlockContentUnion struct {
	// This field is from variant [CodeExecutionToolResultError].
	ErrorCode  CodeExecutionToolResultErrorCode `json:"error_code"`
	Type       string                           `json:"type"`
	Content    []CodeExecutionOutputBlock       `json:"content"`
	ReturnCode int64                            `json:"return_code"`
	Stderr     string                           `json:"stderr"`
	// This field is from variant [CodeExecutionResultBlock].
	Stdout string `json:"stdout"`
	// This field is from variant [EncryptedCodeExecutionResultBlock].
	EncryptedStdout string `json:"encrypted_stdout"`
	JSON            struct {
		ErrorCode       respjson.Field
		Type            respjson.Field
		Content         respjson.Field
		ReturnCode      respjson.Field
		Stderr          respjson.Field
		Stdout          respjson.Field
		EncryptedStdout respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CodeExecutionToolResultBlockContentUnion contains all possible properties and values from CodeExecutionToolResultError, CodeExecutionResultBlock, EncryptedCodeExecutionResultBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (CodeExecutionToolResultBlockContentUnion) AsResponseCodeExecutionResultBlock

func (u CodeExecutionToolResultBlockContentUnion) AsResponseCodeExecutionResultBlock() (v CodeExecutionResultBlock)

func (CodeExecutionToolResultBlockContentUnion) AsResponseCodeExecutionToolResultError

func (u CodeExecutionToolResultBlockContentUnion) AsResponseCodeExecutionToolResultError() (v CodeExecutionToolResultError)

func (CodeExecutionToolResultBlockContentUnion) AsResponseEncryptedCodeExecutionResultBlock

func (u CodeExecutionToolResultBlockContentUnion) AsResponseEncryptedCodeExecutionResultBlock() (v EncryptedCodeExecutionResultBlock)

func (CodeExecutionToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*CodeExecutionToolResultBlockContentUnion) UnmarshalJSON

func (r *CodeExecutionToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type CodeExecutionToolResultBlockParam

type CodeExecutionToolResultBlockParam struct {
	// Code execution result with encrypted stdout for PFC + web_search results.
	Content   CodeExecutionToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                        `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_tool_result".
	Type constant.CodeExecutionToolResult `json:"type" default:"code_execution_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (CodeExecutionToolResultBlockParam) MarshalJSON

func (r CodeExecutionToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*CodeExecutionToolResultBlockParam) UnmarshalJSON

func (r *CodeExecutionToolResultBlockParam) UnmarshalJSON(data []byte) error

type CodeExecutionToolResultBlockParamContentUnion

type CodeExecutionToolResultBlockParamContentUnion struct {
	OfRequestCodeExecutionToolResultError      *CodeExecutionToolResultErrorParam      `json:",omitzero,inline"`
	OfRequestCodeExecutionResultBlock          *CodeExecutionResultBlockParam          `json:",omitzero,inline"`
	OfRequestEncryptedCodeExecutionResultBlock *EncryptedCodeExecutionResultBlockParam `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 CodeExecutionToolResultBlockParamContentOfRequestCodeExecutionToolResultError

func CodeExecutionToolResultBlockParamContentOfRequestCodeExecutionToolResultError(errorCode CodeExecutionToolResultErrorCode) CodeExecutionToolResultBlockParamContentUnion

func (CodeExecutionToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's Content property, if present.

func (CodeExecutionToolResultBlockParamContentUnion) GetEncryptedStdout

func (u CodeExecutionToolResultBlockParamContentUnion) GetEncryptedStdout() *string

Returns a pointer to the underlying variant's property, if present.

func (CodeExecutionToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (CodeExecutionToolResultBlockParamContentUnion) GetReturnCode

Returns a pointer to the underlying variant's property, if present.

func (CodeExecutionToolResultBlockParamContentUnion) GetStderr

Returns a pointer to the underlying variant's property, if present.

func (CodeExecutionToolResultBlockParamContentUnion) GetStdout

Returns a pointer to the underlying variant's property, if present.

func (CodeExecutionToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (CodeExecutionToolResultBlockParamContentUnion) MarshalJSON

func (*CodeExecutionToolResultBlockParamContentUnion) UnmarshalJSON

func (u *CodeExecutionToolResultBlockParamContentUnion) UnmarshalJSON(data []byte) error

type CodeExecutionToolResultError

type CodeExecutionToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded".
	ErrorCode CodeExecutionToolResultErrorCode      `json:"error_code" api:"required"`
	Type      constant.CodeExecutionToolResultError `json:"type" default:"code_execution_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CodeExecutionToolResultError) RawJSON

Returns the unmodified JSON received from the API

func (*CodeExecutionToolResultError) UnmarshalJSON

func (r *CodeExecutionToolResultError) UnmarshalJSON(data []byte) error

type CodeExecutionToolResultErrorCode

type CodeExecutionToolResultErrorCode string
const (
	CodeExecutionToolResultErrorCodeInvalidToolInput      CodeExecutionToolResultErrorCode = "invalid_tool_input"
	CodeExecutionToolResultErrorCodeUnavailable           CodeExecutionToolResultErrorCode = "unavailable"
	CodeExecutionToolResultErrorCodeTooManyRequests       CodeExecutionToolResultErrorCode = "too_many_requests"
	CodeExecutionToolResultErrorCodeExecutionTimeExceeded CodeExecutionToolResultErrorCode = "execution_time_exceeded"
)

type CodeExecutionToolResultErrorParam

type CodeExecutionToolResultErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded".
	ErrorCode CodeExecutionToolResultErrorCode `json:"error_code,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_tool_result_error".
	Type constant.CodeExecutionToolResultError `json:"type" default:"code_execution_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (CodeExecutionToolResultErrorParam) MarshalJSON

func (r CodeExecutionToolResultErrorParam) MarshalJSON() (data []byte, err error)

func (*CodeExecutionToolResultErrorParam) UnmarshalJSON

func (r *CodeExecutionToolResultErrorParam) UnmarshalJSON(data []byte) error

type Completion

type Completion struct {
	// Unique object identifier.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// The resulting completion up to and excluding the stop sequences.
	Completion string `json:"completion" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model" api:"required"`
	// The reason that we stopped.
	//
	// This may be one the following values:
	//
	//   - `"stop_sequence"`: we reached a stop sequence — either provided by you via the
	//     `stop_sequences` parameter, or a stop sequence built into the model
	//   - `"max_tokens"`: we exceeded `max_tokens_to_sample` or the model's maximum
	StopReason string `json:"stop_reason" api:"required"`
	// Object type.
	//
	// For Text Completions, this is always `"completion"`.
	Type constant.Completion `json:"type" default:"completion"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Completion  respjson.Field
		Model       respjson.Field
		StopReason  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Completion) RawJSON

func (r Completion) RawJSON() string

Returns the unmodified JSON received from the API

func (*Completion) UnmarshalJSON

func (r *Completion) UnmarshalJSON(data []byte) error

type CompletionNewParams

type CompletionNewParams struct {
	// The maximum number of tokens to generate before stopping.
	//
	// Note that our models may stop _before_ reaching this maximum. This parameter
	// only specifies the absolute maximum number of tokens to generate.
	MaxTokensToSample int64 `json:"max_tokens_to_sample" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model,omitzero" api:"required"`
	// The prompt that you want haijun to complete.
	//
	// For proper response generation you will need to format your prompt using
	// alternating `\n\nHuman:` and `\n\nAssistant:` conversational turns. For example:
	//
	// “`
	// "\n\nHuman: {userQuestion}\n\nAssistant:"
	// “`
	//
	// See
	// [prompt validation](https://platform.haijun.com/docs/en/build-with-haijun/working-with-messages)
	// and our guide to
	// [prompt design](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/overview)
	// for more details.
	Prompt string `json:"prompt" api:"required"`
	// Amount of randomness injected into the response.
	//
	// Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
	// for analytical / multiple choice, and closer to `1.0` for creative and
	// generative tasks.
	//
	// Note that even with `temperature` of `0.0`, the results will not be fully
	// deterministic.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Only sample from the top K options for each subsequent token.
	//
	// Used to remove "long tail" low probability responses.
	// [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
	//
	// Recommended for advanced use cases only.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// Use nucleus sampling.
	//
	// In nucleus sampling, we compute the cumulative distribution over all the options
	// for each subsequent token in decreasing probability order and cut it off once it
	// reaches a particular probability specified by `top_p`.
	//
	// Recommended for advanced use cases only.
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// An object describing metadata about the request.
	Metadata MetadataParam `json:"metadata,omitzero"`
	// Sequences that will cause the model to stop generating.
	//
	// Our models stop on `"\n\nHuman:"`, and may include additional built-in stop
	// sequences in the future. By providing the stop_sequences parameter, you may
	// include additional strings that will cause the model to stop generating.
	StopSequences []string `json:"stop_sequences,omitzero"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CompletionNewParams) MarshalJSON

func (r CompletionNewParams) MarshalJSON() (data []byte, err error)

func (*CompletionNewParams) UnmarshalJSON

func (r *CompletionNewParams) UnmarshalJSON(data []byte) error

type CompletionService

type CompletionService struct {
	Options []option.RequestOption
}

CompletionService contains methods and other services that help with interacting with the Juglow 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 NewCompletionService method instead.

func NewCompletionService

func NewCompletionService(opts ...option.RequestOption) (r CompletionService)

NewCompletionService 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 (*CompletionService) New

func (r *CompletionService) New(ctx context.Context, params CompletionNewParams, opts ...option.RequestOption) (res *Completion, err error)

[Legacy] Create a Text Completion.

The Text Completions API is a legacy API. We recommend using the [Messages API](https://platform.haijun.com/docs/en/api/messages) going forward.

Future models and features will not be compatible with Text Completions. See our [migration guide](https://platform.haijun.com/docs/en/build-with-haijun/working-with-messages) for guidance in migrating from Text Completions to Messages.

Note: If you choose to set a timeout for this request, we recommend 10 minutes.

func (*CompletionService) NewStreaming

func (r *CompletionService) NewStreaming(ctx context.Context, params CompletionNewParams, opts ...option.RequestOption) (stream *ssestream.Stream[Completion])

[Legacy] Create a Text Completion.

The Text Completions API is a legacy API. We recommend using the [Messages API](https://platform.haijun.com/docs/en/api/messages) going forward.

Future models and features will not be compatible with Text Completions. See our [migration guide](https://platform.haijun.com/docs/en/build-with-haijun/working-with-messages) for guidance in migrating from Text Completions to Messages.

Note: If you choose to set a timeout for this request, we recommend 10 minutes.

type Container

type Container struct {
	// Identifier for the container used in this request
	ID string `json:"id" api:"required"`
	// The time at which the container will expire.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExpiresAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about the container used in the request (for the code execution tool)

func (Container) RawJSON

func (r Container) RawJSON() string

Returns the unmodified JSON received from the API

func (*Container) UnmarshalJSON

func (r *Container) UnmarshalJSON(data []byte) error

type ContainerUploadBlock

type ContainerUploadBlock struct {
	FileID string                   `json:"file_id" api:"required"`
	Type   constant.ContainerUpload `json:"type" default:"container_upload"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FileID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response model for a file uploaded to the container.

func (ContainerUploadBlock) RawJSON

func (r ContainerUploadBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (ContainerUploadBlock) ToParam

func (*ContainerUploadBlock) UnmarshalJSON

func (r *ContainerUploadBlock) UnmarshalJSON(data []byte) error

type ContainerUploadBlockParam

type ContainerUploadBlockParam struct {
	FileID string `json:"file_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "container_upload".
	Type constant.ContainerUpload `json:"type" default:"container_upload"`
	// contains filtered or unexported fields
}

A content block that represents a file to be uploaded to the container Files uploaded via this block will be available in the container's input directory.

The properties FileID, Type are required.

func (ContainerUploadBlockParam) MarshalJSON

func (r ContainerUploadBlockParam) MarshalJSON() (data []byte, err error)

func (*ContainerUploadBlockParam) UnmarshalJSON

func (r *ContainerUploadBlockParam) UnmarshalJSON(data []byte) error

type ContentBlockDeltaEvent

type ContentBlockDeltaEvent struct {
	Delta RawContentBlockDeltaUnion  `json:"delta" api:"required"`
	Index int64                      `json:"index" api:"required"`
	Type  constant.ContentBlockDelta `json:"type" default:"content_block_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Delta       respjson.Field
		Index       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ContentBlockDeltaEvent) RawJSON

func (r ContentBlockDeltaEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContentBlockDeltaEvent) UnmarshalJSON

func (r *ContentBlockDeltaEvent) UnmarshalJSON(data []byte) error

type ContentBlockParamUnion

type ContentBlockParamUnion struct {
	OfText                              *TextBlockParam                              `json:",omitzero,inline"`
	OfImage                             *ImageBlockParam                             `json:",omitzero,inline"`
	OfDocument                          *DocumentBlockParam                          `json:",omitzero,inline"`
	OfSearchResult                      *SearchResultBlockParam                      `json:",omitzero,inline"`
	OfThinking                          *ThinkingBlockParam                          `json:",omitzero,inline"`
	OfRedactedThinking                  *RedactedThinkingBlockParam                  `json:",omitzero,inline"`
	OfToolUse                           *ToolUseBlockParam                           `json:",omitzero,inline"`
	OfToolResult                        *ToolResultBlockParam                        `json:",omitzero,inline"`
	OfServerToolUse                     *ServerToolUseBlockParam                     `json:",omitzero,inline"`
	OfWebSearchToolResult               *WebSearchToolResultBlockParam               `json:",omitzero,inline"`
	OfWebFetchToolResult                *WebFetchToolResultBlockParam                `json:",omitzero,inline"`
	OfCodeExecutionToolResult           *CodeExecutionToolResultBlockParam           `json:",omitzero,inline"`
	OfBashCodeExecutionToolResult       *BashCodeExecutionToolResultBlockParam       `json:",omitzero,inline"`
	OfTextEditorCodeExecutionToolResult *TextEditorCodeExecutionToolResultBlockParam `json:",omitzero,inline"`
	OfToolSearchToolResult              *ToolSearchToolResultBlockParam              `json:",omitzero,inline"`
	OfContainerUpload                   *ContainerUploadBlockParam                   `json:",omitzero,inline"`
	OfMidConvSystem                     *MidConversationSystemBlockParam             `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 NewContainerUploadBlock

func NewContainerUploadBlock(fileID string) ContentBlockParamUnion

func NewImageBlockBase64

func NewImageBlockBase64(mediaType string, encodedData string) ContentBlockParamUnion

func NewMidConvSystemBlock

func NewMidConvSystemBlock(content []TextBlockParam) ContentBlockParamUnion

func NewRedactedThinkingBlock

func NewRedactedThinkingBlock(data string) ContentBlockParamUnion

func NewSearchResultBlock

func NewSearchResultBlock(content []TextBlockParam, source string, title string) ContentBlockParamUnion

func NewServerToolUseBlock

func NewServerToolUseBlock(id string, input any, name ServerToolUseBlockParamName) ContentBlockParamUnion

func NewTextBlock

func NewTextBlock(text string) ContentBlockParamUnion

func NewThinkingBlock

func NewThinkingBlock(signature string, thinking string) ContentBlockParamUnion

func NewToolResultBlock

func NewToolResultBlock(toolUseID string, content string, isError bool) ContentBlockParamUnion

func NewToolUseBlock

func NewToolUseBlock(id string, input any, name string) ContentBlockParamUnion

func NewWebFetchToolResultBlock

func NewWebFetchToolResultBlock[
	T WebFetchToolResultErrorBlockParam | WebFetchBlockParam,
](content T, toolUseID string) ContentBlockParamUnion

func NewWebSearchToolResultBlock

func NewWebSearchToolResultBlock[
	T []WebSearchResultBlockParam | WebSearchToolRequestErrorParam,
](content T, toolUseID string) ContentBlockParamUnion

func (ContentBlockParamUnion) GetCacheControl

Returns a pointer to the underlying variant's CacheControl property, if present.

func (ContentBlockParamUnion) GetCaller

func (u ContentBlockParamUnion) GetCaller() (res contentBlockParamUnionCaller)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ContentBlockParamUnion) GetCitations

func (u ContentBlockParamUnion) GetCitations() (res contentBlockParamUnionCitations)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ContentBlockParamUnion) GetContent

func (u ContentBlockParamUnion) GetContent() (res contentBlockParamUnionContent)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ContentBlockParamUnion) GetContext

func (u ContentBlockParamUnion) GetContext() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetData

func (u ContentBlockParamUnion) GetData() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetFileID

func (u ContentBlockParamUnion) GetFileID() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetID

func (u ContentBlockParamUnion) GetID() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetInput

func (u ContentBlockParamUnion) GetInput() *any

Returns a pointer to the underlying variant's Input property, if present.

func (ContentBlockParamUnion) GetIsError

func (u ContentBlockParamUnion) GetIsError() *bool

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetName

func (u ContentBlockParamUnion) GetName() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetSignature

func (u ContentBlockParamUnion) GetSignature() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetSource

func (u ContentBlockParamUnion) GetSource() (res contentBlockParamUnionSource)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ContentBlockParamUnion) GetText

func (u ContentBlockParamUnion) GetText() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetThinking

func (u ContentBlockParamUnion) GetThinking() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetTitle

func (u ContentBlockParamUnion) GetTitle() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetToolUseID

func (u ContentBlockParamUnion) GetToolUseID() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) GetType

func (u ContentBlockParamUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockParamUnion) MarshalJSON

func (u ContentBlockParamUnion) MarshalJSON() ([]byte, error)

func (*ContentBlockParamUnion) UnmarshalJSON

func (u *ContentBlockParamUnion) UnmarshalJSON(data []byte) error

type ContentBlockSourceContentItemUnionParam

type ContentBlockSourceContentItemUnionParam struct {
	OfText  *TextBlockParam  `json:",omitzero,inline"`
	OfImage *ImageBlockParam `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 ContentBlockSourceContentItemParamOfText

func ContentBlockSourceContentItemParamOfText(text string) ContentBlockSourceContentItemUnionParam

func (ContentBlockSourceContentItemUnionParam) GetCacheControl

Returns a pointer to the underlying variant's CacheControl property, if present.

func (ContentBlockSourceContentItemUnionParam) GetCitations

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockSourceContentItemUnionParam) GetSource

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockSourceContentItemUnionParam) GetText

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockSourceContentItemUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (ContentBlockSourceContentItemUnionParam) MarshalJSON

func (u ContentBlockSourceContentItemUnionParam) MarshalJSON() ([]byte, error)

func (*ContentBlockSourceContentItemUnionParam) UnmarshalJSON

func (u *ContentBlockSourceContentItemUnionParam) UnmarshalJSON(data []byte) error

type ContentBlockSourceContentUnionParam

type ContentBlockSourceContentUnionParam struct {
	OfString                    param.Opt[string]                         `json:",omitzero,inline"`
	OfContentBlockSourceContent []ContentBlockSourceContentItemUnionParam `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 (ContentBlockSourceContentUnionParam) MarshalJSON

func (u ContentBlockSourceContentUnionParam) MarshalJSON() ([]byte, error)

func (*ContentBlockSourceContentUnionParam) UnmarshalJSON

func (u *ContentBlockSourceContentUnionParam) UnmarshalJSON(data []byte) error

type ContentBlockSourceParam

type ContentBlockSourceParam struct {
	Content ContentBlockSourceContentUnionParam `json:"content,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "content".
	Type constant.Content `json:"type" default:"content"`
	// contains filtered or unexported fields
}

The properties Content, Type are required.

func (ContentBlockSourceParam) MarshalJSON

func (r ContentBlockSourceParam) MarshalJSON() (data []byte, err error)

func (*ContentBlockSourceParam) UnmarshalJSON

func (r *ContentBlockSourceParam) UnmarshalJSON(data []byte) error

type ContentBlockStartEvent

type ContentBlockStartEvent struct {
	// Response model for a file uploaded to the container.
	ContentBlock ContentBlockStartEventContentBlockUnion `json:"content_block" api:"required"`
	Index        int64                                   `json:"index" api:"required"`
	Type         constant.ContentBlockStart              `json:"type" default:"content_block_start"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ContentBlock respjson.Field
		Index        respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ContentBlockStartEvent) RawJSON

func (r ContentBlockStartEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContentBlockStartEvent) UnmarshalJSON

func (r *ContentBlockStartEvent) UnmarshalJSON(data []byte) error

type ContentBlockStartEventContentBlockUnion

type ContentBlockStartEventContentBlockUnion struct {
	// This field is from variant [TextBlock].
	Citations []TextCitationUnion `json:"citations"`
	// This field is from variant [TextBlock].
	Text string `json:"text"`
	// Any of "text", "thinking", "redacted_thinking", "tool_use", "server_tool_use",
	// "web_search_tool_result", "web_fetch_tool_result", "code_execution_tool_result",
	// "bash_code_execution_tool_result", "text_editor_code_execution_tool_result",
	// "tool_search_tool_result", "container_upload".
	Type string `json:"type"`
	// This field is from variant [ThinkingBlock].
	Signature string `json:"signature"`
	// This field is from variant [ThinkingBlock].
	Thinking string `json:"thinking"`
	// This field is from variant [RedactedThinkingBlock].
	Data string `json:"data"`
	ID   string `json:"id"`
	// This field is a union of [ToolUseBlockCallerUnion],
	// [ServerToolUseBlockCallerUnion], [WebSearchToolResultBlockCallerUnion],
	// [WebFetchToolResultBlockCallerUnion]
	Caller ContentBlockStartEventContentBlockUnionCaller `json:"caller"`
	Input  any                                           `json:"input"`
	Name   string                                        `json:"name"`
	// This field is a union of [WebSearchToolResultBlockContentUnion],
	// [WebFetchToolResultBlockContentUnion],
	// [CodeExecutionToolResultBlockContentUnion],
	// [BashCodeExecutionToolResultBlockContentUnion],
	// [TextEditorCodeExecutionToolResultBlockContentUnion],
	// [ToolSearchToolResultBlockContentUnion]
	Content   ContentBlockStartEventContentBlockUnionContent `json:"content"`
	ToolUseID string                                         `json:"tool_use_id"`
	// This field is from variant [ContainerUploadBlock].
	FileID string `json:"file_id"`
	JSON   struct {
		Citations respjson.Field
		Text      respjson.Field
		Type      respjson.Field
		Signature respjson.Field
		Thinking  respjson.Field
		Data      respjson.Field
		ID        respjson.Field
		Caller    respjson.Field
		Input     respjson.Field
		Name      respjson.Field
		Content   respjson.Field
		ToolUseID respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ContentBlockStartEventContentBlockUnion contains all possible properties and values from TextBlock, ThinkingBlock, RedactedThinkingBlock, ToolUseBlock, ServerToolUseBlock, WebSearchToolResultBlock, WebFetchToolResultBlock, CodeExecutionToolResultBlock, BashCodeExecutionToolResultBlock, TextEditorCodeExecutionToolResultBlock, ToolSearchToolResultBlock, ContainerUploadBlock.

Use the ContentBlockStartEventContentBlockUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ContentBlockStartEventContentBlockUnion) AsAny

func (u ContentBlockStartEventContentBlockUnion) AsAny() anyContentBlockStartEventContentBlock

Use the following switch statement to find the correct variant

switch variant := ContentBlockStartEventContentBlockUnion.AsAny().(type) {
case Juglow.TextBlock:
case Juglow.ThinkingBlock:
case Juglow.RedactedThinkingBlock:
case Juglow.ToolUseBlock:
case Juglow.ServerToolUseBlock:
case Juglow.WebSearchToolResultBlock:
case Juglow.WebFetchToolResultBlock:
case Juglow.CodeExecutionToolResultBlock:
case Juglow.BashCodeExecutionToolResultBlock:
case Juglow.TextEditorCodeExecutionToolResultBlock:
case Juglow.ToolSearchToolResultBlock:
case Juglow.ContainerUploadBlock:
default:
  fmt.Errorf("no variant present")
}

func (ContentBlockStartEventContentBlockUnion) AsBashCodeExecutionToolResult

func (u ContentBlockStartEventContentBlockUnion) AsBashCodeExecutionToolResult() (v BashCodeExecutionToolResultBlock)

func (ContentBlockStartEventContentBlockUnion) AsCodeExecutionToolResult

func (ContentBlockStartEventContentBlockUnion) AsContainerUpload

func (ContentBlockStartEventContentBlockUnion) AsRedactedThinking

func (ContentBlockStartEventContentBlockUnion) AsServerToolUse

func (ContentBlockStartEventContentBlockUnion) AsText

func (ContentBlockStartEventContentBlockUnion) AsTextEditorCodeExecutionToolResult

func (u ContentBlockStartEventContentBlockUnion) AsTextEditorCodeExecutionToolResult() (v TextEditorCodeExecutionToolResultBlock)

func (ContentBlockStartEventContentBlockUnion) AsThinking

func (ContentBlockStartEventContentBlockUnion) AsToolSearchToolResult

func (ContentBlockStartEventContentBlockUnion) AsToolUse

func (ContentBlockStartEventContentBlockUnion) AsWebFetchToolResult

func (ContentBlockStartEventContentBlockUnion) AsWebSearchToolResult

func (ContentBlockStartEventContentBlockUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ContentBlockStartEventContentBlockUnion) UnmarshalJSON

func (r *ContentBlockStartEventContentBlockUnion) UnmarshalJSON(data []byte) error

type ContentBlockStartEventContentBlockUnionCaller

type ContentBlockStartEventContentBlockUnionCaller struct {
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ContentBlockStartEventContentBlockUnionCaller is an implicit subunion of ContentBlockStartEventContentBlockUnion. ContentBlockStartEventContentBlockUnionCaller provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ContentBlockStartEventContentBlockUnion.

func (*ContentBlockStartEventContentBlockUnionCaller) UnmarshalJSON

func (r *ContentBlockStartEventContentBlockUnionCaller) UnmarshalJSON(data []byte) error

type ContentBlockStartEventContentBlockUnionContent

type ContentBlockStartEventContentBlockUnionContent struct {
	// This field will be present if the value is a [[]WebSearchResultBlock] instead of
	// an object.
	OfWebSearchResultBlockArray []WebSearchResultBlock `json:",inline"`
	ErrorCode                   string                 `json:"error_code"`
	Type                        string                 `json:"type"`
	// This field is a union of [DocumentBlock], [[]CodeExecutionOutputBlock],
	// [[]CodeExecutionOutputBlock], [[]BashCodeExecutionOutputBlock], [string]
	Content ContentBlockStartEventContentBlockUnionContentContent `json:"content"`
	// This field is from variant [WebFetchToolResultBlockContentUnion].
	RetrievedAt string `json:"retrieved_at"`
	// This field is from variant [WebFetchToolResultBlockContentUnion].
	URL        string `json:"url"`
	ReturnCode int64  `json:"return_code"`
	Stderr     string `json:"stderr"`
	Stdout     string `json:"stdout"`
	// This field is from variant [CodeExecutionToolResultBlockContentUnion].
	EncryptedStdout string `json:"encrypted_stdout"`
	ErrorMessage    string `json:"error_message"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	FileType TextEditorCodeExecutionViewResultBlockFileType `json:"file_type"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	NumLines int64 `json:"num_lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	StartLine int64 `json:"start_line"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	TotalLines int64 `json:"total_lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	IsFileUpdate bool `json:"is_file_update"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	Lines []string `json:"lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	NewLines int64 `json:"new_lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	NewStart int64 `json:"new_start"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	OldLines int64 `json:"old_lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	OldStart int64 `json:"old_start"`
	// This field is from variant [ToolSearchToolResultBlockContentUnion].
	ToolReferences []ToolReferenceBlock `json:"tool_references"`
	JSON           struct {
		OfWebSearchResultBlockArray respjson.Field
		ErrorCode                   respjson.Field
		Type                        respjson.Field
		Content                     respjson.Field
		RetrievedAt                 respjson.Field
		URL                         respjson.Field
		ReturnCode                  respjson.Field
		Stderr                      respjson.Field
		Stdout                      respjson.Field
		EncryptedStdout             respjson.Field
		ErrorMessage                respjson.Field
		FileType                    respjson.Field
		NumLines                    respjson.Field
		StartLine                   respjson.Field
		TotalLines                  respjson.Field
		IsFileUpdate                respjson.Field
		Lines                       respjson.Field
		NewLines                    respjson.Field
		NewStart                    respjson.Field
		OldLines                    respjson.Field
		OldStart                    respjson.Field
		ToolReferences              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ContentBlockStartEventContentBlockUnionContent is an implicit subunion of ContentBlockStartEventContentBlockUnion. ContentBlockStartEventContentBlockUnionContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ContentBlockStartEventContentBlockUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfWebSearchResultBlockArray]

func (*ContentBlockStartEventContentBlockUnionContent) UnmarshalJSON

type ContentBlockStartEventContentBlockUnionContentContent

type ContentBlockStartEventContentBlockUnionContentContent struct {
	// This field will be present if the value is a [[]CodeExecutionOutputBlock]
	// instead of an object.
	OfContent []CodeExecutionOutputBlock `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field is from variant [DocumentBlock].
	Citations CitationsConfig `json:"citations"`
	// This field is from variant [DocumentBlock].
	Source DocumentBlockSourceUnion `json:"source"`
	// This field is from variant [DocumentBlock].
	Title string `json:"title"`
	// This field is from variant [DocumentBlock].
	Type constant.Document `json:"type"`
	JSON struct {
		OfContent respjson.Field
		OfString  respjson.Field
		Citations respjson.Field
		Source    respjson.Field
		Title     respjson.Field
		Type      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ContentBlockStartEventContentBlockUnionContentContent is an implicit subunion of ContentBlockStartEventContentBlockUnion. ContentBlockStartEventContentBlockUnionContentContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ContentBlockStartEventContentBlockUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfContent OfString]

func (*ContentBlockStartEventContentBlockUnionContentContent) UnmarshalJSON

type ContentBlockStopEvent

type ContentBlockStopEvent struct {
	Index int64                     `json:"index" api:"required"`
	Type  constant.ContentBlockStop `json:"type" default:"content_block_stop"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Index       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ContentBlockStopEvent) RawJSON

func (r ContentBlockStopEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContentBlockStopEvent) UnmarshalJSON

func (r *ContentBlockStopEvent) UnmarshalJSON(data []byte) error

type ContentBlockUnion

type ContentBlockUnion struct {
	// This field is from variant [TextBlock].
	Citations []TextCitationUnion `json:"citations"`
	// This field is from variant [TextBlock].
	Text string `json:"text"`
	// Any of "text", "thinking", "redacted_thinking", "tool_use", "server_tool_use",
	// "web_search_tool_result", "web_fetch_tool_result", "code_execution_tool_result",
	// "bash_code_execution_tool_result", "text_editor_code_execution_tool_result",
	// "tool_search_tool_result", "container_upload".
	Type string `json:"type"`
	// This field is from variant [ThinkingBlock].
	Signature string `json:"signature"`
	// This field is from variant [ThinkingBlock].
	Thinking string `json:"thinking"`
	// This field is from variant [RedactedThinkingBlock].
	Data string `json:"data"`
	ID   string `json:"id"`
	// necessary custom code modification
	Input json.RawMessage `json:"input"`
	Name  string          `json:"name"`
	// This field is from variant [WebSearchToolResultBlock].
	Content WebSearchToolResultBlockContentUnion `json:"content"`
	// This field is from variant [WebSearchToolResultBlock].
	ToolUseID string `json:"tool_use_id"`
	JSON      struct {
		Citations respjson.Field
		Text      respjson.Field
		Type      respjson.Field
		Signature respjson.Field
		Thinking  respjson.Field
		Data      respjson.Field
		ID        respjson.Field
		Caller    respjson.Field
		Input     respjson.Field
		Name      respjson.Field
		Content   respjson.Field
		ToolUseID respjson.Field
		FileID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ContentBlockUnion contains all possible properties and values from TextBlock, ThinkingBlock, RedactedThinkingBlock, ToolUseBlock, ServerToolUseBlock, WebSearchToolResultBlock, WebFetchToolResultBlock, CodeExecutionToolResultBlock, BashCodeExecutionToolResultBlock, TextEditorCodeExecutionToolResultBlock, ToolSearchToolResultBlock, ContainerUploadBlock.

Use the ContentBlockUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ContentBlockUnion) AsAny

func (u ContentBlockUnion) AsAny() anyContentBlock

Use the following switch statement to find the correct variant

switch variant := ContentBlockUnion.AsAny().(type) {
case Juglow.TextBlock:
case Juglow.ThinkingBlock:
case Juglow.RedactedThinkingBlock:
case Juglow.ToolUseBlock:
case Juglow.ServerToolUseBlock:
case Juglow.WebSearchToolResultBlock:
case Juglow.WebFetchToolResultBlock:
case Juglow.CodeExecutionToolResultBlock:
case Juglow.BashCodeExecutionToolResultBlock:
case Juglow.TextEditorCodeExecutionToolResultBlock:
case Juglow.ToolSearchToolResultBlock:
case Juglow.ContainerUploadBlock:
default:
  fmt.Errorf("no variant present")
}

func (ContentBlockUnion) AsBashCodeExecutionToolResult

func (u ContentBlockUnion) AsBashCodeExecutionToolResult() (v BashCodeExecutionToolResultBlock)

func (ContentBlockUnion) AsCodeExecutionToolResult

func (u ContentBlockUnion) AsCodeExecutionToolResult() (v CodeExecutionToolResultBlock)

func (ContentBlockUnion) AsContainerUpload

func (u ContentBlockUnion) AsContainerUpload() (v ContainerUploadBlock)

func (ContentBlockUnion) AsRedactedThinking

func (u ContentBlockUnion) AsRedactedThinking() (v RedactedThinkingBlock)

func (ContentBlockUnion) AsServerToolUse

func (u ContentBlockUnion) AsServerToolUse() (v ServerToolUseBlock)

func (ContentBlockUnion) AsText

func (u ContentBlockUnion) AsText() (v TextBlock)

func (ContentBlockUnion) AsTextEditorCodeExecutionToolResult

func (u ContentBlockUnion) AsTextEditorCodeExecutionToolResult() (v TextEditorCodeExecutionToolResultBlock)

func (ContentBlockUnion) AsThinking

func (u ContentBlockUnion) AsThinking() (v ThinkingBlock)

func (ContentBlockUnion) AsToolSearchToolResult

func (u ContentBlockUnion) AsToolSearchToolResult() (v ToolSearchToolResultBlock)

func (ContentBlockUnion) AsToolUse

func (u ContentBlockUnion) AsToolUse() (v ToolUseBlock)

func (ContentBlockUnion) AsWebFetchToolResult

func (u ContentBlockUnion) AsWebFetchToolResult() (v WebFetchToolResultBlock)

func (ContentBlockUnion) AsWebSearchToolResult

func (u ContentBlockUnion) AsWebSearchToolResult() (v WebSearchToolResultBlock)

func (ContentBlockUnion) RawJSON

func (u ContentBlockUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (ContentBlockUnion) ToParam

func (*ContentBlockUnion) UnmarshalJSON

func (r *ContentBlockUnion) UnmarshalJSON(data []byte) error

type ContentBlockUnionCaller

type ContentBlockUnionCaller struct {
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ContentBlockUnionCaller is an implicit subunion of ContentBlockUnion. ContentBlockUnionCaller provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ContentBlockUnion.

func (*ContentBlockUnionCaller) UnmarshalJSON

func (r *ContentBlockUnionCaller) UnmarshalJSON(data []byte) error

type ContentBlockUnionContent

type ContentBlockUnionContent struct {
	// This field will be present if the value is a [[]WebSearchResultBlock] instead of
	// an object.
	OfWebSearchResultBlockArray []WebSearchResultBlock `json:",inline"`
	ErrorCode                   string                 `json:"error_code"`
	Type                        string                 `json:"type"`
	// This field is a union of [DocumentBlock], [[]CodeExecutionOutputBlock],
	// [[]CodeExecutionOutputBlock], [[]BashCodeExecutionOutputBlock], [string]
	Content ContentBlockUnionContentContent `json:"content"`
	// This field is from variant [WebFetchToolResultBlockContentUnion].
	RetrievedAt string `json:"retrieved_at"`
	// This field is from variant [WebFetchToolResultBlockContentUnion].
	URL        string `json:"url"`
	ReturnCode int64  `json:"return_code"`
	Stderr     string `json:"stderr"`
	Stdout     string `json:"stdout"`
	// This field is from variant [CodeExecutionToolResultBlockContentUnion].
	EncryptedStdout string `json:"encrypted_stdout"`
	ErrorMessage    string `json:"error_message"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	FileType TextEditorCodeExecutionViewResultBlockFileType `json:"file_type"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	NumLines int64 `json:"num_lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	StartLine int64 `json:"start_line"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	TotalLines int64 `json:"total_lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	IsFileUpdate bool `json:"is_file_update"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	Lines []string `json:"lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	NewLines int64 `json:"new_lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	NewStart int64 `json:"new_start"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	OldLines int64 `json:"old_lines"`
	// This field is from variant [TextEditorCodeExecutionToolResultBlockContentUnion].
	OldStart int64 `json:"old_start"`
	// This field is from variant [ToolSearchToolResultBlockContentUnion].
	ToolReferences []ToolReferenceBlock `json:"tool_references"`
	JSON           struct {
		OfWebSearchResultBlockArray respjson.Field
		ErrorCode                   respjson.Field
		Type                        respjson.Field
		Content                     respjson.Field
		RetrievedAt                 respjson.Field
		URL                         respjson.Field
		ReturnCode                  respjson.Field
		Stderr                      respjson.Field
		Stdout                      respjson.Field
		EncryptedStdout             respjson.Field
		ErrorMessage                respjson.Field
		FileType                    respjson.Field
		NumLines                    respjson.Field
		StartLine                   respjson.Field
		TotalLines                  respjson.Field
		IsFileUpdate                respjson.Field
		Lines                       respjson.Field
		NewLines                    respjson.Field
		NewStart                    respjson.Field
		OldLines                    respjson.Field
		OldStart                    respjson.Field
		ToolReferences              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ContentBlockUnionContent is an implicit subunion of ContentBlockUnion. ContentBlockUnionContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ContentBlockUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfWebSearchResultBlockArray]

func (*ContentBlockUnionContent) UnmarshalJSON

func (r *ContentBlockUnionContent) UnmarshalJSON(data []byte) error

type ContentBlockUnionContentContent

type ContentBlockUnionContentContent struct {
	// This field will be present if the value is a [[]CodeExecutionOutputBlock]
	// instead of an object.
	OfContent []CodeExecutionOutputBlock `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field is from variant [DocumentBlock].
	Citations CitationsConfig `json:"citations"`
	// This field is from variant [DocumentBlock].
	Source DocumentBlockSourceUnion `json:"source"`
	// This field is from variant [DocumentBlock].
	Title string `json:"title"`
	// This field is from variant [DocumentBlock].
	Type constant.Document `json:"type"`
	JSON struct {
		OfContent respjson.Field
		OfString  respjson.Field
		Citations respjson.Field
		Source    respjson.Field
		Title     respjson.Field
		Type      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ContentBlockUnionContentContent is an implicit subunion of ContentBlockUnion. ContentBlockUnionContentContent provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ContentBlockUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfContent OfString]

func (*ContentBlockUnionContentContent) UnmarshalJSON

func (r *ContentBlockUnionContentContent) UnmarshalJSON(data []byte) error

type ContextManagementCapability

type ContextManagementCapability struct {
	// Indicates whether a capability is supported.
	ClearThinking20251015 CapabilitySupport `json:"clear_thinking_20251015" api:"required"`
	// Indicates whether a capability is supported.
	ClearToolUses20250919 CapabilitySupport `json:"clear_tool_uses_20250919" api:"required"`
	// Indicates whether a capability is supported.
	Compact20260112 CapabilitySupport `json:"compact_20260112" api:"required"`
	// Whether this capability is supported by the model.
	Supported bool `json:"supported" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ClearThinking20251015 respjson.Field
		ClearToolUses20250919 respjson.Field
		Compact20260112       respjson.Field
		Supported             respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Context management capability details.

func (ContextManagementCapability) RawJSON

func (r ContextManagementCapability) RawJSON() string

Returns the unmodified JSON received from the API

func (*ContextManagementCapability) UnmarshalJSON

func (r *ContextManagementCapability) UnmarshalJSON(data []byte) error

type DeletedFile

type DeletedFile struct {
	// ID of the deleted file.
	ID string `json:"id" api:"required"`
	// Deleted object type.
	//
	// For file deletion, this is always `"file_deleted"`.
	//
	// Any of "file_deleted".
	Type DeletedFileType `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeletedFile) RawJSON

func (r DeletedFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeletedFile) UnmarshalJSON

func (r *DeletedFile) UnmarshalJSON(data []byte) error

type DeletedFileType

type DeletedFileType string

Deleted object type.

For file deletion, this is always `"file_deleted"`.

const (
	DeletedFileTypeFileDeleted DeletedFileType = "file_deleted"
)

type DeletedMessageBatch

type DeletedMessageBatch struct {
	// ID of the Message Batch.
	ID string `json:"id" api:"required"`
	// Deleted object type.
	//
	// For Message Batches, this is always `"message_batch_deleted"`.
	Type constant.MessageBatchDeleted `json:"type" default:"message_batch_deleted"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeletedMessageBatch) RawJSON

func (r DeletedMessageBatch) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeletedMessageBatch) UnmarshalJSON

func (r *DeletedMessageBatch) UnmarshalJSON(data []byte) error

type DirectCaller

type DirectCaller struct {
	Type constant.Direct `json:"type" default:"direct"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tool invocation directly from the model.

func (DirectCaller) RawJSON

func (r DirectCaller) RawJSON() string

Returns the unmodified JSON received from the API

func (DirectCaller) ToParam

func (r DirectCaller) ToParam() DirectCallerParam

ToParam converts this DirectCaller to a DirectCallerParam.

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 DirectCallerParam.Overrides()

func (*DirectCaller) UnmarshalJSON

func (r *DirectCaller) UnmarshalJSON(data []byte) error

type DirectCallerParam

type DirectCallerParam struct {
	Type constant.Direct `json:"type" default:"direct"`
	// contains filtered or unexported fields
}

Tool invocation directly from the model.

This struct has a constant value, construct it with NewDirectCallerParam.

func NewDirectCallerParam

func NewDirectCallerParam() DirectCallerParam

func (DirectCallerParam) MarshalJSON

func (r DirectCallerParam) MarshalJSON() (data []byte, err error)

func (*DirectCallerParam) UnmarshalJSON

func (r *DirectCallerParam) UnmarshalJSON(data []byte) error

type DispatchedToolCall

type DispatchedToolCall struct {
	// Custom reports whether this dispatch was triggered by an
	// agent.custom_tool_use event (a user-defined function tool) rather than an
	// agent.tool_use event (a builtin agent_toolset_20260401 tool). It selects
	// which of the ToolUse/CustomToolUse and Result/CustomResult pairs below is
	// populated; the other pair is left zero.
	Custom bool

	// Confirmation is the verdict that gated this call, if any. "allow"
	// means the call required user confirmation and was approved before it
	// ran; "deny" means the user denied it or the server evaluated its
	// permission to "deny" — the tool was never executed and nothing was
	// posted (Posted=false, IsError=false, no Result). Empty means the call
	// needed no confirmation.
	Confirmation string

	// ToolUse is the full agent.tool_use event that triggered this dispatch,
	// exactly as it arrived on the stream (or via reconcile). Populated only
	// when Custom is false.
	ToolUse BetaManagedAgentsAgentToolUseEvent

	// CustomToolUse is the full agent.custom_tool_use event that triggered this
	// dispatch, exactly as it arrived on the stream (or via reconcile).
	// Populated only when Custom is true.
	CustomToolUse BetaManagedAgentsAgentCustomToolUseEvent

	// Result is the user.tool_result event the runner built and posted back to
	// the session for a builtin agent.tool_use. Populated only when Custom is
	// false. Read Result.Content for the tool's output blocks; the flat
	// IsError mirrors Result.IsError and Posted reports whether the send
	// succeeded.
	Result BetaManagedAgentsUserToolResultEventParams

	// CustomResult is the user.custom_tool_result event the runner built and
	// posted back to the session for an agent.custom_tool_use. Populated only
	// when Custom is true. Read CustomResult.Content for the tool's output
	// blocks; the flat IsError mirrors CustomResult.IsError and Posted
	// reports whether the send succeeded.
	CustomResult BetaManagedAgentsUserCustomToolResultEventParams

	// ToolUseID is the id of the tool-use event that triggered this dispatch
	// (flat convenience copy of ToolUse.ID / CustomToolUse.ID). It is the id
	// the posted result event references — tool_use_id for a builtin call,
	// custom_tool_use_id for a custom one. Use it to correlate logs with the
	// session history.
	ToolUseID string

	// Name is the tool name from the tool-use event (flat convenience copy of
	// ToolUse.Name / CustomToolUse.Name).
	Name string

	// IsError captures whether the tool's outcome should be surfaced to the
	// agent as an error.
	IsError bool

	// Posted reports whether a result event for this call reached the session.
	// False on a permanent 4xx or exhausted retries, and also false — with no
	// result event ever built — for a tool name this runner does not own when
	// it deliberately posts nothing and leaves the id pending for its owner.
	Posted bool
}

DispatchedToolCall describes a single tool-use event that the runner has executed locally and (attempted to) post a result for. The consumer observes one of these per iteration of (*SessionToolRunner).Next.

The runner dispatches both kinds of tool-call event the session API emits: agent.tool_use (the builtin agent_toolset_20260401 tools, answered with user.tool_result) and agent.custom_tool_use (user-defined function tools, answered with user.custom_tool_result). The Custom field reports which kind this dispatch came from and selects which embedded-event pair is populated — ToolUse/Result for a builtin call, CustomToolUse/CustomResult for a custom one. The flat top-level convenience fields (ToolUseID / Name / IsError / Posted) are populated for both kinds; read whichever is more convenient, they describe the same dispatch. The raw tool input lives on the triggering event (ToolUse.Input / CustomToolUse.Input) and the tool's output blocks on the posted result (Result.Content / CustomResult.Content).

IsError is true if the tool reported failure or exceeded its per-call timeout. Posted is orthogonal to IsError: it reports whether a result event was successfully sent back to the session. Posted=false means the agent will not see a result from this runner, regardless of IsError — either because the send failed or because the tool name is not one this runner owns and the runner deliberately posted nothing and left the id pending for its owner.

type DocumentBlock

type DocumentBlock struct {
	// Citation configuration for the document
	Citations CitationsConfig          `json:"citations" api:"required"`
	Source    DocumentBlockSourceUnion `json:"source" api:"required"`
	// The title of the document
	Title string            `json:"title" api:"required"`
	Type  constant.Document `json:"type" default:"document"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Citations   respjson.Field
		Source      respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DocumentBlock) RawJSON

func (r DocumentBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (*DocumentBlock) UnmarshalJSON

func (r *DocumentBlock) UnmarshalJSON(data []byte) error

type DocumentBlockParam

type DocumentBlockParam struct {
	Source  DocumentBlockParamSourceUnion `json:"source,omitzero" api:"required"`
	Context param.Opt[string]             `json:"context,omitzero"`
	Title   param.Opt[string]             `json:"title,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	Citations    CitationsConfigParam       `json:"citations,omitzero"`
	// This field can be elided, and will marshal its zero value as "document".
	Type constant.Document `json:"type" default:"document"`
	// contains filtered or unexported fields
}

The properties Source, Type are required.

func (DocumentBlockParam) MarshalJSON

func (r DocumentBlockParam) MarshalJSON() (data []byte, err error)

func (*DocumentBlockParam) UnmarshalJSON

func (r *DocumentBlockParam) UnmarshalJSON(data []byte) error

type DocumentBlockParamSourceUnion

type DocumentBlockParamSourceUnion struct {
	OfBase64  *Base64PDFSourceParam    `json:",omitzero,inline"`
	OfText    *PlainTextSourceParam    `json:",omitzero,inline"`
	OfContent *ContentBlockSourceParam `json:",omitzero,inline"`
	OfURL     *URLPDFSourceParam       `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 (DocumentBlockParamSourceUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (DocumentBlockParamSourceUnion) GetData

Returns a pointer to the underlying variant's property, if present.

func (DocumentBlockParamSourceUnion) GetMediaType

func (u DocumentBlockParamSourceUnion) GetMediaType() *string

Returns a pointer to the underlying variant's property, if present.

func (DocumentBlockParamSourceUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (DocumentBlockParamSourceUnion) GetURL

Returns a pointer to the underlying variant's property, if present.

func (DocumentBlockParamSourceUnion) MarshalJSON

func (u DocumentBlockParamSourceUnion) MarshalJSON() ([]byte, error)

func (*DocumentBlockParamSourceUnion) UnmarshalJSON

func (u *DocumentBlockParamSourceUnion) UnmarshalJSON(data []byte) error

type DocumentBlockSourceUnion

type DocumentBlockSourceUnion struct {
	Data      string `json:"data"`
	MediaType string `json:"media_type"`
	// Any of "base64", "text".
	Type string `json:"type"`
	JSON struct {
		Data      respjson.Field
		MediaType respjson.Field
		Type      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

DocumentBlockSourceUnion contains all possible properties and values from Base64PDFSource, PlainTextSource.

Use the DocumentBlockSourceUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (DocumentBlockSourceUnion) AsAny

func (u DocumentBlockSourceUnion) AsAny() anyDocumentBlockSource

Use the following switch statement to find the correct variant

switch variant := DocumentBlockSourceUnion.AsAny().(type) {
case Juglow.Base64PDFSource:
case Juglow.PlainTextSource:
default:
  fmt.Errorf("no variant present")
}

func (DocumentBlockSourceUnion) AsBase64

func (u DocumentBlockSourceUnion) AsBase64() (v Base64PDFSource)

func (DocumentBlockSourceUnion) AsText

func (DocumentBlockSourceUnion) RawJSON

func (u DocumentBlockSourceUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*DocumentBlockSourceUnion) UnmarshalJSON

func (r *DocumentBlockSourceUnion) UnmarshalJSON(data []byte) error

type EffortCapability

type EffortCapability struct {
	// Whether the model supports high effort level.
	High CapabilitySupport `json:"high" api:"required"`
	// Whether the model supports low effort level.
	Low CapabilitySupport `json:"low" api:"required"`
	// Whether the model supports max effort level.
	Max CapabilitySupport `json:"max" api:"required"`
	// Whether the model supports medium effort level.
	Medium CapabilitySupport `json:"medium" api:"required"`
	// Whether this capability is supported by the model.
	Supported bool `json:"supported" api:"required"`
	// Indicates whether a capability is supported.
	Xhigh CapabilitySupport `json:"xhigh" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		High        respjson.Field
		Low         respjson.Field
		Max         respjson.Field
		Medium      respjson.Field
		Supported   respjson.Field
		Xhigh       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Effort (reasoning_effort) capability details.

func (EffortCapability) RawJSON

func (r EffortCapability) RawJSON() string

Returns the unmodified JSON received from the API

func (*EffortCapability) UnmarshalJSON

func (r *EffortCapability) UnmarshalJSON(data []byte) error

type EncryptedCodeExecutionResultBlock

type EncryptedCodeExecutionResultBlock struct {
	Content         []CodeExecutionOutputBlock            `json:"content" api:"required"`
	EncryptedStdout string                                `json:"encrypted_stdout" api:"required"`
	ReturnCode      int64                                 `json:"return_code" api:"required"`
	Stderr          string                                `json:"stderr" api:"required"`
	Type            constant.EncryptedCodeExecutionResult `json:"type" default:"encrypted_code_execution_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content         respjson.Field
		EncryptedStdout respjson.Field
		ReturnCode      respjson.Field
		Stderr          respjson.Field
		Type            respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Code execution result with encrypted stdout for PFC + web_search results.

func (EncryptedCodeExecutionResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*EncryptedCodeExecutionResultBlock) UnmarshalJSON

func (r *EncryptedCodeExecutionResultBlock) UnmarshalJSON(data []byte) error

type EncryptedCodeExecutionResultBlockParam

type EncryptedCodeExecutionResultBlockParam struct {
	Content         []CodeExecutionOutputBlockParam `json:"content,omitzero" api:"required"`
	EncryptedStdout string                          `json:"encrypted_stdout" api:"required"`
	ReturnCode      int64                           `json:"return_code" api:"required"`
	Stderr          string                          `json:"stderr" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "encrypted_code_execution_result".
	Type constant.EncryptedCodeExecutionResult `json:"type" default:"encrypted_code_execution_result"`
	// contains filtered or unexported fields
}

Code execution result with encrypted stdout for PFC + web_search results.

The properties Content, EncryptedStdout, ReturnCode, Stderr, Type are required.

func (EncryptedCodeExecutionResultBlockParam) MarshalJSON

func (r EncryptedCodeExecutionResultBlockParam) MarshalJSON() (data []byte, err error)

func (*EncryptedCodeExecutionResultBlockParam) UnmarshalJSON

func (r *EncryptedCodeExecutionResultBlockParam) UnmarshalJSON(data []byte) error

type Error

type Error = apierror.Error

type ErrorObjectUnion

type ErrorObjectUnion = shared.ErrorObjectUnion

This is an alias to an internal type.

type ErrorResponse

type ErrorResponse = shared.ErrorResponse

This is an alias to an internal type.

type ErrorType

type ErrorType = shared.ErrorType

This is an alias to an internal type.

type FileMetadata

type FileMetadata struct {
	// Unique object identifier.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// RFC 3339 datetime string representing when the file was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Original filename of the uploaded file.
	Filename string `json:"filename" api:"required"`
	// MIME type of the file.
	MimeType string `json:"mime_type" api:"required"`
	// Size of the file in bytes.
	SizeBytes int64 `json:"size_bytes" api:"required"`
	// Object type.
	//
	// For files, this is always `"file"`.
	Type constant.File `json:"type" default:"file"`
	// Whether the file can be downloaded.
	Downloadable bool `json:"downloadable"`
	// The scope of this file, indicating the context in which it was created (e.g., a
	// session).
	Scope BetaFileScope `json:"scope" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		CreatedAt    respjson.Field
		Filename     respjson.Field
		MimeType     respjson.Field
		SizeBytes    respjson.Field
		Type         respjson.Field
		Downloadable respjson.Field
		Scope        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FileMetadata) RawJSON

func (r FileMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*FileMetadata) UnmarshalJSON

func (r *FileMetadata) UnmarshalJSON(data []byte) error

type GatewayTimeoutError

type GatewayTimeoutError = shared.GatewayTimeoutError

This is an alias to an internal type.

type ImageBlockParam

type ImageBlockParam struct {
	Source ImageBlockParamSourceUnion `json:"source,omitzero" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "image".
	Type constant.Image `json:"type" default:"image"`
	// contains filtered or unexported fields
}

The properties Source, Type are required.

func (ImageBlockParam) MarshalJSON

func (r ImageBlockParam) MarshalJSON() (data []byte, err error)

func (*ImageBlockParam) UnmarshalJSON

func (r *ImageBlockParam) UnmarshalJSON(data []byte) error

type ImageBlockParamSourceUnion

type ImageBlockParamSourceUnion struct {
	OfBase64 *Base64ImageSourceParam `json:",omitzero,inline"`
	OfURL    *URLImageSourceParam    `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 (ImageBlockParamSourceUnion) GetData

func (u ImageBlockParamSourceUnion) GetData() *string

Returns a pointer to the underlying variant's property, if present.

func (ImageBlockParamSourceUnion) GetMediaType

func (u ImageBlockParamSourceUnion) GetMediaType() *string

Returns a pointer to the underlying variant's property, if present.

func (ImageBlockParamSourceUnion) GetType

func (u ImageBlockParamSourceUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (ImageBlockParamSourceUnion) GetURL

func (u ImageBlockParamSourceUnion) GetURL() *string

Returns a pointer to the underlying variant's property, if present.

func (ImageBlockParamSourceUnion) MarshalJSON

func (u ImageBlockParamSourceUnion) MarshalJSON() ([]byte, error)

func (*ImageBlockParamSourceUnion) UnmarshalJSON

func (u *ImageBlockParamSourceUnion) UnmarshalJSON(data []byte) error

type InputJSONDelta

type InputJSONDelta struct {
	PartialJSON string                  `json:"partial_json" api:"required"`
	Type        constant.InputJSONDelta `json:"type" default:"input_json_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PartialJSON respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InputJSONDelta) RawJSON

func (r InputJSONDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*InputJSONDelta) UnmarshalJSON

func (r *InputJSONDelta) UnmarshalJSON(data []byte) error

type InvalidRequestError

type InvalidRequestError = shared.InvalidRequestError

This is an alias to an internal type.

type JSONOutputFormatParam

type JSONOutputFormatParam struct {
	// The JSON schema of the format
	Schema map[string]any `json:"schema,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "json_schema".
	Type constant.JSONSchema `json:"type" default:"json_schema"`
	// contains filtered or unexported fields
}

The properties Schema, Type are required.

func (JSONOutputFormatParam) MarshalJSON

func (r JSONOutputFormatParam) MarshalJSON() (data []byte, err error)

func (*JSONOutputFormatParam) UnmarshalJSON

func (r *JSONOutputFormatParam) UnmarshalJSON(data []byte) error

type JuglowBeta

type JuglowBeta = string
const (
	JuglowBetaMessageBatches2024_09_24             JuglowBeta = "message-batches-2024-09-24"
	JuglowBetaPromptCaching2024_07_31              JuglowBeta = "prompt-caching-2024-07-31"
	JuglowBetaComputerUse2024_10_22                JuglowBeta = "computer-use-2024-10-22"
	JuglowBetaComputerUse2025_01_24                JuglowBeta = "computer-use-2025-01-24"
	JuglowBetaPDFs2024_09_25                       JuglowBeta = "pdfs-2024-09-25"
	JuglowBetaTokenCounting2024_11_01              JuglowBeta = "token-counting-2024-11-01"
	JuglowBetaTokenEfficientTools2025_02_19        JuglowBeta = "token-efficient-tools-2025-02-19"
	JuglowBetaOutput128k2025_02_19                 JuglowBeta = "output-128k-2025-02-19"
	JuglowBetaFilesAPI2025_04_14                   JuglowBeta = "files-api-2025-04-14"
	JuglowBetaMCPClient2025_04_04                  JuglowBeta = "mcp-client-2025-04-04"
	JuglowBetaMCPClient2025_11_20                  JuglowBeta = "mcp-client-2025-11-20"
	JuglowBetaDevFullThinking2025_05_14            JuglowBeta = "dev-full-thinking-2025-05-14"
	JuglowBetaInterleavedThinking2025_05_14        JuglowBeta = "interleaved-thinking-2025-05-14"
	JuglowBetaCodeExecution2025_05_22              JuglowBeta = "code-execution-2025-05-22"
	JuglowBetaExtendedCacheTTL2025_04_11           JuglowBeta = "extended-cache-ttl-2025-04-11"
	JuglowBetaContext1m2025_08_07                  JuglowBeta = "context-1m-2025-08-07"
	JuglowBetaContextManagement2025_06_27          JuglowBeta = "context-management-2025-06-27"
	JuglowBetaModelContextWindowExceeded2025_08_26 JuglowBeta = "model-context-window-exceeded-2025-08-26"
	JuglowBetaTracks2025_10_02                     JuglowBeta = "tracks-2025-10-02"
	JuglowBetaFastMode2026_02_01                   JuglowBeta = "fast-mode-2026-02-01"
	JuglowBetaOutput300k2026_03_24                 JuglowBeta = "output-300k-2026-03-24"
	JuglowBetaUserProfiles2026_03_24               JuglowBeta = "user-profiles-2026-03-24"
	JuglowBetaAdvisorTool2026_03_01                JuglowBeta = "advisor-tool-2026-03-01"
	JuglowBetaManagedAgents2026_04_01              JuglowBeta = "managed-agents-2026-04-01"
	JuglowBetaCacheDiagnosis2026_04_07             JuglowBeta = "cache-diagnosis-2026-04-07"
	JuglowBetaDreaming2026_04_21                   JuglowBeta = "dreaming-2026-04-21"
	JuglowBetaThinkingTokenCount2026_05_13         JuglowBeta = "thinking-token-count-2026-05-13"
	JuglowBetaServerSideFallback2026_06_01         JuglowBeta = "server-side-fallback-2026-06-01"
	JuglowBetaServerSideFallback2026_07_01         JuglowBeta = "server-side-fallback-2026-07-01"
	JuglowBetaFallbackCredit2026_06_01             JuglowBeta = "fallback-credit-2026-06-01"
	JuglowBetaFallbackCredit2026_07_01             JuglowBeta = "fallback-credit-2026-07-01"
	JuglowBetaAgentMemory2026_07_22                JuglowBeta = "agent-memory-2026-07-22"
	JuglowBetaMidConversationToolChanges2026_07_01 JuglowBeta = "mid-conversation-tool-changes-2026-07-01"
)

type MemoryTool20250818Param

type MemoryTool20250818Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  CacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any           `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "memory".
	Name constant.Memory `json:"name" default:"memory"`
	// This field can be elided, and will marshal its zero value as "memory_20250818".
	Type constant.Memory20250818 `json:"type" default:"memory_20250818"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (MemoryTool20250818Param) MarshalJSON

func (r MemoryTool20250818Param) MarshalJSON() (data []byte, err error)

func (*MemoryTool20250818Param) UnmarshalJSON

func (r *MemoryTool20250818Param) UnmarshalJSON(data []byte) error

type Message

type Message struct {
	// Unique object identifier.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// Information about the container used in the request (for the code execution
	// tool)
	Container Container `json:"container" api:"required"`
	// Content generated by the model.
	//
	// This is an array of content blocks, each of which has a `type` that determines
	// its shape.
	//
	// Example:
	//
	// “`json
	// [{ "type": "text", "text": "Hi, I'm haijun." }]
	// “`
	//
	// If the request input `messages` ended with an `assistant` turn, then the
	// response `content` will continue directly from that last turn. You can use this
	// to constrain the model's output.
	//
	// For example, if the input `messages` were:
	//
	// “`json
	// [
	//
	//	{
	//	  "role": "user",
	//	  "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
	//	},
	//	{ "role": "assistant", "content": "The best answer is (" }
	//
	// ]
	// “`
	//
	// Then the response `content` might be:
	//
	// “`json
	// [{ "type": "text", "text": "B)" }]
	// “`
	Content []ContentBlockUnion `json:"content" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model" api:"required"`
	// Conversational role of the generated message.
	//
	// This will always be `"assistant"`.
	Role constant.Assistant `json:"role" default:"assistant"`
	// Structured information about a refusal.
	StopDetails RefusalStopDetails `json:"stop_details" api:"required"`
	// The reason that we stopped.
	//
	// This may be one the following values:
	//
	//   - `"end_turn"`: the model reached a natural stopping point
	//   - `"max_tokens"`: we exceeded the requested `max_tokens` or the model's maximum
	//   - `"stop_sequence"`: one of your provided custom `stop_sequences` was generated
	//   - `"tool_use"`: the model invoked one or more tools
	//   - `"pause_turn"`: we paused a long-running turn. You may provide the response
	//     back as-is in a subsequent request to let the model continue.
	//   - `"refusal"`: when streaming classifiers intervene to handle potential policy
	//     violations
	//   - `"model_context_window_exceeded"`: we exceeded the model's context window
	//
	// In non-streaming mode this value is always non-null. In streaming mode, it is
	// null in the `message_start` event and non-null otherwise.
	//
	// Any of "end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn",
	// "refusal", "model_context_window_exceeded".
	StopReason StopReason `json:"stop_reason" api:"required"`
	// Which custom stop sequence was generated, if any.
	//
	// This value will be a non-null string if one of your custom stop sequences was
	// generated.
	StopSequence string `json:"stop_sequence" api:"required"`
	// Object type.
	//
	// For Messages, this is always `"message"`.
	Type constant.Message `json:"type" default:"message"`
	// Billing and rate-limit usage.
	//
	// Juglow's API bills and rate-limits by token counts, as tokens represent the
	// underlying cost to our systems.
	//
	// Under the hood, the API transforms requests into a format suitable for the
	// model. The model's output then goes through a parsing stage before becoming an
	// API response. As a result, the token counts in `usage` will not match one-to-one
	// with the exact visible content of an API request or response.
	//
	// For example, `output_tokens` will be non-zero, even for an empty string response
	// from haijun.
	//
	// Total input tokens in a request is the summation of `input_tokens`,
	// `cache_creation_input_tokens`, and `cache_read_input_tokens`.
	Usage Usage `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Container    respjson.Field
		Content      respjson.Field
		Model        respjson.Field
		Role         respjson.Field
		StopDetails  respjson.Field
		StopReason   respjson.Field
		StopSequence respjson.Field
		Type         respjson.Field
		Usage        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (*Message) Accumulate

func (acc *Message) Accumulate(event MessageStreamEventUnion) error

Accumulate builds up the Message incrementally from a MessageStreamEvent. The Message then can be used as any other Message, including the Message.JSON field, which holds the wire JSON with the streamed deltas applied and is complete once message_stop arrives.

message := Juglow.Message{}
for stream.Next() {
	event := stream.Current()
	message.Accumulate(event)
}

func (Message) RawJSON

func (r Message) RawJSON() string

Returns the unmodified JSON received from the API

func (Message) ToParam

func (r Message) ToParam() MessageParam

func (*Message) UnmarshalJSON

func (r *Message) UnmarshalJSON(data []byte) error

type MessageBatch

type MessageBatch struct {
	// Unique object identifier.
	//
	// The format and length of IDs may change over time.
	ID string `json:"id" api:"required"`
	// RFC 3339 datetime string representing the time at which the Message Batch was
	// archived and its results became unavailable.
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// RFC 3339 datetime string representing the time at which cancellation was
	// initiated for the Message Batch. Specified only if cancellation was initiated.
	CancelInitiatedAt time.Time `json:"cancel_initiated_at" api:"required" format:"date-time"`
	// RFC 3339 datetime string representing the time at which the Message Batch was
	// created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// RFC 3339 datetime string representing the time at which processing for the
	// Message Batch ended. Specified only once processing ends.
	//
	// Processing ends when every request in a Message Batch has either succeeded,
	// errored, canceled, or expired.
	EndedAt time.Time `json:"ended_at" api:"required" format:"date-time"`
	// RFC 3339 datetime string representing the time at which the Message Batch will
	// expire and end processing, which is 24 hours after creation.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// Processing status of the Message Batch.
	//
	// Any of "in_progress", "canceling", "ended".
	ProcessingStatus MessageBatchProcessingStatus `json:"processing_status" api:"required"`
	// Tallies requests within the Message Batch, categorized by their status.
	//
	// Requests start as `processing` and move to one of the other statuses only once
	// processing of the entire batch ends. The sum of all values always matches the
	// total number of requests in the batch.
	RequestCounts MessageBatchRequestCounts `json:"request_counts" api:"required"`
	// URL to a `.jsonl` file containing the results of the Message Batch requests.
	// Specified only once processing ends.
	//
	// Results in the file are not guaranteed to be in the same order as requests. Use
	// the `custom_id` field to match results to requests.
	ResultsURL string `json:"results_url" api:"required"`
	// Object type.
	//
	// For Message Batches, this is always `"message_batch"`.
	Type constant.MessageBatch `json:"type" default:"message_batch"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		ArchivedAt        respjson.Field
		CancelInitiatedAt respjson.Field
		CreatedAt         respjson.Field
		EndedAt           respjson.Field
		ExpiresAt         respjson.Field
		ProcessingStatus  respjson.Field
		RequestCounts     respjson.Field
		ResultsURL        respjson.Field
		Type              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageBatch) RawJSON

func (r MessageBatch) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageBatch) UnmarshalJSON

func (r *MessageBatch) UnmarshalJSON(data []byte) error

type MessageBatchCanceledResult

type MessageBatchCanceledResult struct {
	Type constant.Canceled `json:"type" default:"canceled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageBatchCanceledResult) RawJSON

func (r MessageBatchCanceledResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageBatchCanceledResult) UnmarshalJSON

func (r *MessageBatchCanceledResult) UnmarshalJSON(data []byte) error

type MessageBatchErroredResult

type MessageBatchErroredResult struct {
	Error shared.ErrorResponse `json:"error" api:"required"`
	Type  constant.Errored     `json:"type" default:"errored"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Error       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageBatchErroredResult) RawJSON

func (r MessageBatchErroredResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageBatchErroredResult) UnmarshalJSON

func (r *MessageBatchErroredResult) UnmarshalJSON(data []byte) error

type MessageBatchExpiredResult

type MessageBatchExpiredResult struct {
	Type constant.Expired `json:"type" default:"expired"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageBatchExpiredResult) RawJSON

func (r MessageBatchExpiredResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageBatchExpiredResult) UnmarshalJSON

func (r *MessageBatchExpiredResult) UnmarshalJSON(data []byte) error

type MessageBatchIndividualResponse

type MessageBatchIndividualResponse struct {
	// Developer-provided ID created for each request in a Message Batch. Useful for
	// matching results to requests, as results may be given out of request order.
	//
	// Must be unique for each request within the Message Batch.
	CustomID string `json:"custom_id" api:"required"`
	// Processing result for this request.
	//
	// Contains a Message output if processing was successful, an error response if
	// processing failed, or the reason why processing was not attempted, such as
	// cancellation or expiration.
	Result MessageBatchResultUnion `json:"result" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomID    respjson.Field
		Result      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

This is a single line in the response `.jsonl` file and does not represent the response as a whole.

func (MessageBatchIndividualResponse) RawJSON

Returns the unmodified JSON received from the API

func (*MessageBatchIndividualResponse) UnmarshalJSON

func (r *MessageBatchIndividualResponse) UnmarshalJSON(data []byte) error

type MessageBatchListParams

type MessageBatchListParams struct {
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately after this object.
	AfterID param.Opt[string] `query:"after_id,omitzero" json:"-"`
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately before this object.
	BeforeID param.Opt[string] `query:"before_id,omitzero" json:"-"`
	// Number of items to return per page.
	//
	// Defaults to `20`. Ranges from `1` to `1000`.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MessageBatchListParams) URLQuery

func (r MessageBatchListParams) URLQuery() (v url.Values, err error)

URLQuery serializes MessageBatchListParams's query parameters as `url.Values`.

type MessageBatchNewParams

type MessageBatchNewParams struct {
	// List of requests for prompt completion. Each is an individual request to create
	// a Message.
	Requests []MessageBatchNewParamsRequest `json:"requests,omitzero" api:"required"`
	// The user profile ID to attribute the requests in this batch to. Use when acting
	// on behalf of a party other than your organization. Requires the `user-profiles`
	// beta header. Applies to every request in the batch; an individual request whose
	// `user_profile_id` body field conflicts with this header is errored.
	UserProfileID param.Opt[string] `header:"Juglow-user-profile-id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MessageBatchNewParams) MarshalJSON

func (r MessageBatchNewParams) MarshalJSON() (data []byte, err error)

func (*MessageBatchNewParams) UnmarshalJSON

func (r *MessageBatchNewParams) UnmarshalJSON(data []byte) error

type MessageBatchNewParamsRequest

type MessageBatchNewParamsRequest struct {
	// Developer-provided ID created for each request in a Message Batch. Useful for
	// matching results to requests, as results may be given out of request order.
	//
	// Must be unique for each request within the Message Batch.
	CustomID string `json:"custom_id" api:"required"`
	// Messages API creation parameters for the individual request.
	//
	// See the
	// [Messages API reference](https://platform.haijun.com/docs/en/api/messages) for
	// full documentation on available parameters.
	Params MessageBatchNewParamsRequestParams `json:"params,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties CustomID, Params are required.

func (MessageBatchNewParamsRequest) MarshalJSON

func (r MessageBatchNewParamsRequest) MarshalJSON() (data []byte, err error)

func (*MessageBatchNewParamsRequest) UnmarshalJSON

func (r *MessageBatchNewParamsRequest) UnmarshalJSON(data []byte) error

type MessageBatchNewParamsRequestParams

type MessageBatchNewParamsRequestParams struct {
	// The maximum number of tokens to generate before stopping.
	//
	// Note that our models may stop _before_ reaching this maximum. This parameter
	// only specifies the absolute maximum number of tokens to generate.
	//
	// Set to `0` to populate the
	// [prompt cache](https://platform.haijun.com/docs/en/build-with-haijun/prompt-caching#pre-warming-the-cache)
	// without generating a response.
	//
	// Different models have different maximum values for this parameter. See
	// [models](https://platform.haijun.com/docs/en/about-haijun/models/overview) for
	// details.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Input messages.
	//
	// Our models are trained to operate on alternating `user` and `assistant`
	// conversational turns. When creating a new `Message`, you specify the prior
	// conversational turns with the `messages` parameter, and the model then generates
	// the next `Message` in the conversation. Consecutive `user` or `assistant` turns
	// in your request will be combined into a single turn.
	//
	// Each input message must be an object with a `role` and `content`. You can
	// specify a single `user`-role message, or you can include multiple `user` and
	// `assistant` messages.
	//
	// If the final message uses the `assistant` role, the response content will
	// continue immediately from the content in that message. This can be used to
	// constrain part of the model's response.
	//
	// Example with a single `user` message:
	//
	// “`json
	// [{ "role": "user", "content": "Hello, haijun" }]
	// “`
	//
	// Example with multiple conversational turns:
	//
	// “`json
	// [
	//
	//	{ "role": "user", "content": "Hello there." },
	//	{ "role": "assistant", "content": "Hi, I'm haijun. How can I help you?" },
	//	{ "role": "user", "content": "Can you explain LLMs in plain English?" }
	//
	// ]
	// “`
	//
	// Example with a partially-filled response from haijun:
	//
	// “`json
	// [
	//
	//	{
	//	  "role": "user",
	//	  "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
	//	},
	//	{ "role": "assistant", "content": "The best answer is (" }
	//
	// ]
	// “`
	//
	// Each input message `content` may be either a single `string` or an array of
	// content blocks, where each block has a specific `type`. Using a `string` for
	// `content` is shorthand for an array of one content block of type `"text"`. The
	// following input messages are equivalent:
	//
	// “`json
	// { "role": "user", "content": "Hello, haijun" }
	// “`
	//
	// “`json
	// { "role": "user", "content": [{ "type": "text", "text": "Hello, haijun" }] }
	// “`
	//
	// See
	// [input examples](https://platform.haijun.com/docs/en/build-with-haijun/working-with-messages).
	//
	// Note that if you want to include a
	// [system prompt](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role),
	// you can use the top-level `system` parameter — there is no `"system"` role for
	// input messages in the Messages API.
	//
	// There is a limit of 100,000 messages in a single request.
	Messages []MessageParam `json:"messages,omitzero" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model,omitzero" api:"required"`
	// Container identifier for reuse across requests.
	Container param.Opt[string] `json:"container,omitzero"`
	// Specifies the geographic region for inference processing. If not specified, the
	// workspace's `default_inference_geo` is used.
	InferenceGeo param.Opt[string] `json:"inference_geo,omitzero"`
	// Whether to incrementally stream the response using server-sent events.
	//
	// See [streaming](https://platform.haijun.com/docs/en/build-with-haijun/streaming)
	// for details.
	Stream param.Opt[bool] `json:"stream,omitzero"`
	// Amount of randomness injected into the response.
	//
	// Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
	// for analytical / multiple choice, and closer to `1.0` for creative and
	// generative tasks.
	//
	// Note that even with `temperature` of `0.0`, the results will not be fully
	// deterministic.
	//
	// Deprecated: Deprecated. Models released after haijun Opus 4.6 do not support
	// setting temperature. A value of 1.0 of will be accepted for backwards
	// compatibility, all other values will be rejected with a 400 error.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Only sample from the top K options for each subsequent token.
	//
	// Used to remove "long tail" low probability responses.
	// [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
	//
	// Recommended for advanced use cases only.
	//
	// Deprecated: Deprecated. Models released after haijun Opus 4.6 do not accept
	// top_k; any value will be rejected with a 400 error.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// Use nucleus sampling.
	//
	// In nucleus sampling, we compute the cumulative distribution over all the options
	// for each subsequent token in decreasing probability order and cut it off once it
	// reaches a particular probability specified by `top_p`.
	//
	// Recommended for advanced use cases only.
	//
	// Deprecated: Deprecated. Models released after haijun Opus 4.6 do not support
	// setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all
	// other values will be rejected with a 400 error.
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// Top-level cache control automatically applies a cache_control marker to the last
	// cacheable block in the request.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// An object describing metadata about the request.
	Metadata MetadataParam `json:"metadata,omitzero"`
	// Configuration options for the model's output, such as the output format.
	OutputConfig OutputConfigParam `json:"output_config,omitzero"`
	// Determines whether to use priority capacity (if available) or standard capacity
	// for this request.
	//
	// Juglow offers different levels of service for your API requests. See
	// [service-tiers](https://platform.haijun.com/docs/en/api/service-tiers) for
	// details.
	//
	// Any of "auto", "standard_only".
	ServiceTier string `json:"service_tier,omitzero"`
	// Custom text sequences that will cause the model to stop generating.
	//
	// Our models will normally stop when they have naturally completed their turn,
	// which will result in a response `stop_reason` of `"end_turn"`.
	//
	// If you want the model to stop generating when it encounters custom strings of
	// text, you can use the `stop_sequences` parameter. If the model encounters one of
	// the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
	// and the response `stop_sequence` value will contain the matched stop sequence.
	StopSequences []string `json:"stop_sequences,omitzero"`
	// System prompt.
	//
	// A system prompt is a way of providing context and instructions to haijun, such
	// as specifying a particular goal or role. See our
	// [guide to system prompts](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role).
	System []TextBlockParam `json:"system,omitzero"`
	// Configuration for enabling haijun's extended thinking.
	//
	// When enabled, responses include `thinking` content blocks showing haijun's
	// thinking process before the final answer. Requires a minimum budget of 1,024
	// tokens and counts towards your `max_tokens` limit.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	Thinking ThinkingConfigParamUnion `json:"thinking,omitzero"`
	// How the model should use the provided tools. The model can use a specific tool,
	// any available tool, decide by itself, or not use tools at all.
	ToolChoice ToolChoiceUnionParam `json:"tool_choice,omitzero"`
	// Definitions of tools that the model may use.
	//
	// If you include `tools` in your API request, the model may return `tool_use`
	// content blocks that represent the model's use of those tools. You can then run
	// those tools using the tool input generated by the model and then optionally
	// return results back to the model using `tool_result` content blocks.
	//
	// There are two types of tools: **client tools** and **server tools**. The
	// behavior described below applies to client tools. For
	// [server tools](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/server-tools),
	// see their individual documentation as each has its own behavior (e.g., the
	// [web search tool](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/web-search-tool)).
	//
	// Each tool definition includes:
	//
	//   - `name`: Name of the tool.
	//   - `description`: Optional, but strongly-recommended description of the tool.
	//   - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
	//     tool `input` shape that the model will produce in `tool_use` output content
	//     blocks.
	//
	// For example, if you defined `tools` as:
	//
	// “`json
	// [
	//
	//	{
	//	  "name": "get_stock_price",
	//	  "description": "Get the current stock price for a given ticker symbol.",
	//	  "input_schema": {
	//	    "type": "object",
	//	    "properties": {
	//	      "ticker": {
	//	        "type": "string",
	//	        "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
	//	      }
	//	    },
	//	    "required": ["ticker"]
	//	  }
	//	}
	//
	// ]
	// “`
	//
	// And then asked the model "What's the S&P 500 at today?", the model might produce
	// `tool_use` content blocks in the response like this:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_use",
	//	  "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "name": "get_stock_price",
	//	  "input": { "ticker": "^GSPC" }
	//	}
	//
	// ]
	// “`
	//
	// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
	// input, and return the following back to the model in a subsequent `user`
	// message:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_result",
	//	  "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "content": "259.75 USD"
	//	}
	//
	// ]
	// “`
	//
	// Tools can be used for workflows that include running client-side tools and
	// functions, or more generally whenever you want the model to produce a particular
	// JSON structure of output.
	//
	// See our
	// [guide](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/overview)
	// for more details.
	Tools []ToolUnionParam `json:"tools,omitzero"`
	// contains filtered or unexported fields
}

Messages API creation parameters for the individual request.

See the [Messages API reference](https://platform.haijun.com/docs/en/api/messages) for full documentation on available parameters.

The properties MaxTokens, Messages, Model are required.

func (MessageBatchNewParamsRequestParams) MarshalJSON

func (r MessageBatchNewParamsRequestParams) MarshalJSON() (data []byte, err error)

func (*MessageBatchNewParamsRequestParams) UnmarshalJSON

func (r *MessageBatchNewParamsRequestParams) UnmarshalJSON(data []byte) error

type MessageBatchProcessingStatus

type MessageBatchProcessingStatus string

Processing status of the Message Batch.

const (
	MessageBatchProcessingStatusInProgress MessageBatchProcessingStatus = "in_progress"
	MessageBatchProcessingStatusCanceling  MessageBatchProcessingStatus = "canceling"
	MessageBatchProcessingStatusEnded      MessageBatchProcessingStatus = "ended"
)

type MessageBatchRequestCounts

type MessageBatchRequestCounts struct {
	// Number of requests in the Message Batch that have been canceled.
	//
	// This is zero until processing of the entire Message Batch has ended.
	Canceled int64 `json:"canceled" api:"required"`
	// Number of requests in the Message Batch that encountered an error.
	//
	// This is zero until processing of the entire Message Batch has ended.
	Errored int64 `json:"errored" api:"required"`
	// Number of requests in the Message Batch that have expired.
	//
	// This is zero until processing of the entire Message Batch has ended.
	Expired int64 `json:"expired" api:"required"`
	// Number of requests in the Message Batch that are processing.
	Processing int64 `json:"processing" api:"required"`
	// Number of requests in the Message Batch that have completed successfully.
	//
	// This is zero until processing of the entire Message Batch has ended.
	Succeeded int64 `json:"succeeded" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Canceled    respjson.Field
		Errored     respjson.Field
		Expired     respjson.Field
		Processing  respjson.Field
		Succeeded   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageBatchRequestCounts) RawJSON

func (r MessageBatchRequestCounts) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageBatchRequestCounts) UnmarshalJSON

func (r *MessageBatchRequestCounts) UnmarshalJSON(data []byte) error

type MessageBatchResultUnion

type MessageBatchResultUnion struct {
	// This field is from variant [MessageBatchSucceededResult].
	Message Message `json:"message"`
	// Any of "succeeded", "errored", "canceled", "expired".
	Type string `json:"type"`
	// This field is from variant [MessageBatchErroredResult].
	Error shared.ErrorResponse `json:"error"`
	JSON  struct {
		Message respjson.Field
		Type    respjson.Field
		Error   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MessageBatchResultUnion contains all possible properties and values from MessageBatchSucceededResult, MessageBatchErroredResult, MessageBatchCanceledResult, MessageBatchExpiredResult.

Use the MessageBatchResultUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MessageBatchResultUnion) AsAny

func (u MessageBatchResultUnion) AsAny() anyMessageBatchResult

Use the following switch statement to find the correct variant

switch variant := MessageBatchResultUnion.AsAny().(type) {
case Juglow.MessageBatchSucceededResult:
case Juglow.MessageBatchErroredResult:
case Juglow.MessageBatchCanceledResult:
case Juglow.MessageBatchExpiredResult:
default:
  fmt.Errorf("no variant present")
}

func (MessageBatchResultUnion) AsCanceled

func (MessageBatchResultUnion) AsErrored

func (MessageBatchResultUnion) AsExpired

func (MessageBatchResultUnion) AsSucceeded

func (MessageBatchResultUnion) RawJSON

func (u MessageBatchResultUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageBatchResultUnion) UnmarshalJSON

func (r *MessageBatchResultUnion) UnmarshalJSON(data []byte) error

type MessageBatchService

type MessageBatchService struct {
	Options []option.RequestOption
}

MessageBatchService contains methods and other services that help with interacting with the Juglow 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 NewMessageBatchService method instead.

func NewMessageBatchService

func NewMessageBatchService(opts ...option.RequestOption) (r MessageBatchService)

NewMessageBatchService 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 (*MessageBatchService) Cancel

func (r *MessageBatchService) Cancel(ctx context.Context, messageBatchID string, opts ...option.RequestOption) (res *MessageBatch, err error)

Batches may be canceled any time before processing ends. Once cancellation is initiated, the batch enters a `canceling` state, at which time the system may complete any in-progress, non-interruptible requests before finalizing cancellation.

The number of canceled requests is specified in `request_counts`. To determine which requests were canceled, check the individual results within the batch. Note that cancellation may not result in any canceled requests if they were non-interruptible.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*MessageBatchService) Delete

func (r *MessageBatchService) Delete(ctx context.Context, messageBatchID string, opts ...option.RequestOption) (res *DeletedMessageBatch, err error)

Delete a Message Batch.

Message Batches can only be deleted once they've finished processing. If you'd like to delete an in-progress batch, you must first cancel it.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*MessageBatchService) Get

func (r *MessageBatchService) Get(ctx context.Context, messageBatchID string, opts ...option.RequestOption) (res *MessageBatch, err error)

This endpoint is idempotent and can be used to poll for Message Batch completion. To access the results of a Message Batch, make a request to the `results_url` field in the response.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*MessageBatchService) List

List all Message Batches within a Workspace. Most recently created batches are returned first.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*MessageBatchService) ListAutoPaging

List all Message Batches within a Workspace. Most recently created batches are returned first.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*MessageBatchService) New

Send a batch of Message creation requests.

The Message Batches API can be used to process multiple Messages API requests at once. Once a Message Batch is created, it begins processing immediately. Batches can take up to 24 hours to complete.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

func (*MessageBatchService) ResultsStreaming

func (r *MessageBatchService) ResultsStreaming(ctx context.Context, messageBatchID string, opts ...option.RequestOption) (stream *jsonl.Stream[MessageBatchIndividualResponse])

Streams the results of a Message Batch as a `.jsonl` file.

Each line in the file is a JSON object containing the result of a single request in the Message Batch. Results are not guaranteed to be in the same order as requests. Use the `custom_id` field to match results to requests.

Learn more about the Message Batches API in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/batch-processing)

type MessageBatchSucceededResult

type MessageBatchSucceededResult struct {
	Message Message            `json:"message" api:"required"`
	Type    constant.Succeeded `json:"type" default:"succeeded"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageBatchSucceededResult) RawJSON

func (r MessageBatchSucceededResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageBatchSucceededResult) UnmarshalJSON

func (r *MessageBatchSucceededResult) UnmarshalJSON(data []byte) error

type MessageCountTokensParams

type MessageCountTokensParams struct {
	// Input messages.
	//
	// Our models are trained to operate on alternating `user` and `assistant`
	// conversational turns. When creating a new `Message`, you specify the prior
	// conversational turns with the `messages` parameter, and the model then generates
	// the next `Message` in the conversation. Consecutive `user` or `assistant` turns
	// in your request will be combined into a single turn.
	//
	// Each input message must be an object with a `role` and `content`. You can
	// specify a single `user`-role message, or you can include multiple `user` and
	// `assistant` messages.
	//
	// If the final message uses the `assistant` role, the response content will
	// continue immediately from the content in that message. This can be used to
	// constrain part of the model's response.
	//
	// Example with a single `user` message:
	//
	// “`json
	// [{ "role": "user", "content": "Hello, haijun" }]
	// “`
	//
	// Example with multiple conversational turns:
	//
	// “`json
	// [
	//
	//	{ "role": "user", "content": "Hello there." },
	//	{ "role": "assistant", "content": "Hi, I'm haijun. How can I help you?" },
	//	{ "role": "user", "content": "Can you explain LLMs in plain English?" }
	//
	// ]
	// “`
	//
	// Example with a partially-filled response from haijun:
	//
	// “`json
	// [
	//
	//	{
	//	  "role": "user",
	//	  "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
	//	},
	//	{ "role": "assistant", "content": "The best answer is (" }
	//
	// ]
	// “`
	//
	// Each input message `content` may be either a single `string` or an array of
	// content blocks, where each block has a specific `type`. Using a `string` for
	// `content` is shorthand for an array of one content block of type `"text"`. The
	// following input messages are equivalent:
	//
	// “`json
	// { "role": "user", "content": "Hello, haijun" }
	// “`
	//
	// “`json
	// { "role": "user", "content": [{ "type": "text", "text": "Hello, haijun" }] }
	// “`
	//
	// See
	// [input examples](https://platform.haijun.com/docs/en/build-with-haijun/working-with-messages).
	//
	// Note that if you want to include a
	// [system prompt](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role),
	// you can use the top-level `system` parameter — there is no `"system"` role for
	// input messages in the Messages API.
	//
	// There is a limit of 100,000 messages in a single request.
	Messages []MessageParam `json:"messages,omitzero" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model,omitzero" api:"required"`
	// The user profile ID to attribute this request to. Use when acting on behalf of a
	// party other than your organization. Requires the `user-profiles` beta header.
	UserProfileID param.Opt[string] `header:"Juglow-user-profile-id,omitzero" json:"-"`
	// Top-level cache control automatically applies a cache_control marker to the last
	// cacheable block in the request.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Configuration options for the model's output, such as the output format.
	OutputConfig OutputConfigParam `json:"output_config,omitzero"`
	// System prompt.
	//
	// A system prompt is a way of providing context and instructions to haijun, such
	// as specifying a particular goal or role. See our
	// [guide to system prompts](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role).
	System MessageCountTokensParamsSystemUnion `json:"system,omitzero"`
	// Configuration for enabling haijun's extended thinking.
	//
	// When enabled, responses include `thinking` content blocks showing haijun's
	// thinking process before the final answer. Requires a minimum budget of 1,024
	// tokens and counts towards your `max_tokens` limit.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	Thinking ThinkingConfigParamUnion `json:"thinking,omitzero"`
	// How the model should use the provided tools. The model can use a specific tool,
	// any available tool, decide by itself, or not use tools at all.
	ToolChoice ToolChoiceUnionParam `json:"tool_choice,omitzero"`
	// Definitions of tools that the model may use.
	//
	// If you include `tools` in your API request, the model may return `tool_use`
	// content blocks that represent the model's use of those tools. You can then run
	// those tools using the tool input generated by the model and then optionally
	// return results back to the model using `tool_result` content blocks.
	//
	// There are two types of tools: **client tools** and **server tools**. The
	// behavior described below applies to client tools. For
	// [server tools](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/server-tools),
	// see their individual documentation as each has its own behavior (e.g., the
	// [web search tool](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/web-search-tool)).
	//
	// Each tool definition includes:
	//
	//   - `name`: Name of the tool.
	//   - `description`: Optional, but strongly-recommended description of the tool.
	//   - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
	//     tool `input` shape that the model will produce in `tool_use` output content
	//     blocks.
	//
	// For example, if you defined `tools` as:
	//
	// “`json
	// [
	//
	//	{
	//	  "name": "get_stock_price",
	//	  "description": "Get the current stock price for a given ticker symbol.",
	//	  "input_schema": {
	//	    "type": "object",
	//	    "properties": {
	//	      "ticker": {
	//	        "type": "string",
	//	        "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
	//	      }
	//	    },
	//	    "required": ["ticker"]
	//	  }
	//	}
	//
	// ]
	// “`
	//
	// And then asked the model "What's the S&P 500 at today?", the model might produce
	// `tool_use` content blocks in the response like this:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_use",
	//	  "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "name": "get_stock_price",
	//	  "input": { "ticker": "^GSPC" }
	//	}
	//
	// ]
	// “`
	//
	// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
	// input, and return the following back to the model in a subsequent `user`
	// message:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_result",
	//	  "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "content": "259.75 USD"
	//	}
	//
	// ]
	// “`
	//
	// Tools can be used for workflows that include running client-side tools and
	// functions, or more generally whenever you want the model to produce a particular
	// JSON structure of output.
	//
	// See our
	// [guide](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/overview)
	// for more details.
	Tools []MessageCountTokensToolUnionParam `json:"tools,omitzero"`
	// contains filtered or unexported fields
}

func (MessageCountTokensParams) MarshalJSON

func (r MessageCountTokensParams) MarshalJSON() (data []byte, err error)

func (*MessageCountTokensParams) UnmarshalJSON

func (r *MessageCountTokensParams) UnmarshalJSON(data []byte) error

type MessageCountTokensParamsSystemUnion

type MessageCountTokensParamsSystemUnion struct {
	OfString         param.Opt[string] `json:",omitzero,inline"`
	OfTextBlockArray []TextBlockParam  `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 (MessageCountTokensParamsSystemUnion) MarshalJSON

func (u MessageCountTokensParamsSystemUnion) MarshalJSON() ([]byte, error)

func (*MessageCountTokensParamsSystemUnion) UnmarshalJSON

func (u *MessageCountTokensParamsSystemUnion) UnmarshalJSON(data []byte) error

type MessageCountTokensToolUnionParam

type MessageCountTokensToolUnionParam struct {
	OfTool                        *ToolParam                        `json:",omitzero,inline"`
	OfBashTool20250124            *ToolBash20250124Param            `json:",omitzero,inline"`
	OfCodeExecutionTool20250522   *CodeExecutionTool20250522Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20250825   *CodeExecutionTool20250825Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20260120   *CodeExecutionTool20260120Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20260521   *CodeExecutionTool20260521Param   `json:",omitzero,inline"`
	OfMemoryTool20250818          *MemoryTool20250818Param          `json:",omitzero,inline"`
	OfTextEditor20250124          *ToolTextEditor20250124Param      `json:",omitzero,inline"`
	OfTextEditor20250429          *ToolTextEditor20250429Param      `json:",omitzero,inline"`
	OfTextEditor20250728          *ToolTextEditor20250728Param      `json:",omitzero,inline"`
	OfWebSearchTool20250305       *WebSearchTool20250305Param       `json:",omitzero,inline"`
	OfWebFetchTool20250910        *WebFetchTool20250910Param        `json:",omitzero,inline"`
	OfWebSearchTool20260209       *WebSearchTool20260209Param       `json:",omitzero,inline"`
	OfWebFetchTool20260209        *WebFetchTool20260209Param        `json:",omitzero,inline"`
	OfWebFetchTool20260309        *WebFetchTool20260309Param        `json:",omitzero,inline"`
	OfWebSearchTool20260318       *WebSearchTool20260318Param       `json:",omitzero,inline"`
	OfWebFetchTool20260318        *WebFetchTool20260318Param        `json:",omitzero,inline"`
	OfToolSearchToolBm25_20251119 *ToolSearchToolBm25_20251119Param `json:",omitzero,inline"`
	OfToolSearchToolRegex20251119 *ToolSearchToolRegex20251119Param `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 MessageCountTokensToolParamOfTool

func MessageCountTokensToolParamOfTool(inputSchema ToolInputSchemaParam, name string) MessageCountTokensToolUnionParam

func (MessageCountTokensToolUnionParam) GetAllowedCallers

func (u MessageCountTokensToolUnionParam) GetAllowedCallers() []string

Returns a pointer to the underlying variant's AllowedCallers property, if present.

func (MessageCountTokensToolUnionParam) GetAllowedDomains

func (u MessageCountTokensToolUnionParam) GetAllowedDomains() []string

Returns a pointer to the underlying variant's AllowedDomains property, if present.

func (MessageCountTokensToolUnionParam) GetBlockedDomains

func (u MessageCountTokensToolUnionParam) GetBlockedDomains() []string

Returns a pointer to the underlying variant's BlockedDomains property, if present.

func (MessageCountTokensToolUnionParam) GetCacheControl

Returns a pointer to the underlying variant's CacheControl property, if present.

func (MessageCountTokensToolUnionParam) GetCitations

Returns a pointer to the underlying variant's Citations property, if present.

func (MessageCountTokensToolUnionParam) GetDeferLoading

func (u MessageCountTokensToolUnionParam) GetDeferLoading() *bool

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetDescription

func (u MessageCountTokensToolUnionParam) GetDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetEagerInputStreaming

func (u MessageCountTokensToolUnionParam) GetEagerInputStreaming() *bool

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetInputExamples

func (u MessageCountTokensToolUnionParam) GetInputExamples() []map[string]any

Returns a pointer to the underlying variant's InputExamples property, if present.

func (MessageCountTokensToolUnionParam) GetInputSchema

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetMaxCharacters

func (u MessageCountTokensToolUnionParam) GetMaxCharacters() *int64

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetMaxContentTokens

func (u MessageCountTokensToolUnionParam) GetMaxContentTokens() *int64

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetMaxUses

func (u MessageCountTokensToolUnionParam) GetMaxUses() *int64

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetName

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetResponseInclusion

func (u MessageCountTokensToolUnionParam) GetResponseInclusion() *string

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetStrict

func (u MessageCountTokensToolUnionParam) GetStrict() *bool

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetType

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetUseCache

func (u MessageCountTokensToolUnionParam) GetUseCache() *bool

Returns a pointer to the underlying variant's property, if present.

func (MessageCountTokensToolUnionParam) GetUserLocation

Returns a pointer to the underlying variant's UserLocation property, if present.

func (MessageCountTokensToolUnionParam) MarshalJSON

func (u MessageCountTokensToolUnionParam) MarshalJSON() ([]byte, error)

func (*MessageCountTokensToolUnionParam) UnmarshalJSON

func (u *MessageCountTokensToolUnionParam) UnmarshalJSON(data []byte) error

type MessageDeltaEvent

type MessageDeltaEvent struct {
	Delta MessageDeltaEventDelta `json:"delta" api:"required"`
	Type  constant.MessageDelta  `json:"type" default:"message_delta"`
	// Billing and rate-limit usage.
	//
	// Juglow's API bills and rate-limits by token counts, as tokens represent the
	// underlying cost to our systems.
	//
	// Under the hood, the API transforms requests into a format suitable for the
	// model. The model's output then goes through a parsing stage before becoming an
	// API response. As a result, the token counts in `usage` will not match one-to-one
	// with the exact visible content of an API request or response.
	//
	// For example, `output_tokens` will be non-zero, even for an empty string response
	// from haijun.
	//
	// Total input tokens in a request is the summation of `input_tokens`,
	// `cache_creation_input_tokens`, and `cache_read_input_tokens`.
	Usage MessageDeltaUsage `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Delta       respjson.Field
		Type        respjson.Field
		Usage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageDeltaEvent) RawJSON

func (r MessageDeltaEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageDeltaEvent) UnmarshalJSON

func (r *MessageDeltaEvent) UnmarshalJSON(data []byte) error

type MessageDeltaEventDelta

type MessageDeltaEventDelta struct {
	// Information about the container used in the request (for the code execution
	// tool)
	Container Container `json:"container" api:"required"`
	// Structured information about a refusal.
	StopDetails RefusalStopDetails `json:"stop_details" api:"required"`
	// Any of "end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn",
	// "refusal", "model_context_window_exceeded".
	StopReason   StopReason `json:"stop_reason" api:"required"`
	StopSequence string     `json:"stop_sequence" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Container    respjson.Field
		StopDetails  respjson.Field
		StopReason   respjson.Field
		StopSequence respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageDeltaEventDelta) RawJSON

func (r MessageDeltaEventDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageDeltaEventDelta) UnmarshalJSON

func (r *MessageDeltaEventDelta) UnmarshalJSON(data []byte) error

type MessageDeltaUsage

type MessageDeltaUsage struct {
	// The cumulative number of input tokens used to create the cache entry.
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// The cumulative number of input tokens read from the cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// The cumulative number of input tokens which were used.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// The cumulative number of output tokens which were used.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// Breakdown of output tokens by category.
	//
	// `output_tokens` remains the inclusive, authoritative total used for billing.
	// This object provides a read-only decomposition for observability — for example,
	// how many of the billed output tokens were spent on internal reasoning that may
	// have been summarized before being returned to you.
	OutputTokensDetails OutputTokensDetails `json:"output_tokens_details" api:"required"`
	// The number of server tool requests.
	ServerToolUse ServerToolUsage `json:"server_tool_use" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InputTokens              respjson.Field
		OutputTokens             respjson.Field
		OutputTokensDetails      respjson.Field
		ServerToolUse            respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageDeltaUsage) RawJSON

func (r MessageDeltaUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageDeltaUsage) UnmarshalJSON

func (r *MessageDeltaUsage) UnmarshalJSON(data []byte) error

type MessageNewParams

type MessageNewParams struct {
	// The maximum number of tokens to generate before stopping.
	//
	// Note that our models may stop _before_ reaching this maximum. This parameter
	// only specifies the absolute maximum number of tokens to generate.
	//
	// Set to `0` to populate the
	// [prompt cache](https://platform.haijun.com/docs/en/build-with-haijun/prompt-caching#pre-warming-the-cache)
	// without generating a response.
	//
	// Different models have different maximum values for this parameter. See
	// [models](https://platform.haijun.com/docs/en/about-haijun/models/overview) for
	// details.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Input messages.
	//
	// Our models are trained to operate on alternating `user` and `assistant`
	// conversational turns. When creating a new `Message`, you specify the prior
	// conversational turns with the `messages` parameter, and the model then generates
	// the next `Message` in the conversation. Consecutive `user` or `assistant` turns
	// in your request will be combined into a single turn.
	//
	// Each input message must be an object with a `role` and `content`. You can
	// specify a single `user`-role message, or you can include multiple `user` and
	// `assistant` messages.
	//
	// If the final message uses the `assistant` role, the response content will
	// continue immediately from the content in that message. This can be used to
	// constrain part of the model's response.
	//
	// Example with a single `user` message:
	//
	// “`json
	// [{ "role": "user", "content": "Hello, haijun" }]
	// “`
	//
	// Example with multiple conversational turns:
	//
	// “`json
	// [
	//
	//	{ "role": "user", "content": "Hello there." },
	//	{ "role": "assistant", "content": "Hi, I'm haijun. How can I help you?" },
	//	{ "role": "user", "content": "Can you explain LLMs in plain English?" }
	//
	// ]
	// “`
	//
	// Example with a partially-filled response from haijun:
	//
	// “`json
	// [
	//
	//	{
	//	  "role": "user",
	//	  "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"
	//	},
	//	{ "role": "assistant", "content": "The best answer is (" }
	//
	// ]
	// “`
	//
	// Each input message `content` may be either a single `string` or an array of
	// content blocks, where each block has a specific `type`. Using a `string` for
	// `content` is shorthand for an array of one content block of type `"text"`. The
	// following input messages are equivalent:
	//
	// “`json
	// { "role": "user", "content": "Hello, haijun" }
	// “`
	//
	// “`json
	// { "role": "user", "content": [{ "type": "text", "text": "Hello, haijun" }] }
	// “`
	//
	// See
	// [input examples](https://platform.haijun.com/docs/en/build-with-haijun/working-with-messages).
	//
	// Note that if you want to include a
	// [system prompt](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role),
	// you can use the top-level `system` parameter — there is no `"system"` role for
	// input messages in the Messages API.
	//
	// There is a limit of 100,000 messages in a single request.
	Messages []MessageParam `json:"messages,omitzero" api:"required"`
	// The model that will complete your prompt.
	//
	// See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional
	// details and options.
	Model Model `json:"model,omitzero" api:"required"`
	// Container identifier for reuse across requests.
	Container param.Opt[string] `json:"container,omitzero"`
	// Specifies the geographic region for inference processing. If not specified, the
	// workspace's `default_inference_geo` is used.
	InferenceGeo param.Opt[string] `json:"inference_geo,omitzero"`
	// Amount of randomness injected into the response.
	//
	// Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0`
	// for analytical / multiple choice, and closer to `1.0` for creative and
	// generative tasks.
	//
	// Note that even with `temperature` of `0.0`, the results will not be fully
	// deterministic.
	Temperature param.Opt[float64] `json:"temperature,omitzero"`
	// Only sample from the top K options for each subsequent token.
	//
	// Used to remove "long tail" low probability responses.
	// [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
	//
	// Recommended for advanced use cases only.
	TopK param.Opt[int64] `json:"top_k,omitzero"`
	// Use nucleus sampling.
	//
	// In nucleus sampling, we compute the cumulative distribution over all the options
	// for each subsequent token in decreasing probability order and cut it off once it
	// reaches a particular probability specified by `top_p`.
	//
	// Recommended for advanced use cases only.
	TopP param.Opt[float64] `json:"top_p,omitzero"`
	// The user profile ID to attribute this request to. Use when acting on behalf of a
	// party other than your organization. Requires the `user-profiles` beta header.
	UserProfileID param.Opt[string] `header:"Juglow-user-profile-id,omitzero" json:"-"`
	// Top-level cache control automatically applies a cache_control marker to the last
	// cacheable block in the request.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// An object describing metadata about the request.
	Metadata MetadataParam `json:"metadata,omitzero"`
	// Configuration options for the model's output, such as the output format.
	OutputConfig OutputConfigParam `json:"output_config,omitzero"`
	// Determines whether to use priority capacity (if available) or standard capacity
	// for this request.
	//
	// Juglow offers different levels of service for your API requests. See
	// [service-tiers](https://platform.haijun.com/docs/en/api/service-tiers) for
	// details.
	//
	// Any of "auto", "standard_only".
	ServiceTier MessageNewParamsServiceTier `json:"service_tier,omitzero"`
	// Custom text sequences that will cause the model to stop generating.
	//
	// Our models will normally stop when they have naturally completed their turn,
	// which will result in a response `stop_reason` of `"end_turn"`.
	//
	// If you want the model to stop generating when it encounters custom strings of
	// text, you can use the `stop_sequences` parameter. If the model encounters one of
	// the custom sequences, the response `stop_reason` value will be `"stop_sequence"`
	// and the response `stop_sequence` value will contain the matched stop sequence.
	StopSequences []string `json:"stop_sequences,omitzero"`
	// System prompt.
	//
	// A system prompt is a way of providing context and instructions to haijun, such
	// as specifying a particular goal or role. See our
	// [guide to system prompts](https://platform.haijun.com/docs/en/build-with-haijun/prompt-engineering/haijun-prompting-best-practices#give-haijun-a-role).
	System []TextBlockParam `json:"system,omitzero"`
	// Configuration for enabling haijun's extended thinking.
	//
	// When enabled, responses include `thinking` content blocks showing haijun's
	// thinking process before the final answer. Requires a minimum budget of 1,024
	// tokens and counts towards your `max_tokens` limit.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	Thinking ThinkingConfigParamUnion `json:"thinking,omitzero"`
	// How the model should use the provided tools. The model can use a specific tool,
	// any available tool, decide by itself, or not use tools at all.
	ToolChoice ToolChoiceUnionParam `json:"tool_choice,omitzero"`
	// Definitions of tools that the model may use.
	//
	// If you include `tools` in your API request, the model may return `tool_use`
	// content blocks that represent the model's use of those tools. You can then run
	// those tools using the tool input generated by the model and then optionally
	// return results back to the model using `tool_result` content blocks.
	//
	// There are two types of tools: **client tools** and **server tools**. The
	// behavior described below applies to client tools. For
	// [server tools](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/server-tools),
	// see their individual documentation as each has its own behavior (e.g., the
	// [web search tool](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/web-search-tool)).
	//
	// Each tool definition includes:
	//
	//   - `name`: Name of the tool.
	//   - `description`: Optional, but strongly-recommended description of the tool.
	//   - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the
	//     tool `input` shape that the model will produce in `tool_use` output content
	//     blocks.
	//
	// For example, if you defined `tools` as:
	//
	// “`json
	// [
	//
	//	{
	//	  "name": "get_stock_price",
	//	  "description": "Get the current stock price for a given ticker symbol.",
	//	  "input_schema": {
	//	    "type": "object",
	//	    "properties": {
	//	      "ticker": {
	//	        "type": "string",
	//	        "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
	//	      }
	//	    },
	//	    "required": ["ticker"]
	//	  }
	//	}
	//
	// ]
	// “`
	//
	// And then asked the model "What's the S&P 500 at today?", the model might produce
	// `tool_use` content blocks in the response like this:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_use",
	//	  "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "name": "get_stock_price",
	//	  "input": { "ticker": "^GSPC" }
	//	}
	//
	// ]
	// “`
	//
	// You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an
	// input, and return the following back to the model in a subsequent `user`
	// message:
	//
	// “`json
	// [
	//
	//	{
	//	  "type": "tool_result",
	//	  "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
	//	  "content": "259.75 USD"
	//	}
	//
	// ]
	// “`
	//
	// Tools can be used for workflows that include running client-side tools and
	// functions, or more generally whenever you want the model to produce a particular
	// JSON structure of output.
	//
	// See our
	// [guide](https://platform.haijun.com/docs/en/agents-and-tools/tool-use/overview)
	// for more details.
	Tools []ToolUnionParam `json:"tools,omitzero"`
	// contains filtered or unexported fields
}

func (MessageNewParams) MarshalJSON

func (r MessageNewParams) MarshalJSON() (data []byte, err error)

func (*MessageNewParams) UnmarshalJSON

func (r *MessageNewParams) UnmarshalJSON(data []byte) error

type MessageNewParamsServiceTier

type MessageNewParamsServiceTier string

Determines whether to use priority capacity (if available) or standard capacity for this request.

Juglow offers different levels of service for your API requests. See [service-tiers](https://platform.haijun.com/docs/en/api/service-tiers) for details.

const (
	MessageNewParamsServiceTierAuto         MessageNewParamsServiceTier = "auto"
	MessageNewParamsServiceTierStandardOnly MessageNewParamsServiceTier = "standard_only"
)

type MessageParam

type MessageParam struct {
	Content []ContentBlockParamUnion `json:"content,omitzero" api:"required"`
	// Any of "user", "assistant", "system".
	Role MessageParamRole `json:"role,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Content, Role are required.

func NewAssistantMessage

func NewAssistantMessage(blocks ...ContentBlockParamUnion) MessageParam

func NewUserMessage

func NewUserMessage(blocks ...ContentBlockParamUnion) MessageParam

func (MessageParam) MarshalJSON

func (r MessageParam) MarshalJSON() (data []byte, err error)

func (*MessageParam) UnmarshalJSON

func (r *MessageParam) UnmarshalJSON(data []byte) error

type MessageParamRole

type MessageParamRole string
const (
	MessageParamRoleUser      MessageParamRole = "user"
	MessageParamRoleAssistant MessageParamRole = "assistant"
	MessageParamRoleSystem    MessageParamRole = "system"
)

type MessageService

type MessageService struct {
	Options []option.RequestOption
	Batches MessageBatchService
}

MessageService contains methods and other services that help with interacting with the Juglow 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 NewMessageService method instead.

func NewMessageService

func NewMessageService(opts ...option.RequestOption) (r MessageService)

NewMessageService 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 (*MessageService) CountTokens

func (r *MessageService) CountTokens(ctx context.Context, params MessageCountTokensParams, opts ...option.RequestOption) (res *MessageTokensCount, err error)

Count the number of tokens in a Message.

The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it.

Learn more about token counting in our [user guide](https://platform.haijun.com/docs/en/build-with-haijun/token-counting)

func (*MessageService) New

func (r *MessageService) New(ctx context.Context, params MessageNewParams, opts ...option.RequestOption) (res *Message, err error)

Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.

The Messages API can be used for either single queries or stateless multi-turn conversations.

Learn more about the Messages API in our [user guide](https://platform.haijun.com/docs/en/get-started)

Note: If you choose to set a timeout for this request, we recommend 10 minutes.

func (*MessageService) NewStreaming

Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation.

The Messages API can be used for either single queries or stateless multi-turn conversations.

Learn more about the Messages API in our [user guide](https://platform.haijun.com/docs/en/get-started)

Note: If you choose to set a timeout for this request, we recommend 10 minutes.

type MessageStartEvent

type MessageStartEvent struct {
	Message Message               `json:"message" api:"required"`
	Type    constant.MessageStart `json:"type" default:"message_start"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageStartEvent) RawJSON

func (r MessageStartEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageStartEvent) UnmarshalJSON

func (r *MessageStartEvent) UnmarshalJSON(data []byte) error

type MessageStopEvent

type MessageStopEvent struct {
	Type constant.MessageStop `json:"type" default:"message_stop"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageStopEvent) RawJSON

func (r MessageStopEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageStopEvent) UnmarshalJSON

func (r *MessageStopEvent) UnmarshalJSON(data []byte) error

type MessageStreamEventUnion

type MessageStreamEventUnion struct {
	// This field is from variant [MessageStartEvent].
	Message Message `json:"message"`
	// Any of "message_start", "message_delta", "message_stop", "content_block_start",
	// "content_block_delta", "content_block_stop".
	Type string `json:"type"`
	// This field is a union of [MessageDeltaEventDelta], [RawContentBlockDeltaUnion]
	Delta MessageStreamEventUnionDelta `json:"delta"`
	// This field is from variant [MessageDeltaEvent].
	Usage MessageDeltaUsage `json:"usage"`
	// This field is from variant [ContentBlockStartEvent].
	ContentBlock ContentBlockStartEventContentBlockUnion `json:"content_block"`
	Index        int64                                   `json:"index"`
	JSON         struct {
		Message      respjson.Field
		Type         respjson.Field
		Delta        respjson.Field
		Usage        respjson.Field
		ContentBlock respjson.Field
		Index        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MessageStreamEventUnion contains all possible properties and values from MessageStartEvent, MessageDeltaEvent, MessageStopEvent, ContentBlockStartEvent, ContentBlockDeltaEvent, ContentBlockStopEvent.

Use the MessageStreamEventUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (MessageStreamEventUnion) AsAny

func (u MessageStreamEventUnion) AsAny() anyMessageStreamEvent

Use the following switch statement to find the correct variant

switch variant := MessageStreamEventUnion.AsAny().(type) {
case Juglow.MessageStartEvent:
case Juglow.MessageDeltaEvent:
case Juglow.MessageStopEvent:
case Juglow.ContentBlockStartEvent:
case Juglow.ContentBlockDeltaEvent:
case Juglow.ContentBlockStopEvent:
default:
  fmt.Errorf("no variant present")
}

func (MessageStreamEventUnion) AsContentBlockDelta

func (u MessageStreamEventUnion) AsContentBlockDelta() (v ContentBlockDeltaEvent)

func (MessageStreamEventUnion) AsContentBlockStart

func (u MessageStreamEventUnion) AsContentBlockStart() (v ContentBlockStartEvent)

func (MessageStreamEventUnion) AsContentBlockStop

func (u MessageStreamEventUnion) AsContentBlockStop() (v ContentBlockStopEvent)

func (MessageStreamEventUnion) AsMessageDelta

func (u MessageStreamEventUnion) AsMessageDelta() (v MessageDeltaEvent)

func (MessageStreamEventUnion) AsMessageStart

func (u MessageStreamEventUnion) AsMessageStart() (v MessageStartEvent)

func (MessageStreamEventUnion) AsMessageStop

func (u MessageStreamEventUnion) AsMessageStop() (v MessageStopEvent)

func (MessageStreamEventUnion) RawJSON

func (u MessageStreamEventUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageStreamEventUnion) UnmarshalJSON

func (r *MessageStreamEventUnion) UnmarshalJSON(data []byte) error

type MessageStreamEventUnionDelta

type MessageStreamEventUnionDelta struct {
	// This field is from variant [MessageDeltaEventDelta].
	Container Container `json:"container"`
	// This field is from variant [MessageDeltaEventDelta].
	StopDetails RefusalStopDetails `json:"stop_details"`
	// This field is from variant [MessageDeltaEventDelta].
	StopReason StopReason `json:"stop_reason"`
	// This field is from variant [MessageDeltaEventDelta].
	StopSequence string `json:"stop_sequence"`
	// This field is from variant [RawContentBlockDeltaUnion].
	Text string `json:"text"`
	Type string `json:"type"`
	// This field is from variant [RawContentBlockDeltaUnion].
	PartialJSON string `json:"partial_json"`
	// This field is from variant [RawContentBlockDeltaUnion].
	Citation CitationsDeltaCitationUnion `json:"citation"`
	// This field is from variant [RawContentBlockDeltaUnion].
	Thinking string `json:"thinking"`
	// This field is from variant [RawContentBlockDeltaUnion].
	Signature string `json:"signature"`
	JSON      struct {
		Container    respjson.Field
		StopDetails  respjson.Field
		StopReason   respjson.Field
		StopSequence respjson.Field
		Text         respjson.Field
		Type         respjson.Field
		PartialJSON  respjson.Field
		Citation     respjson.Field
		Thinking     respjson.Field
		Signature    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MessageStreamEventUnionDelta is an implicit subunion of MessageStreamEventUnion. MessageStreamEventUnionDelta provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the MessageStreamEventUnion.

func (*MessageStreamEventUnionDelta) UnmarshalJSON

func (r *MessageStreamEventUnionDelta) UnmarshalJSON(data []byte) error

type MessageTokensCount

type MessageTokensCount struct {
	// The total number of tokens across the provided list of messages, system prompt,
	// and tools.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		InputTokens respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessageTokensCount) RawJSON

func (r MessageTokensCount) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageTokensCount) UnmarshalJSON

func (r *MessageTokensCount) UnmarshalJSON(data []byte) error

type MetadataParam

type MetadataParam struct {
	// An external identifier for the user who is associated with the request.
	//
	// This should be a uuid, hash value, or other opaque identifier. Juglow may use
	// this id to help detect abuse. Do not include any identifying information such as
	// name, email address, or phone number.
	UserID param.Opt[string] `json:"user_id,omitzero"`
	// contains filtered or unexported fields
}

func (MetadataParam) MarshalJSON

func (r MetadataParam) MarshalJSON() (data []byte, err error)

func (*MetadataParam) UnmarshalJSON

func (r *MetadataParam) UnmarshalJSON(data []byte) error

type MidConversationSystemBlockParam

type MidConversationSystemBlockParam struct {
	// System instruction text blocks.
	Content []TextBlockParam `json:"content,omitzero" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "mid_conv_system".
	Type constant.MidConvSystem `json:"type" default:"mid_conv_system"`
	// contains filtered or unexported fields
}

System instructions that appear mid-conversation.

Use this block to provide or update system-level instructions at a specific point in the conversation, rather than only via the top-level `system` parameter.

The properties Content, Type are required.

func (MidConversationSystemBlockParam) MarshalJSON

func (r MidConversationSystemBlockParam) MarshalJSON() (data []byte, err error)

func (*MidConversationSystemBlockParam) UnmarshalJSON

func (r *MidConversationSystemBlockParam) UnmarshalJSON(data []byte) error

type Model

type Model = string

The model that will complete your prompt.

See [models](https://docs.juglow.my.id/en/docs/models-overview) for additional details and options.

const (
	ModelHaijunSonnet5 Model = "haijun-sonnet-5"
	ModelHaijunFable5  Model = "haijun-fable-5"
	ModelHaijunMythos5 Model = "haijun-mythos-5"
	ModelHaijunOpus5   Model = "haijun-opus-5"
	ModelHaijunOpus4_8 Model = "haijun-opus-4-8"
	ModelHaijunOpus4_7 Model = "haijun-opus-4-7"
	// Deprecated: Will reach end-of-life on June 30, 2026. Please migrate to
	// haijun-mythos-5. Visit
	// https://docs.juglow.my.id/en/docs/resources/model-deprecations for more
	// information.
	ModelHaijunMythosPreview      Model = "haijun-mythos-preview"
	ModelHaijunOpus4_6            Model = "haijun-opus-4-6"
	ModelHaijunSonnet4_6          Model = "haijun-sonnet-4-6"
	ModelHaijunHaiku4_5           Model = "haijun-haiku-4-5"
	ModelHaijunHaiku4_5_20251001  Model = "haijun-haiku-4-5-20251001"
	ModelHaijunOpus4_5            Model = "haijun-opus-4-5"
	ModelHaijunOpus4_5_20251101   Model = "haijun-opus-4-5-20251101"
	ModelHaijunSonnet4_5          Model = "haijun-sonnet-4-5"
	ModelHaijunSonnet4_5_20250929 Model = "haijun-sonnet-4-5-20250929"
)

type ModelCapabilities

type ModelCapabilities struct {
	// Whether the model supports the Batch API.
	Batch CapabilitySupport `json:"batch" api:"required"`
	// Whether the model supports citation generation.
	Citations CapabilitySupport `json:"citations" api:"required"`
	// Whether the model supports code execution tools.
	CodeExecution CapabilitySupport `json:"code_execution" api:"required"`
	// Context management support and available strategies.
	ContextManagement ContextManagementCapability `json:"context_management" api:"required"`
	// Effort (reasoning_effort) support and available levels.
	Effort EffortCapability `json:"effort" api:"required"`
	// Whether the model accepts image content blocks.
	ImageInput CapabilitySupport `json:"image_input" api:"required"`
	// Whether the model accepts PDF content blocks.
	PDFInput CapabilitySupport `json:"pdf_input" api:"required"`
	// Whether the model supports structured output / JSON mode / strict tool schemas.
	StructuredOutputs CapabilitySupport `json:"structured_outputs" api:"required"`
	// Thinking capability and supported type configurations.
	Thinking ThinkingCapability `json:"thinking" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Batch             respjson.Field
		Citations         respjson.Field
		CodeExecution     respjson.Field
		ContextManagement respjson.Field
		Effort            respjson.Field
		ImageInput        respjson.Field
		PDFInput          respjson.Field
		StructuredOutputs respjson.Field
		Thinking          respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Model capability information.

func (ModelCapabilities) RawJSON

func (r ModelCapabilities) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelCapabilities) UnmarshalJSON

func (r *ModelCapabilities) UnmarshalJSON(data []byte) error

type ModelGetParams

type ModelGetParams struct {
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

type ModelInfo

type ModelInfo struct {
	// Unique model identifier.
	ID string `json:"id" api:"required"`
	// Model capability information.
	Capabilities ModelCapabilities `json:"capabilities" api:"required"`
	// RFC 3339 datetime string representing the time at which the model was released.
	// May be set to an epoch value if the release date is unknown.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// A human-readable name for the model.
	DisplayName string `json:"display_name" api:"required"`
	// Maximum input context window size in tokens for this model.
	MaxInputTokens int64 `json:"max_input_tokens" api:"required"`
	// Maximum value for the `max_tokens` parameter when using this model.
	MaxTokens int64 `json:"max_tokens" api:"required"`
	// Object type.
	//
	// For Models, this is always `"model"`.
	Type constant.Model `json:"type" default:"model"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Capabilities   respjson.Field
		CreatedAt      respjson.Field
		DisplayName    respjson.Field
		MaxInputTokens respjson.Field
		MaxTokens      respjson.Field
		Type           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ModelInfo) RawJSON

func (r ModelInfo) RawJSON() string

Returns the unmodified JSON received from the API

func (*ModelInfo) UnmarshalJSON

func (r *ModelInfo) UnmarshalJSON(data []byte) error

type ModelListParams

type ModelListParams struct {
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately after this object.
	AfterID param.Opt[string] `query:"after_id,omitzero" json:"-"`
	// ID of the object to use as a cursor for pagination. When provided, returns the
	// page of results immediately before this object.
	BeforeID param.Opt[string] `query:"before_id,omitzero" json:"-"`
	// Number of items to return per page.
	//
	// Defaults to `20`. Ranges from `1` to `1000`.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Optional header to specify the beta version(s) you want to use.
	Betas []JuglowBeta `header:"Juglow-beta,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ModelListParams) URLQuery

func (r ModelListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ModelListParams's query parameters as `url.Values`.

type ModelService

type ModelService struct {
	Options []option.RequestOption
}

ModelService contains methods and other services that help with interacting with the Juglow API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelService method instead.

func NewModelService

func NewModelService(opts ...option.RequestOption) (r ModelService)

NewModelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ModelService) Get

func (r *ModelService) Get(ctx context.Context, modelID string, query ModelGetParams, opts ...option.RequestOption) (res *ModelInfo, err error)

Get a specific model.

The Models API response can be used to determine information about a specific model or resolve a model alias to a model ID.

func (*ModelService) List

func (r *ModelService) List(ctx context.Context, params ModelListParams, opts ...option.RequestOption) (res *pagination.Page[ModelInfo], err error)

List available models.

The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.

func (*ModelService) ListAutoPaging

List available models.

The Models API response can be used to determine which models are available for use in the API. More recently released models are listed first.

type NotFoundError

type NotFoundError = shared.NotFoundError

This is an alias to an internal type.

type OutputConfigEffort

type OutputConfigEffort string

All possible effort levels.

const (
	OutputConfigEffortLow    OutputConfigEffort = "low"
	OutputConfigEffortMedium OutputConfigEffort = "medium"
	OutputConfigEffortHigh   OutputConfigEffort = "high"
	OutputConfigEffortXhigh  OutputConfigEffort = "xhigh"
	OutputConfigEffortMax    OutputConfigEffort = "max"
)

type OutputConfigParam

type OutputConfigParam struct {
	// All possible effort levels.
	//
	// Any of "low", "medium", "high", "xhigh", "max".
	Effort OutputConfigEffort `json:"effort,omitzero"`
	// A schema to specify haijun's output format in responses. See
	// [structured outputs](https://platform.haijun.com/docs/en/build-with-haijun/structured-outputs)
	Format JSONOutputFormatParam `json:"format,omitzero"`
	// contains filtered or unexported fields
}

func (OutputConfigParam) MarshalJSON

func (r OutputConfigParam) MarshalJSON() (data []byte, err error)

func (*OutputConfigParam) UnmarshalJSON

func (r *OutputConfigParam) UnmarshalJSON(data []byte) error

type OutputTokensDetails

type OutputTokensDetails struct {
	// Number of output tokens the model generated as internal reasoning, including the
	// thinking-block delimiter tokens.
	//
	// Reflects the raw reasoning the model produced, not the (possibly shorter)
	// summarized thinking text returned in the response body. Computed by
	// re-tokenizing the raw reasoning text, so it may differ from the model's exact
	// generation count by a small number of tokens. Always ≤ `output_tokens`;
	// `output_tokens - thinking_tokens` approximates the non-reasoning output.
	ThinkingTokens int64 `json:"thinking_tokens" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ThinkingTokens respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OutputTokensDetails) RawJSON

func (r OutputTokensDetails) RawJSON() string

Returns the unmodified JSON received from the API

func (*OutputTokensDetails) UnmarshalJSON

func (r *OutputTokensDetails) UnmarshalJSON(data []byte) error

type OverloadedError

type OverloadedError = shared.OverloadedError

This is an alias to an internal type.

type PermissionError

type PermissionError = shared.PermissionError

This is an alias to an internal type.

type PlainTextSource

type PlainTextSource struct {
	Data      string             `json:"data" api:"required"`
	MediaType constant.TextPlain `json:"media_type" default:"text/plain"`
	Type      constant.Text      `json:"type" default:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		MediaType   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PlainTextSource) RawJSON

func (r PlainTextSource) RawJSON() string

Returns the unmodified JSON received from the API

func (PlainTextSource) ToParam

ToParam converts this PlainTextSource to a PlainTextSourceParam.

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 PlainTextSourceParam.Overrides()

func (*PlainTextSource) UnmarshalJSON

func (r *PlainTextSource) UnmarshalJSON(data []byte) error

type PlainTextSourceParam

type PlainTextSourceParam struct {
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as "text/plain".
	MediaType constant.TextPlain `json:"media_type" default:"text/plain"`
	// This field can be elided, and will marshal its zero value as "text".
	Type constant.Text `json:"type" default:"text"`
	// contains filtered or unexported fields
}

The properties Data, MediaType, Type are required.

func (PlainTextSourceParam) MarshalJSON

func (r PlainTextSourceParam) MarshalJSON() (data []byte, err error)

func (*PlainTextSourceParam) UnmarshalJSON

func (r *PlainTextSourceParam) UnmarshalJSON(data []byte) error

type RateLimitError

type RateLimitError = shared.RateLimitError

This is an alias to an internal type.

type RawContentBlockDeltaUnion

type RawContentBlockDeltaUnion struct {
	// This field is from variant [TextDelta].
	Text string `json:"text"`
	// Any of "text_delta", "input_json_delta", "citations_delta", "thinking_delta",
	// "signature_delta".
	Type string `json:"type"`
	// This field is from variant [InputJSONDelta].
	PartialJSON string `json:"partial_json"`
	// This field is from variant [CitationsDelta].
	Citation CitationsDeltaCitationUnion `json:"citation"`
	// This field is from variant [ThinkingDelta].
	Thinking string `json:"thinking"`
	// This field is from variant [SignatureDelta].
	Signature string `json:"signature"`
	JSON      struct {
		Text        respjson.Field
		Type        respjson.Field
		PartialJSON respjson.Field
		Citation    respjson.Field
		Thinking    respjson.Field
		Signature   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

RawContentBlockDeltaUnion contains all possible properties and values from TextDelta, InputJSONDelta, CitationsDelta, ThinkingDelta, SignatureDelta.

Use the RawContentBlockDeltaUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (RawContentBlockDeltaUnion) AsAny

func (u RawContentBlockDeltaUnion) AsAny() anyRawContentBlockDelta

Use the following switch statement to find the correct variant

switch variant := RawContentBlockDeltaUnion.AsAny().(type) {
case Juglow.TextDelta:
case Juglow.InputJSONDelta:
case Juglow.CitationsDelta:
case Juglow.ThinkingDelta:
case Juglow.SignatureDelta:
default:
  fmt.Errorf("no variant present")
}

func (RawContentBlockDeltaUnion) AsCitationsDelta

func (u RawContentBlockDeltaUnion) AsCitationsDelta() (v CitationsDelta)

func (RawContentBlockDeltaUnion) AsInputJSONDelta

func (u RawContentBlockDeltaUnion) AsInputJSONDelta() (v InputJSONDelta)

func (RawContentBlockDeltaUnion) AsSignatureDelta

func (u RawContentBlockDeltaUnion) AsSignatureDelta() (v SignatureDelta)

func (RawContentBlockDeltaUnion) AsTextDelta

func (u RawContentBlockDeltaUnion) AsTextDelta() (v TextDelta)

func (RawContentBlockDeltaUnion) AsThinkingDelta

func (u RawContentBlockDeltaUnion) AsThinkingDelta() (v ThinkingDelta)

func (RawContentBlockDeltaUnion) RawJSON

func (u RawContentBlockDeltaUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*RawContentBlockDeltaUnion) UnmarshalJSON

func (r *RawContentBlockDeltaUnion) UnmarshalJSON(data []byte) error

type RedactedThinkingBlock

type RedactedThinkingBlock struct {
	// The contents of this redacted thinking block, returned when portions of the
	// model's thinking were safety-redacted. This field is opaque and encrypted, with
	// no readable content.
	//
	// Pass `redacted_thinking` blocks back to the API unchanged when continuing a
	// multi-turn conversation.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking#redacted-thinking-blocks)
	// for details.
	Data string                    `json:"data" api:"required"`
	Type constant.RedactedThinking `json:"type" default:"redacted_thinking"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RedactedThinkingBlock) RawJSON

func (r RedactedThinkingBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (RedactedThinkingBlock) ToParam

func (*RedactedThinkingBlock) UnmarshalJSON

func (r *RedactedThinkingBlock) UnmarshalJSON(data []byte) error

type RedactedThinkingBlockParam

type RedactedThinkingBlockParam struct {
	// The `data` value of this redacted thinking block, exactly as returned by the API
	// in a previous response. Opaque and encrypted; pass it back unchanged.
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "redacted_thinking".
	Type constant.RedactedThinking `json:"type" default:"redacted_thinking"`
	// contains filtered or unexported fields
}

The properties Data, Type are required.

func (RedactedThinkingBlockParam) MarshalJSON

func (r RedactedThinkingBlockParam) MarshalJSON() (data []byte, err error)

func (*RedactedThinkingBlockParam) UnmarshalJSON

func (r *RedactedThinkingBlockParam) UnmarshalJSON(data []byte) error

type RefusalStopDetails

type RefusalStopDetails struct {
	// The policy category that triggered a refusal.
	//
	// Any of "cyber", "bio", "frontier_llm", "reasoning_extraction", "general_harms".
	Category RefusalStopDetailsCategory `json:"category" api:"required"`
	// Human-readable explanation of the refusal.
	//
	// This text is not guaranteed to be stable. `null` when no explanation is
	// available for the category.
	Explanation string           `json:"explanation" api:"required"`
	Type        constant.Refusal `json:"type" default:"refusal"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Category    respjson.Field
		Explanation respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Structured information about a refusal.

func (RefusalStopDetails) RawJSON

func (r RefusalStopDetails) RawJSON() string

Returns the unmodified JSON received from the API

func (*RefusalStopDetails) UnmarshalJSON

func (r *RefusalStopDetails) UnmarshalJSON(data []byte) error

type RefusalStopDetailsCategory

type RefusalStopDetailsCategory string

The policy category that triggered a refusal.

const (
	RefusalStopDetailsCategoryCyber               RefusalStopDetailsCategory = "cyber"
	RefusalStopDetailsCategoryBio                 RefusalStopDetailsCategory = "bio"
	RefusalStopDetailsCategoryFrontierLLM         RefusalStopDetailsCategory = "frontier_llm"
	RefusalStopDetailsCategoryReasoningExtraction RefusalStopDetailsCategory = "reasoning_extraction"
	RefusalStopDetailsCategoryGeneralHarms        RefusalStopDetailsCategory = "general_harms"
)

type SearchResultBlockParam

type SearchResultBlockParam struct {
	Content []TextBlockParam `json:"content,omitzero" api:"required"`
	Source  string           `json:"source" api:"required"`
	Title   string           `json:"title" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	Citations    CitationsConfigParam       `json:"citations,omitzero"`
	// This field can be elided, and will marshal its zero value as "search_result".
	Type constant.SearchResult `json:"type" default:"search_result"`
	// contains filtered or unexported fields
}

The properties Content, Source, Title, Type are required.

func (SearchResultBlockParam) MarshalJSON

func (r SearchResultBlockParam) MarshalJSON() (data []byte, err error)

func (*SearchResultBlockParam) UnmarshalJSON

func (r *SearchResultBlockParam) UnmarshalJSON(data []byte) error

type ServerToolCaller

type ServerToolCaller struct {
	ToolID string                         `json:"tool_id" api:"required"`
	Type   constant.CodeExecution20250825 `json:"type" default:"code_execution_20250825"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ToolID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Tool invocation generated by a server-side tool.

func (ServerToolCaller) RawJSON

func (r ServerToolCaller) RawJSON() string

Returns the unmodified JSON received from the API

func (ServerToolCaller) ToParam

ToParam converts this ServerToolCaller to a ServerToolCallerParam.

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 ServerToolCallerParam.Overrides()

func (*ServerToolCaller) UnmarshalJSON

func (r *ServerToolCaller) UnmarshalJSON(data []byte) error

type ServerToolCaller20260120

type ServerToolCaller20260120 struct {
	ToolID string                         `json:"tool_id" api:"required"`
	Type   constant.CodeExecution20260120 `json:"type" default:"code_execution_20260120"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ToolID      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ServerToolCaller20260120) RawJSON

func (r ServerToolCaller20260120) RawJSON() string

Returns the unmodified JSON received from the API

func (ServerToolCaller20260120) ToParam

ToParam converts this ServerToolCaller20260120 to a ServerToolCaller20260120Param.

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 ServerToolCaller20260120Param.Overrides()

func (*ServerToolCaller20260120) UnmarshalJSON

func (r *ServerToolCaller20260120) UnmarshalJSON(data []byte) error

type ServerToolCaller20260120Param

type ServerToolCaller20260120Param struct {
	ToolID string `json:"tool_id" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20260120".
	Type constant.CodeExecution20260120 `json:"type" default:"code_execution_20260120"`
	// contains filtered or unexported fields
}

The properties ToolID, Type are required.

func (ServerToolCaller20260120Param) MarshalJSON

func (r ServerToolCaller20260120Param) MarshalJSON() (data []byte, err error)

func (*ServerToolCaller20260120Param) UnmarshalJSON

func (r *ServerToolCaller20260120Param) UnmarshalJSON(data []byte) error

type ServerToolCallerParam

type ServerToolCallerParam struct {
	ToolID string `json:"tool_id" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "code_execution_20250825".
	Type constant.CodeExecution20250825 `json:"type" default:"code_execution_20250825"`
	// contains filtered or unexported fields
}

Tool invocation generated by a server-side tool.

The properties ToolID, Type are required.

func (ServerToolCallerParam) MarshalJSON

func (r ServerToolCallerParam) MarshalJSON() (data []byte, err error)

func (*ServerToolCallerParam) UnmarshalJSON

func (r *ServerToolCallerParam) UnmarshalJSON(data []byte) error

type ServerToolUsage

type ServerToolUsage struct {
	// The number of web fetch tool requests.
	WebFetchRequests int64 `json:"web_fetch_requests" api:"required"`
	// The number of web search tool requests.
	WebSearchRequests int64 `json:"web_search_requests" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		WebFetchRequests  respjson.Field
		WebSearchRequests respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ServerToolUsage) RawJSON

func (r ServerToolUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ServerToolUsage) UnmarshalJSON

func (r *ServerToolUsage) UnmarshalJSON(data []byte) error

type ServerToolUseBlock

type ServerToolUseBlock struct {
	ID string `json:"id" api:"required"`
	// Tool invocation directly from the model.
	Caller ServerToolUseBlockCallerUnion `json:"caller" api:"required"`
	Input  any                           `json:"input" api:"required"`
	// Any of "web_search", "web_fetch", "code_execution", "bash_code_execution",
	// "text_editor_code_execution", "tool_search_tool_regex", "tool_search_tool_bm25".
	Name ServerToolUseBlockName `json:"name" api:"required"`
	Type constant.ServerToolUse `json:"type" default:"server_tool_use"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Caller      respjson.Field
		Input       respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ServerToolUseBlock) RawJSON

func (r ServerToolUseBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (ServerToolUseBlock) ToParam

func (*ServerToolUseBlock) UnmarshalJSON

func (r *ServerToolUseBlock) UnmarshalJSON(data []byte) error

type ServerToolUseBlockCallerUnion

type ServerToolUseBlockCallerUnion struct {
	// Any of "direct", "code_execution_20250825", "code_execution_20260120".
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ServerToolUseBlockCallerUnion contains all possible properties and values from DirectCaller, ServerToolCaller, ServerToolCaller20260120.

Use the ServerToolUseBlockCallerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ServerToolUseBlockCallerUnion) AsAny

func (u ServerToolUseBlockCallerUnion) AsAny() anyServerToolUseBlockCaller

Use the following switch statement to find the correct variant

switch variant := ServerToolUseBlockCallerUnion.AsAny().(type) {
case Juglow.DirectCaller:
case Juglow.ServerToolCaller:
case Juglow.ServerToolCaller20260120:
default:
  fmt.Errorf("no variant present")
}

func (ServerToolUseBlockCallerUnion) AsCodeExecution20250825

func (u ServerToolUseBlockCallerUnion) AsCodeExecution20250825() (v ServerToolCaller)

func (ServerToolUseBlockCallerUnion) AsCodeExecution20260120

func (u ServerToolUseBlockCallerUnion) AsCodeExecution20260120() (v ServerToolCaller20260120)

func (ServerToolUseBlockCallerUnion) AsDirect

func (ServerToolUseBlockCallerUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ServerToolUseBlockCallerUnion) UnmarshalJSON

func (r *ServerToolUseBlockCallerUnion) UnmarshalJSON(data []byte) error

type ServerToolUseBlockName

type ServerToolUseBlockName string
const (
	ServerToolUseBlockNameWebSearch               ServerToolUseBlockName = "web_search"
	ServerToolUseBlockNameWebFetch                ServerToolUseBlockName = "web_fetch"
	ServerToolUseBlockNameCodeExecution           ServerToolUseBlockName = "code_execution"
	ServerToolUseBlockNameBashCodeExecution       ServerToolUseBlockName = "bash_code_execution"
	ServerToolUseBlockNameTextEditorCodeExecution ServerToolUseBlockName = "text_editor_code_execution"
	ServerToolUseBlockNameToolSearchToolRegex     ServerToolUseBlockName = "tool_search_tool_regex"
	ServerToolUseBlockNameToolSearchToolBm25      ServerToolUseBlockName = "tool_search_tool_bm25"
)

type ServerToolUseBlockParam

type ServerToolUseBlockParam struct {
	ID    string `json:"id" api:"required"`
	Input any    `json:"input,omitzero" api:"required"`
	// Any of "web_search", "web_fetch", "code_execution", "bash_code_execution",
	// "text_editor_code_execution", "tool_search_tool_regex", "tool_search_tool_bm25".
	Name ServerToolUseBlockParamName `json:"name,omitzero" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Tool invocation directly from the model.
	Caller ServerToolUseBlockParamCallerUnion `json:"caller,omitzero"`
	// This field can be elided, and will marshal its zero value as "server_tool_use".
	Type constant.ServerToolUse `json:"type" default:"server_tool_use"`
	// contains filtered or unexported fields
}

The properties ID, Input, Name, Type are required.

func (ServerToolUseBlockParam) MarshalJSON

func (r ServerToolUseBlockParam) MarshalJSON() (data []byte, err error)

func (*ServerToolUseBlockParam) UnmarshalJSON

func (r *ServerToolUseBlockParam) UnmarshalJSON(data []byte) error

type ServerToolUseBlockParamCallerUnion

type ServerToolUseBlockParamCallerUnion struct {
	OfDirect                *DirectCallerParam             `json:",omitzero,inline"`
	OfCodeExecution20250825 *ServerToolCallerParam         `json:",omitzero,inline"`
	OfCodeExecution20260120 *ServerToolCaller20260120Param `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 (ServerToolUseBlockParamCallerUnion) GetToolID

Returns a pointer to the underlying variant's property, if present.

func (ServerToolUseBlockParamCallerUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (ServerToolUseBlockParamCallerUnion) MarshalJSON

func (u ServerToolUseBlockParamCallerUnion) MarshalJSON() ([]byte, error)

func (*ServerToolUseBlockParamCallerUnion) UnmarshalJSON

func (u *ServerToolUseBlockParamCallerUnion) UnmarshalJSON(data []byte) error

type ServerToolUseBlockParamName

type ServerToolUseBlockParamName string
const (
	ServerToolUseBlockParamNameWebSearch               ServerToolUseBlockParamName = "web_search"
	ServerToolUseBlockParamNameWebFetch                ServerToolUseBlockParamName = "web_fetch"
	ServerToolUseBlockParamNameCodeExecution           ServerToolUseBlockParamName = "code_execution"
	ServerToolUseBlockParamNameBashCodeExecution       ServerToolUseBlockParamName = "bash_code_execution"
	ServerToolUseBlockParamNameTextEditorCodeExecution ServerToolUseBlockParamName = "text_editor_code_execution"
	ServerToolUseBlockParamNameToolSearchToolRegex     ServerToolUseBlockParamName = "tool_search_tool_regex"
	ServerToolUseBlockParamNameToolSearchToolBm25      ServerToolUseBlockParamName = "tool_search_tool_bm25"
)

type SessionToolRunner

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

SessionToolRunner attaches to a managed-agents session, executes incoming agent.tool_use and agent.custom_tool_use events via a local tool registry, and posts the matching user.tool_result / user.custom_tool_result events back. agent.mcp_tool_use events are left alone — MCP tools are server-side. It is the sessions-side counterpart to (*BetaMessageService).NewToolRunner: it does ONLY the tool-execution loop — attach to the event stream, reconcile via the events list endpoint, dispatch the registered tools, post results, and the idle-after-end_turn timeout. Lease heartbeating, work claiming, and track download are not its concern — see github.com/takebox/juglow-sdk-go/lib/environments.EnvironmentWorker for the full self-hosted runner composition.

A SessionToolRunner is NOT safe for concurrent use. All methods must be called from a single goroutine. Tool BetaTool.Execute handlers ARE called from a background goroutine, but only one at a time per runner (serial execution per the agent.tool_use contract).

A call the server gated with evaluated_permission "ask" (the always_ask policy — or any unrecognized value, failing closed) is held until its user.tool_confirmation arrives: only an explicit "allow" runs it. A "deny" verdict — or a call the server already evaluated to "deny" — is never executed and posts nothing, but IS yielded (Confirmation="deny", Posted=false, no Result) so the caller can observe it. While a call is held the server parks the session at stop_reason "requires_action" and the runner waits until the verdict arrives, the session terminates, or ctx is cancelled — wrap in [environments.EnvironmentWorker] for lease-driven detach, or pass a context.WithTimeout for a wall-clock bound.

Tool lifetime is the caller's responsibility; the runner never closes tools, so the same Tools slice can be reused across multiple sessions.

Typical usage:

r := client.Beta.Sessions.Events.NewToolRunner(ctx, sessionID, Juglow.SessionToolRunnerOptions{
    Tools: agenttoolset.BetaAgentToolset20260401(&agenttoolset.AgentToolContext{Workdir: "."}),
})
defer r.Close()
for r.Next() {
    call := r.Current()
    // observe call.Name, call.IsError, call.Posted
}
if err := r.Err(); err != nil && !errors.Is(err, Juglow.ErrSessionTerminated) {
    log.Print(err)
}

func NewSessionToolRunner

func NewSessionToolRunner(ctx context.Context, client Client, sessionID string, opts SessionToolRunnerOptions) *SessionToolRunner

NewSessionToolRunner is the package-level equivalent of (*BetaSessionEventService).NewToolRunner — useful when you have a Client value. Prefer client.Beta.Sessions.Events.NewToolRunner in new code.

func (*SessionToolRunner) All

All returns a Go 1.23 range-over-func iterator yielding DispatchedToolCall values. On the final iteration err carries Err.

func (*SessionToolRunner) Close

func (r *SessionToolRunner) Close() error

Close stops all background goroutines and waits for the cleanup goroutine (which drains in-flight tools) to finish. Safe to call multiple times. Always returns nil — the signature satisfies io.Closer so callers can `defer r.Close()` uniformly. The runner never closes the tools it was given.

func (*SessionToolRunner) Current

Current returns the most recent DispatchedToolCall. Only valid after Next returned true.

func (*SessionToolRunner) Err

func (r *SessionToolRunner) Err() error

Err returns the first non-recoverable error, or nil if iteration ended via the consumer's ctx cancellation or Close. Distinguish causes with errors.Is against ErrSessionTerminated and ErrIdleTimeout. Construction-time option errors are surfaced here as well.

func (*SessionToolRunner) Next

func (r *SessionToolRunner) Next() bool

Next advances the runner. Returns true if a new DispatchedToolCall is available via Current. Returns false when the bound context is cancelled, Close has been called, the session terminated, or MaxIdle elapsed (check Err to distinguish).

type SessionToolRunnerOptions

type SessionToolRunnerOptions struct {
	// Tools is the registry of locally-executable tools, in the same
	// [BetaTool] shape (*BetaMessageService).NewToolRunner accepts. The runner
	// looks up each agent.tool_use and agent.custom_tool_use event's Name
	// against this slice and routes to the matching tool. Use
	// agenttoolset.BetaAgentToolset20260401(env) (from
	// github.com/takebox/juglow-sdk-go/tools/agenttoolset) for the
	// standard agent_toolset_20260401 set; filter or extend the slice to
	// customise. Tool lifetime — including Close on tools that implement
	// io.Closer — is the caller's responsibility: the runner never closes
	// tools, so the same slice can be reused across multiple sessions.
	Tools []BetaTool

	// MaxIdle is how long the runner keeps running after the session goes idle
	// with stop_reason "end_turn" before it stops; any new event resets the
	// countdown and it re-arms on the next "end_turn" idle. The countdown is
	// deferred while a confirmation-gated call is held or still dispatching,
	// and starts fresh once the last such call resolves. nil uses
	// [DefaultMaxIdle] (60s). A non-nil value <= 0 disables it — the runner
	// then only stops on session termination, the consumer breaking out, or
	// ctx cancellation.
	MaxIdle *time.Duration

	// Logger receives non-fatal warnings (transient stream errors, send
	// retries). Defaults to slog.Default().
	Logger *slog.Logger

	// RequestOptions are applied to every request the runner issues — the
	// event stream, the reconcile list, and the tool-result send. The runner
	// additionally tags each request with an x-stainless-helper header of
	// its own (appended last, so it always wins on a collision with a
	// caller-supplied tag).
	//
	// Self-hosted-environment callers must pass the environment key here.
	// option.WithAuthToken alone only ADDS an Authorization header — the
	// parent client's WithAPIKey middleware still emits X-Api-Key on every
	// request, so both creds would land on the wire and the server rejects
	// the dual auth on the events stream. Pair the bearer with an explicit
	// X-Api-Key delete:
	//
	//	RequestOptions: []option.RequestOption{
	//		option.WithHeaderDel("X-Api-Key"),
	//		option.WithAuthToken(environmentKey),
	//	}
	RequestOptions []option.RequestOption

	// ToolTimeout bounds a single tool's Execute call; a tool that runs longer
	// is cancelled and reported as an error result. Zero uses the default of
	// 120s.
	ToolTimeout time.Duration

	// SendTimeout bounds a single attempt to post a tool-result event back to
	// the session (the runner still retries transient failures up to
	// sessionRunnerSendRetries times). Zero uses the default of 15s.
	SendTimeout time.Duration

	// DrainTimeout bounds how long Close waits for in-flight tool executions
	// to finish before it logs a warning and returns. Zero uses the default of
	// 30s.
	DrainTimeout time.Duration
}

SessionToolRunnerOptions configures a SessionToolRunner. The managed-agents session id is not part of this struct — it is a positional argument to NewToolRunner, matching list/send/stream on the events resource.

type SignatureDelta

type SignatureDelta struct {
	// The `signature` for this thinking block: an opaque value used to verify that the
	// block was generated by haijun when it is passed back to the API. Delivered in a
	// `signature_delta` event just before the block's `content_block_stop` event.
	Signature string                  `json:"signature" api:"required"`
	Type      constant.SignatureDelta `json:"type" default:"signature_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Signature   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SignatureDelta) RawJSON

func (r SignatureDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*SignatureDelta) UnmarshalJSON

func (r *SignatureDelta) UnmarshalJSON(data []byte) error

type StopReason

type StopReason string
const (
	StopReasonEndTurn                    StopReason = "end_turn"
	StopReasonMaxTokens                  StopReason = "max_tokens"
	StopReasonStopSequence               StopReason = "stop_sequence"
	StopReasonToolUse                    StopReason = "tool_use"
	StopReasonPauseTurn                  StopReason = "pause_turn"
	StopReasonRefusal                    StopReason = "refusal"
	StopReasonModelContextWindowExceeded StopReason = "model_context_window_exceeded"
)

type TextBlock

type TextBlock struct {
	// Citations supporting the text block.
	//
	// The type of citation returned will depend on the type of document being cited.
	// Citing a PDF results in `page_location`, plain text results in `char_location`,
	// and content document results in `content_block_location`.
	Citations []TextCitationUnion `json:"citations" api:"required"`
	Text      string              `json:"text" api:"required"`
	Type      constant.Text       `json:"type" default:"text"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Citations   respjson.Field
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TextBlock) RawJSON

func (r TextBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (TextBlock) ToParam

func (r TextBlock) ToParam() TextBlockParam

func (*TextBlock) UnmarshalJSON

func (r *TextBlock) UnmarshalJSON(data []byte) error

type TextBlockParam

type TextBlockParam struct {
	Text      string                   `json:"text" api:"required"`
	Citations []TextCitationParamUnion `json:"citations,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "text".
	Type constant.Text `json:"type" default:"text"`
	// contains filtered or unexported fields
}

The properties Text, Type are required.

func (TextBlockParam) MarshalJSON

func (r TextBlockParam) MarshalJSON() (data []byte, err error)

func (*TextBlockParam) UnmarshalJSON

func (r *TextBlockParam) UnmarshalJSON(data []byte) error

type TextCitationParamUnion

type TextCitationParamUnion struct {
	OfCharLocation            *CitationCharLocationParam            `json:",omitzero,inline"`
	OfPageLocation            *CitationPageLocationParam            `json:",omitzero,inline"`
	OfContentBlockLocation    *CitationContentBlockLocationParam    `json:",omitzero,inline"`
	OfWebSearchResultLocation *CitationWebSearchResultLocationParam `json:",omitzero,inline"`
	OfSearchResultLocation    *CitationSearchResultLocationParam    `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 (TextCitationParamUnion) GetCitedText

func (u TextCitationParamUnion) GetCitedText() *string

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetDocumentIndex

func (u TextCitationParamUnion) GetDocumentIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetDocumentTitle

func (u TextCitationParamUnion) GetDocumentTitle() *string

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetEncryptedIndex

func (u TextCitationParamUnion) GetEncryptedIndex() *string

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetEndBlockIndex

func (u TextCitationParamUnion) GetEndBlockIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetEndCharIndex

func (u TextCitationParamUnion) GetEndCharIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetEndPageNumber

func (u TextCitationParamUnion) GetEndPageNumber() *int64

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetSearchResultIndex

func (u TextCitationParamUnion) GetSearchResultIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetSource

func (u TextCitationParamUnion) GetSource() *string

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetStartBlockIndex

func (u TextCitationParamUnion) GetStartBlockIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetStartCharIndex

func (u TextCitationParamUnion) GetStartCharIndex() *int64

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetStartPageNumber

func (u TextCitationParamUnion) GetStartPageNumber() *int64

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetTitle

func (u TextCitationParamUnion) GetTitle() *string

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetType

func (u TextCitationParamUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) GetURL

func (u TextCitationParamUnion) GetURL() *string

Returns a pointer to the underlying variant's property, if present.

func (TextCitationParamUnion) MarshalJSON

func (u TextCitationParamUnion) MarshalJSON() ([]byte, error)

func (*TextCitationParamUnion) UnmarshalJSON

func (u *TextCitationParamUnion) UnmarshalJSON(data []byte) error

type TextCitationUnion

type TextCitationUnion struct {
	CitedText     string `json:"cited_text"`
	DocumentIndex int64  `json:"document_index"`
	DocumentTitle string `json:"document_title"`
	// This field is from variant [CitationCharLocation].
	EndCharIndex int64  `json:"end_char_index"`
	FileID       string `json:"file_id"`
	// This field is from variant [CitationCharLocation].
	StartCharIndex int64 `json:"start_char_index"`
	// Any of "char_location", "page_location", "content_block_location",
	// "web_search_result_location", "search_result_location".
	Type string `json:"type"`
	// This field is from variant [CitationPageLocation].
	EndPageNumber int64 `json:"end_page_number"`
	// This field is from variant [CitationPageLocation].
	StartPageNumber int64 `json:"start_page_number"`
	EndBlockIndex   int64 `json:"end_block_index"`
	StartBlockIndex int64 `json:"start_block_index"`
	// This field is from variant [CitationsWebSearchResultLocation].
	EncryptedIndex string `json:"encrypted_index"`
	Title          string `json:"title"`
	// This field is from variant [CitationsWebSearchResultLocation].
	URL string `json:"url"`
	// This field is from variant [CitationsSearchResultLocation].
	SearchResultIndex int64 `json:"search_result_index"`
	// This field is from variant [CitationsSearchResultLocation].
	Source string `json:"source"`
	JSON   struct {
		CitedText         respjson.Field
		DocumentIndex     respjson.Field
		DocumentTitle     respjson.Field
		EndCharIndex      respjson.Field
		FileID            respjson.Field
		StartCharIndex    respjson.Field
		Type              respjson.Field
		EndPageNumber     respjson.Field
		StartPageNumber   respjson.Field
		EndBlockIndex     respjson.Field
		StartBlockIndex   respjson.Field
		EncryptedIndex    respjson.Field
		Title             respjson.Field
		URL               respjson.Field
		SearchResultIndex respjson.Field
		Source            respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

TextCitationUnion contains all possible properties and values from CitationCharLocation, CitationPageLocation, CitationContentBlockLocation, CitationsWebSearchResultLocation, CitationsSearchResultLocation.

Use the TextCitationUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (TextCitationUnion) AsAny

func (u TextCitationUnion) AsAny() anyTextCitation

Use the following switch statement to find the correct variant

switch variant := TextCitationUnion.AsAny().(type) {
case Juglow.CitationCharLocation:
case Juglow.CitationPageLocation:
case Juglow.CitationContentBlockLocation:
case Juglow.CitationsWebSearchResultLocation:
case Juglow.CitationsSearchResultLocation:
default:
  fmt.Errorf("no variant present")
}

func (TextCitationUnion) AsCharLocation

func (u TextCitationUnion) AsCharLocation() (v CitationCharLocation)

func (TextCitationUnion) AsContentBlockLocation

func (u TextCitationUnion) AsContentBlockLocation() (v CitationContentBlockLocation)

func (TextCitationUnion) AsPageLocation

func (u TextCitationUnion) AsPageLocation() (v CitationPageLocation)

func (TextCitationUnion) AsSearchResultLocation

func (u TextCitationUnion) AsSearchResultLocation() (v CitationsSearchResultLocation)

func (TextCitationUnion) AsWebSearchResultLocation

func (u TextCitationUnion) AsWebSearchResultLocation() (v CitationsWebSearchResultLocation)

func (TextCitationUnion) RawJSON

func (u TextCitationUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*TextCitationUnion) UnmarshalJSON

func (r *TextCitationUnion) UnmarshalJSON(data []byte) error

type TextDelta

type TextDelta struct {
	Text string             `json:"text" api:"required"`
	Type constant.TextDelta `json:"type" default:"text_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TextDelta) RawJSON

func (r TextDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*TextDelta) UnmarshalJSON

func (r *TextDelta) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionCreateResultBlock

type TextEditorCodeExecutionCreateResultBlock struct {
	IsFileUpdate bool                                         `json:"is_file_update" api:"required"`
	Type         constant.TextEditorCodeExecutionCreateResult `json:"type" default:"text_editor_code_execution_create_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IsFileUpdate respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TextEditorCodeExecutionCreateResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*TextEditorCodeExecutionCreateResultBlock) UnmarshalJSON

func (r *TextEditorCodeExecutionCreateResultBlock) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionCreateResultBlockParam

type TextEditorCodeExecutionCreateResultBlockParam struct {
	IsFileUpdate bool `json:"is_file_update" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_create_result".
	Type constant.TextEditorCodeExecutionCreateResult `json:"type" default:"text_editor_code_execution_create_result"`
	// contains filtered or unexported fields
}

The properties IsFileUpdate, Type are required.

func (TextEditorCodeExecutionCreateResultBlockParam) MarshalJSON

func (r TextEditorCodeExecutionCreateResultBlockParam) MarshalJSON() (data []byte, err error)

func (*TextEditorCodeExecutionCreateResultBlockParam) UnmarshalJSON

func (r *TextEditorCodeExecutionCreateResultBlockParam) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionStrReplaceResultBlock

type TextEditorCodeExecutionStrReplaceResultBlock struct {
	Lines    []string                                         `json:"lines" api:"required"`
	NewLines int64                                            `json:"new_lines" api:"required"`
	NewStart int64                                            `json:"new_start" api:"required"`
	OldLines int64                                            `json:"old_lines" api:"required"`
	OldStart int64                                            `json:"old_start" api:"required"`
	Type     constant.TextEditorCodeExecutionStrReplaceResult `json:"type" default:"text_editor_code_execution_str_replace_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Lines       respjson.Field
		NewLines    respjson.Field
		NewStart    respjson.Field
		OldLines    respjson.Field
		OldStart    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TextEditorCodeExecutionStrReplaceResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*TextEditorCodeExecutionStrReplaceResultBlock) UnmarshalJSON

func (r *TextEditorCodeExecutionStrReplaceResultBlock) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionStrReplaceResultBlockParam

type TextEditorCodeExecutionStrReplaceResultBlockParam struct {
	NewLines param.Opt[int64] `json:"new_lines,omitzero"`
	NewStart param.Opt[int64] `json:"new_start,omitzero"`
	OldLines param.Opt[int64] `json:"old_lines,omitzero"`
	OldStart param.Opt[int64] `json:"old_start,omitzero"`
	Lines    []string         `json:"lines,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_str_replace_result".
	Type constant.TextEditorCodeExecutionStrReplaceResult `json:"type" default:"text_editor_code_execution_str_replace_result"`
	// contains filtered or unexported fields
}

The property Type is required.

func (TextEditorCodeExecutionStrReplaceResultBlockParam) MarshalJSON

func (r TextEditorCodeExecutionStrReplaceResultBlockParam) MarshalJSON() (data []byte, err error)

func (*TextEditorCodeExecutionStrReplaceResultBlockParam) UnmarshalJSON

type TextEditorCodeExecutionToolResultBlock

type TextEditorCodeExecutionToolResultBlock struct {
	Content   TextEditorCodeExecutionToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                             `json:"tool_use_id" api:"required"`
	Type      constant.TextEditorCodeExecutionToolResult         `json:"type" default:"text_editor_code_execution_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TextEditorCodeExecutionToolResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (TextEditorCodeExecutionToolResultBlock) ToParam

func (*TextEditorCodeExecutionToolResultBlock) UnmarshalJSON

func (r *TextEditorCodeExecutionToolResultBlock) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionToolResultBlockContentUnion

type TextEditorCodeExecutionToolResultBlockContentUnion struct {
	// This field is from variant [TextEditorCodeExecutionToolResultError].
	ErrorCode TextEditorCodeExecutionToolResultErrorCode `json:"error_code"`
	// This field is from variant [TextEditorCodeExecutionToolResultError].
	ErrorMessage string `json:"error_message"`
	Type         string `json:"type"`
	// This field is from variant [TextEditorCodeExecutionViewResultBlock].
	Content string `json:"content"`
	// This field is from variant [TextEditorCodeExecutionViewResultBlock].
	FileType TextEditorCodeExecutionViewResultBlockFileType `json:"file_type"`
	// This field is from variant [TextEditorCodeExecutionViewResultBlock].
	NumLines int64 `json:"num_lines"`
	// This field is from variant [TextEditorCodeExecutionViewResultBlock].
	StartLine int64 `json:"start_line"`
	// This field is from variant [TextEditorCodeExecutionViewResultBlock].
	TotalLines int64 `json:"total_lines"`
	// This field is from variant [TextEditorCodeExecutionCreateResultBlock].
	IsFileUpdate bool `json:"is_file_update"`
	// This field is from variant [TextEditorCodeExecutionStrReplaceResultBlock].
	Lines []string `json:"lines"`
	// This field is from variant [TextEditorCodeExecutionStrReplaceResultBlock].
	NewLines int64 `json:"new_lines"`
	// This field is from variant [TextEditorCodeExecutionStrReplaceResultBlock].
	NewStart int64 `json:"new_start"`
	// This field is from variant [TextEditorCodeExecutionStrReplaceResultBlock].
	OldLines int64 `json:"old_lines"`
	// This field is from variant [TextEditorCodeExecutionStrReplaceResultBlock].
	OldStart int64 `json:"old_start"`
	JSON     struct {
		ErrorCode    respjson.Field
		ErrorMessage respjson.Field
		Type         respjson.Field
		Content      respjson.Field
		FileType     respjson.Field
		NumLines     respjson.Field
		StartLine    respjson.Field
		TotalLines   respjson.Field
		IsFileUpdate respjson.Field
		Lines        respjson.Field
		NewLines     respjson.Field
		NewStart     respjson.Field
		OldLines     respjson.Field
		OldStart     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

TextEditorCodeExecutionToolResultBlockContentUnion contains all possible properties and values from TextEditorCodeExecutionToolResultError, TextEditorCodeExecutionViewResultBlock, TextEditorCodeExecutionCreateResultBlock, TextEditorCodeExecutionStrReplaceResultBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (TextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionCreateResultBlock

func (u TextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionCreateResultBlock() (v TextEditorCodeExecutionCreateResultBlock)

func (TextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionStrReplaceResultBlock

func (u TextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionStrReplaceResultBlock() (v TextEditorCodeExecutionStrReplaceResultBlock)

func (TextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionToolResultError

func (u TextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionToolResultError() (v TextEditorCodeExecutionToolResultError)

func (TextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionViewResultBlock

func (u TextEditorCodeExecutionToolResultBlockContentUnion) AsResponseTextEditorCodeExecutionViewResultBlock() (v TextEditorCodeExecutionViewResultBlock)

func (TextEditorCodeExecutionToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*TextEditorCodeExecutionToolResultBlockContentUnion) UnmarshalJSON

type TextEditorCodeExecutionToolResultBlockParam

type TextEditorCodeExecutionToolResultBlockParam struct {
	Content   TextEditorCodeExecutionToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                                  `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_tool_result".
	Type constant.TextEditorCodeExecutionToolResult `json:"type" default:"text_editor_code_execution_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (TextEditorCodeExecutionToolResultBlockParam) MarshalJSON

func (r TextEditorCodeExecutionToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*TextEditorCodeExecutionToolResultBlockParam) UnmarshalJSON

func (r *TextEditorCodeExecutionToolResultBlockParam) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionToolResultBlockParamContentUnion

type TextEditorCodeExecutionToolResultBlockParamContentUnion struct {
	OfRequestTextEditorCodeExecutionToolResultError       *TextEditorCodeExecutionToolResultErrorParam       `json:",omitzero,inline"`
	OfRequestTextEditorCodeExecutionViewResultBlock       *TextEditorCodeExecutionViewResultBlockParam       `json:",omitzero,inline"`
	OfRequestTextEditorCodeExecutionCreateResultBlock     *TextEditorCodeExecutionCreateResultBlockParam     `json:",omitzero,inline"`
	OfRequestTextEditorCodeExecutionStrReplaceResultBlock *TextEditorCodeExecutionStrReplaceResultBlockParam `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 (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetErrorMessage

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetFileType

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetIsFileUpdate

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetLines

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetNewLines

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetNewStart

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetNumLines

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetOldLines

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetOldStart

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetStartLine

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetTotalLines

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (TextEditorCodeExecutionToolResultBlockParamContentUnion) MarshalJSON

func (*TextEditorCodeExecutionToolResultBlockParamContentUnion) UnmarshalJSON

type TextEditorCodeExecutionToolResultError

type TextEditorCodeExecutionToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded", "file_not_found".
	ErrorCode    TextEditorCodeExecutionToolResultErrorCode      `json:"error_code" api:"required"`
	ErrorMessage string                                          `json:"error_message" api:"required"`
	Type         constant.TextEditorCodeExecutionToolResultError `json:"type" default:"text_editor_code_execution_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode    respjson.Field
		ErrorMessage respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TextEditorCodeExecutionToolResultError) RawJSON

Returns the unmodified JSON received from the API

func (*TextEditorCodeExecutionToolResultError) UnmarshalJSON

func (r *TextEditorCodeExecutionToolResultError) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionToolResultErrorCode

type TextEditorCodeExecutionToolResultErrorCode string
const (
	TextEditorCodeExecutionToolResultErrorCodeInvalidToolInput      TextEditorCodeExecutionToolResultErrorCode = "invalid_tool_input"
	TextEditorCodeExecutionToolResultErrorCodeUnavailable           TextEditorCodeExecutionToolResultErrorCode = "unavailable"
	TextEditorCodeExecutionToolResultErrorCodeTooManyRequests       TextEditorCodeExecutionToolResultErrorCode = "too_many_requests"
	TextEditorCodeExecutionToolResultErrorCodeExecutionTimeExceeded TextEditorCodeExecutionToolResultErrorCode = "execution_time_exceeded"
	TextEditorCodeExecutionToolResultErrorCodeFileNotFound          TextEditorCodeExecutionToolResultErrorCode = "file_not_found"
)

type TextEditorCodeExecutionToolResultErrorParam

type TextEditorCodeExecutionToolResultErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded", "file_not_found".
	ErrorCode    TextEditorCodeExecutionToolResultErrorCode `json:"error_code,omitzero" api:"required"`
	ErrorMessage param.Opt[string]                          `json:"error_message,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_tool_result_error".
	Type constant.TextEditorCodeExecutionToolResultError `json:"type" default:"text_editor_code_execution_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (TextEditorCodeExecutionToolResultErrorParam) MarshalJSON

func (r TextEditorCodeExecutionToolResultErrorParam) MarshalJSON() (data []byte, err error)

func (*TextEditorCodeExecutionToolResultErrorParam) UnmarshalJSON

func (r *TextEditorCodeExecutionToolResultErrorParam) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionViewResultBlock

type TextEditorCodeExecutionViewResultBlock struct {
	Content string `json:"content" api:"required"`
	// Any of "text", "image", "pdf".
	FileType   TextEditorCodeExecutionViewResultBlockFileType `json:"file_type" api:"required"`
	NumLines   int64                                          `json:"num_lines" api:"required"`
	StartLine  int64                                          `json:"start_line" api:"required"`
	TotalLines int64                                          `json:"total_lines" api:"required"`
	Type       constant.TextEditorCodeExecutionViewResult     `json:"type" default:"text_editor_code_execution_view_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		FileType    respjson.Field
		NumLines    respjson.Field
		StartLine   respjson.Field
		TotalLines  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TextEditorCodeExecutionViewResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*TextEditorCodeExecutionViewResultBlock) UnmarshalJSON

func (r *TextEditorCodeExecutionViewResultBlock) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionViewResultBlockFileType

type TextEditorCodeExecutionViewResultBlockFileType string
const (
	TextEditorCodeExecutionViewResultBlockFileTypeText  TextEditorCodeExecutionViewResultBlockFileType = "text"
	TextEditorCodeExecutionViewResultBlockFileTypeImage TextEditorCodeExecutionViewResultBlockFileType = "image"
	TextEditorCodeExecutionViewResultBlockFileTypePDF   TextEditorCodeExecutionViewResultBlockFileType = "pdf"
)

type TextEditorCodeExecutionViewResultBlockParam

type TextEditorCodeExecutionViewResultBlockParam struct {
	Content string `json:"content" api:"required"`
	// Any of "text", "image", "pdf".
	FileType   TextEditorCodeExecutionViewResultBlockParamFileType `json:"file_type,omitzero" api:"required"`
	NumLines   param.Opt[int64]                                    `json:"num_lines,omitzero"`
	StartLine  param.Opt[int64]                                    `json:"start_line,omitzero"`
	TotalLines param.Opt[int64]                                    `json:"total_lines,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_code_execution_view_result".
	Type constant.TextEditorCodeExecutionViewResult `json:"type" default:"text_editor_code_execution_view_result"`
	// contains filtered or unexported fields
}

The properties Content, FileType, Type are required.

func (TextEditorCodeExecutionViewResultBlockParam) MarshalJSON

func (r TextEditorCodeExecutionViewResultBlockParam) MarshalJSON() (data []byte, err error)

func (*TextEditorCodeExecutionViewResultBlockParam) UnmarshalJSON

func (r *TextEditorCodeExecutionViewResultBlockParam) UnmarshalJSON(data []byte) error

type TextEditorCodeExecutionViewResultBlockParamFileType

type TextEditorCodeExecutionViewResultBlockParamFileType string
const (
	TextEditorCodeExecutionViewResultBlockParamFileTypeText  TextEditorCodeExecutionViewResultBlockParamFileType = "text"
	TextEditorCodeExecutionViewResultBlockParamFileTypeImage TextEditorCodeExecutionViewResultBlockParamFileType = "image"
	TextEditorCodeExecutionViewResultBlockParamFileTypePDF   TextEditorCodeExecutionViewResultBlockParamFileType = "pdf"
)

type ThinkingBlock

type ThinkingBlock struct {
	// A value used to verify that this thinking block was generated by haijun when it
	// is passed back to the API.
	//
	// This is an opaque field and should not be interpreted or parsed. When passing
	// thinking blocks back to the API (required when using tools with extended
	// thinking), pass them back exactly as received, with this field intact.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	Signature string `json:"signature" api:"required"`
	// The text of haijun's thinking process for this block.
	Thinking string            `json:"thinking" api:"required"`
	Type     constant.Thinking `json:"type" default:"thinking"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Signature   respjson.Field
		Thinking    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ThinkingBlock) RawJSON

func (r ThinkingBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (ThinkingBlock) ToParam

func (r ThinkingBlock) ToParam() ThinkingBlockParam

func (*ThinkingBlock) UnmarshalJSON

func (r *ThinkingBlock) UnmarshalJSON(data []byte) error

type ThinkingBlockParam

type ThinkingBlockParam struct {
	// The `signature` value of this thinking block, exactly as returned by the API in
	// a previous response. Used to verify that the block was generated by haijun.
	//
	// Thinking blocks must be passed back unmodified and in their original order; a
	// modified block results in a 400 `invalid_request_error`.
	Signature string `json:"signature" api:"required"`
	// The `thinking` text of this block as returned by the API.
	Thinking string `json:"thinking" api:"required"`
	// This field can be elided, and will marshal its zero value as "thinking".
	Type constant.Thinking `json:"type" default:"thinking"`
	// contains filtered or unexported fields
}

The properties Signature, Thinking, Type are required.

func (ThinkingBlockParam) MarshalJSON

func (r ThinkingBlockParam) MarshalJSON() (data []byte, err error)

func (*ThinkingBlockParam) UnmarshalJSON

func (r *ThinkingBlockParam) UnmarshalJSON(data []byte) error

type ThinkingCapability

type ThinkingCapability struct {
	// Whether this capability is supported by the model.
	Supported bool `json:"supported" api:"required"`
	// Supported thinking type configurations.
	Types ThinkingTypes `json:"types" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Supported   respjson.Field
		Types       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Thinking capability details.

func (ThinkingCapability) RawJSON

func (r ThinkingCapability) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThinkingCapability) UnmarshalJSON

func (r *ThinkingCapability) UnmarshalJSON(data []byte) error

type ThinkingConfigAdaptiveDisplay

type ThinkingConfigAdaptiveDisplay string

Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.

const (
	ThinkingConfigAdaptiveDisplaySummarized ThinkingConfigAdaptiveDisplay = "summarized"
	ThinkingConfigAdaptiveDisplayOmitted    ThinkingConfigAdaptiveDisplay = "omitted"
)

type ThinkingConfigAdaptiveParam

type ThinkingConfigAdaptiveParam struct {
	// Controls how thinking content appears in the response. When set to `summarized`,
	// thinking is returned normally. When set to `omitted`, thinking content is
	// redacted but a signature is returned for multi-turn continuity. Defaults to
	// `summarized`.
	//
	// Any of "summarized", "omitted".
	Display ThinkingConfigAdaptiveDisplay `json:"display,omitzero"`
	// This field can be elided, and will marshal its zero value as "adaptive".
	Type constant.Adaptive `json:"type" default:"adaptive"`
	// contains filtered or unexported fields
}

The property Type is required.

func (ThinkingConfigAdaptiveParam) MarshalJSON

func (r ThinkingConfigAdaptiveParam) MarshalJSON() (data []byte, err error)

func (*ThinkingConfigAdaptiveParam) UnmarshalJSON

func (r *ThinkingConfigAdaptiveParam) UnmarshalJSON(data []byte) error

type ThinkingConfigDisabledParam

type ThinkingConfigDisabledParam struct {
	Type constant.Disabled `json:"type" default:"disabled"`
	// contains filtered or unexported fields
}

This struct has a constant value, construct it with NewThinkingConfigDisabledParam.

func NewThinkingConfigDisabledParam

func NewThinkingConfigDisabledParam() ThinkingConfigDisabledParam

func (ThinkingConfigDisabledParam) MarshalJSON

func (r ThinkingConfigDisabledParam) MarshalJSON() (data []byte, err error)

func (*ThinkingConfigDisabledParam) UnmarshalJSON

func (r *ThinkingConfigDisabledParam) UnmarshalJSON(data []byte) error

type ThinkingConfigEnabledDisplay

type ThinkingConfigEnabledDisplay string

Controls how thinking content appears in the response. When set to `summarized`, thinking is returned normally. When set to `omitted`, thinking content is redacted but a signature is returned for multi-turn continuity. Defaults to `summarized`.

const (
	ThinkingConfigEnabledDisplaySummarized ThinkingConfigEnabledDisplay = "summarized"
	ThinkingConfigEnabledDisplayOmitted    ThinkingConfigEnabledDisplay = "omitted"
)

type ThinkingConfigEnabledParam

type ThinkingConfigEnabledParam struct {
	// Determines how many tokens haijun can use for its internal reasoning process.
	// Larger budgets can enable more thorough analysis for complex problems, improving
	// response quality.
	//
	// Must be ≥1024 and less than `max_tokens`.
	//
	// See
	// [extended thinking](https://platform.haijun.com/docs/en/build-with-haijun/extended-thinking)
	// for details.
	BudgetTokens int64 `json:"budget_tokens" api:"required"`
	// Controls how thinking content appears in the response. When set to `summarized`,
	// thinking is returned normally. When set to `omitted`, thinking content is
	// redacted but a signature is returned for multi-turn continuity. Defaults to
	// `summarized`.
	//
	// Any of "summarized", "omitted".
	Display ThinkingConfigEnabledDisplay `json:"display,omitzero"`
	// This field can be elided, and will marshal its zero value as "enabled".
	Type constant.Enabled `json:"type" default:"enabled"`
	// contains filtered or unexported fields
}

The properties BudgetTokens, Type are required.

func (ThinkingConfigEnabledParam) MarshalJSON

func (r ThinkingConfigEnabledParam) MarshalJSON() (data []byte, err error)

func (*ThinkingConfigEnabledParam) UnmarshalJSON

func (r *ThinkingConfigEnabledParam) UnmarshalJSON(data []byte) error

type ThinkingConfigParamUnion

type ThinkingConfigParamUnion struct {
	OfEnabled  *ThinkingConfigEnabledParam  `json:",omitzero,inline"`
	OfDisabled *ThinkingConfigDisabledParam `json:",omitzero,inline"`
	OfAdaptive *ThinkingConfigAdaptiveParam `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 ThinkingConfigParamOfEnabled

func ThinkingConfigParamOfEnabled(budgetTokens int64) ThinkingConfigParamUnion

func (ThinkingConfigParamUnion) GetBudgetTokens

func (u ThinkingConfigParamUnion) GetBudgetTokens() *int64

Returns a pointer to the underlying variant's property, if present.

func (ThinkingConfigParamUnion) GetDisplay

func (u ThinkingConfigParamUnion) GetDisplay() *string

Returns a pointer to the underlying variant's property, if present.

func (ThinkingConfigParamUnion) GetType

func (u ThinkingConfigParamUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (ThinkingConfigParamUnion) MarshalJSON

func (u ThinkingConfigParamUnion) MarshalJSON() ([]byte, error)

func (*ThinkingConfigParamUnion) UnmarshalJSON

func (u *ThinkingConfigParamUnion) UnmarshalJSON(data []byte) error

type ThinkingDelta

type ThinkingDelta struct {
	// The incremental `thinking` text for this content block. Concatenate the
	// `thinking` values of successive `thinking_delta` events to assemble the block's
	// full `thinking` value.
	Thinking string                 `json:"thinking" api:"required"`
	Type     constant.ThinkingDelta `json:"type" default:"thinking_delta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Thinking    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ThinkingDelta) RawJSON

func (r ThinkingDelta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThinkingDelta) UnmarshalJSON

func (r *ThinkingDelta) UnmarshalJSON(data []byte) error

type ThinkingTypes

type ThinkingTypes struct {
	// Whether the model supports thinking with type 'adaptive' (auto).
	Adaptive CapabilitySupport `json:"adaptive" api:"required"`
	// Whether the model supports thinking with type 'enabled'.
	Enabled CapabilitySupport `json:"enabled" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Adaptive    respjson.Field
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Supported thinking type configurations.

func (ThinkingTypes) RawJSON

func (r ThinkingTypes) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThinkingTypes) UnmarshalJSON

func (r *ThinkingTypes) UnmarshalJSON(data []byte) error

type ToolBash20250124Param

type ToolBash20250124Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  CacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any           `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "bash".
	Name constant.Bash `json:"name" default:"bash"`
	// This field can be elided, and will marshal its zero value as "bash_20250124".
	Type constant.Bash20250124 `json:"type" default:"bash_20250124"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (ToolBash20250124Param) MarshalJSON

func (r ToolBash20250124Param) MarshalJSON() (data []byte, err error)

func (*ToolBash20250124Param) UnmarshalJSON

func (r *ToolBash20250124Param) UnmarshalJSON(data []byte) error

type ToolChoiceAnyParam

type ToolChoiceAnyParam struct {
	// Whether to disable parallel tool use.
	//
	// Defaults to `false`. If set to `true`, the model will output exactly one tool
	// use.
	DisableParallelToolUse param.Opt[bool] `json:"disable_parallel_tool_use,omitzero"`
	// This field can be elided, and will marshal its zero value as "any".
	Type constant.Any `json:"type" default:"any"`
	// contains filtered or unexported fields
}

The model will use any available tools.

The property Type is required.

func (ToolChoiceAnyParam) MarshalJSON

func (r ToolChoiceAnyParam) MarshalJSON() (data []byte, err error)

func (*ToolChoiceAnyParam) UnmarshalJSON

func (r *ToolChoiceAnyParam) UnmarshalJSON(data []byte) error

type ToolChoiceAutoParam

type ToolChoiceAutoParam struct {
	// Whether to disable parallel tool use.
	//
	// Defaults to `false`. If set to `true`, the model will output at most one tool
	// use.
	DisableParallelToolUse param.Opt[bool] `json:"disable_parallel_tool_use,omitzero"`
	// This field can be elided, and will marshal its zero value as "auto".
	Type constant.Auto `json:"type" default:"auto"`
	// contains filtered or unexported fields
}

The model will automatically decide whether to use tools.

The property Type is required.

func (ToolChoiceAutoParam) MarshalJSON

func (r ToolChoiceAutoParam) MarshalJSON() (data []byte, err error)

func (*ToolChoiceAutoParam) UnmarshalJSON

func (r *ToolChoiceAutoParam) UnmarshalJSON(data []byte) error

type ToolChoiceNoneParam

type ToolChoiceNoneParam struct {
	Type constant.None `json:"type" default:"none"`
	// contains filtered or unexported fields
}

The model will not be allowed to use tools.

This struct has a constant value, construct it with NewToolChoiceNoneParam.

func NewToolChoiceNoneParam

func NewToolChoiceNoneParam() ToolChoiceNoneParam

func (ToolChoiceNoneParam) MarshalJSON

func (r ToolChoiceNoneParam) MarshalJSON() (data []byte, err error)

func (*ToolChoiceNoneParam) UnmarshalJSON

func (r *ToolChoiceNoneParam) UnmarshalJSON(data []byte) error

type ToolChoiceToolParam

type ToolChoiceToolParam struct {
	// The name of the tool to use.
	Name string `json:"name" api:"required"`
	// Whether to disable parallel tool use.
	//
	// Defaults to `false`. If set to `true`, the model will output exactly one tool
	// use.
	DisableParallelToolUse param.Opt[bool] `json:"disable_parallel_tool_use,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool".
	Type constant.Tool `json:"type" default:"tool"`
	// contains filtered or unexported fields
}

The model will use the specified tool with `tool_choice.name`.

The properties Name, Type are required.

func (ToolChoiceToolParam) MarshalJSON

func (r ToolChoiceToolParam) MarshalJSON() (data []byte, err error)

func (*ToolChoiceToolParam) UnmarshalJSON

func (r *ToolChoiceToolParam) UnmarshalJSON(data []byte) error

type ToolChoiceUnionParam

type ToolChoiceUnionParam struct {
	OfAuto *ToolChoiceAutoParam `json:",omitzero,inline"`
	OfAny  *ToolChoiceAnyParam  `json:",omitzero,inline"`
	OfTool *ToolChoiceToolParam `json:",omitzero,inline"`
	OfNone *ToolChoiceNoneParam `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 ToolChoiceParamOfTool

func ToolChoiceParamOfTool(name string) ToolChoiceUnionParam

func (ToolChoiceUnionParam) GetDisableParallelToolUse

func (u ToolChoiceUnionParam) GetDisableParallelToolUse() *bool

Returns a pointer to the underlying variant's property, if present.

func (ToolChoiceUnionParam) GetName

func (u ToolChoiceUnionParam) GetName() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolChoiceUnionParam) GetType

func (u ToolChoiceUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolChoiceUnionParam) MarshalJSON

func (u ToolChoiceUnionParam) MarshalJSON() ([]byte, error)

func (*ToolChoiceUnionParam) UnmarshalJSON

func (u *ToolChoiceUnionParam) UnmarshalJSON(data []byte) error

type ToolInputSchemaParam

type ToolInputSchemaParam struct {
	Properties any      `json:"properties,omitzero"`
	Required   []string `json:"required,omitzero"`
	// This field can be elided, and will marshal its zero value as "object".
	Type        constant.Object `json:"type" default:"object"`
	ExtraFields map[string]any  `json:"-"`
	// contains filtered or unexported fields
}

[JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.

This defines the shape of the `input` that your tool accepts and that the model will produce.

The property Type is required.

func (ToolInputSchemaParam) MarshalJSON

func (r ToolInputSchemaParam) MarshalJSON() (data []byte, err error)

func (*ToolInputSchemaParam) UnmarshalJSON

func (r *ToolInputSchemaParam) UnmarshalJSON(data []byte) error

type ToolParam

type ToolParam struct {
	// [JSON schema](https://json-schema.org/draft/2020-12) for this tool's input.
	//
	// This defines the shape of the `input` that your tool accepts and that the model
	// will produce.
	InputSchema ToolInputSchemaParam `json:"input_schema,omitzero" api:"required"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	Name string `json:"name" api:"required"`
	// Enable eager input streaming for this tool. When true, tool input parameters
	// will be streamed incrementally as they are generated, and types will be inferred
	// on-the-fly rather than buffering the full JSON output. When false, streaming is
	// disabled for this tool even if the fine-grained-tool-streaming beta is active.
	// When null (default), uses the default behavior based on beta headers.
	EagerInputStreaming param.Opt[bool] `json:"eager_input_streaming,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// Description of what this tool does.
	//
	// Tool descriptions should be as detailed as possible. The more information that
	// the model has about what the tool is and how to use it, the better it will
	// perform. You can use natural language descriptions to reinforce important
	// aspects of the tool input JSON schema.
	Description param.Opt[string] `json:"description,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "custom".
	Type ToolType `json:"type,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  CacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any           `json:"input_examples,omitzero"`
	// contains filtered or unexported fields
}

The properties InputSchema, Name are required.

func (ToolParam) MarshalJSON

func (r ToolParam) MarshalJSON() (data []byte, err error)

func (*ToolParam) UnmarshalJSON

func (r *ToolParam) UnmarshalJSON(data []byte) error

type ToolReferenceBlock

type ToolReferenceBlock struct {
	ToolName string                 `json:"tool_name" api:"required"`
	Type     constant.ToolReference `json:"type" default:"tool_reference"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ToolName    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolReferenceBlock) RawJSON

func (r ToolReferenceBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (ToolReferenceBlock) ToParam

func (*ToolReferenceBlock) UnmarshalJSON

func (r *ToolReferenceBlock) UnmarshalJSON(data []byte) error

type ToolReferenceBlockParam

type ToolReferenceBlockParam struct {
	ToolName string `json:"tool_name" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool_reference".
	Type constant.ToolReference `json:"type" default:"tool_reference"`
	// contains filtered or unexported fields
}

Tool reference block that can be included in tool_result content.

The properties ToolName, Type are required.

func (ToolReferenceBlockParam) MarshalJSON

func (r ToolReferenceBlockParam) MarshalJSON() (data []byte, err error)

func (*ToolReferenceBlockParam) UnmarshalJSON

func (r *ToolReferenceBlockParam) UnmarshalJSON(data []byte) error

type ToolResultBlockParam

type ToolResultBlockParam struct {
	ToolUseID string          `json:"tool_use_id" api:"required"`
	IsError   param.Opt[bool] `json:"is_error,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam         `json:"cache_control,omitzero"`
	Content      []ToolResultBlockParamContentUnion `json:"content,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool_result".
	Type constant.ToolResult `json:"type" default:"tool_result"`
	// contains filtered or unexported fields
}

The properties ToolUseID, Type are required.

func (ToolResultBlockParam) MarshalJSON

func (r ToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*ToolResultBlockParam) UnmarshalJSON

func (r *ToolResultBlockParam) UnmarshalJSON(data []byte) error

type ToolResultBlockParamContentUnion

type ToolResultBlockParamContentUnion struct {
	OfText          *TextBlockParam          `json:",omitzero,inline"`
	OfImage         *ImageBlockParam         `json:",omitzero,inline"`
	OfSearchResult  *SearchResultBlockParam  `json:",omitzero,inline"`
	OfDocument      *DocumentBlockParam      `json:",omitzero,inline"`
	OfToolReference *ToolReferenceBlockParam `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 (ToolResultBlockParamContentUnion) GetCacheControl

Returns a pointer to the underlying variant's CacheControl property, if present.

func (ToolResultBlockParamContentUnion) GetCitations

func (u ToolResultBlockParamContentUnion) GetCitations() (res toolResultBlockParamContentUnionCitations)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (ToolResultBlockParamContentUnion) GetContext

func (u ToolResultBlockParamContentUnion) GetContext() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolResultBlockParamContentUnion) GetSource

func (u ToolResultBlockParamContentUnion) GetSource() (res toolResultBlockParamContentUnionSource)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ToolResultBlockParamContentUnion) GetText

Returns a pointer to the underlying variant's property, if present.

func (ToolResultBlockParamContentUnion) GetTitle

Returns a pointer to the underlying variant's property, if present.

func (ToolResultBlockParamContentUnion) GetToolName

func (u ToolResultBlockParamContentUnion) GetToolName() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (ToolResultBlockParamContentUnion) MarshalJSON

func (u ToolResultBlockParamContentUnion) MarshalJSON() ([]byte, error)

func (*ToolResultBlockParamContentUnion) UnmarshalJSON

func (u *ToolResultBlockParamContentUnion) UnmarshalJSON(data []byte) error

type ToolSearchToolBm25_20251119Param

type ToolSearchToolBm25_20251119Param struct {
	// Any of "tool_search_tool_bm25_20251119", "tool_search_tool_bm25".
	Type ToolSearchToolBm25_20251119Type `json:"type,omitzero" api:"required"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_bm25".
	Name constant.ToolSearchToolBm25 `json:"name" default:"tool_search_tool_bm25"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (ToolSearchToolBm25_20251119Param) MarshalJSON

func (r ToolSearchToolBm25_20251119Param) MarshalJSON() (data []byte, err error)

func (*ToolSearchToolBm25_20251119Param) UnmarshalJSON

func (r *ToolSearchToolBm25_20251119Param) UnmarshalJSON(data []byte) error

type ToolSearchToolBm25_20251119Type

type ToolSearchToolBm25_20251119Type string
const (
	ToolSearchToolBm25_20251119TypeToolSearchToolBm25_20251119 ToolSearchToolBm25_20251119Type = "tool_search_tool_bm25_20251119"
	ToolSearchToolBm25_20251119TypeToolSearchToolBm25          ToolSearchToolBm25_20251119Type = "tool_search_tool_bm25"
)

type ToolSearchToolRegex20251119Param

type ToolSearchToolRegex20251119Param struct {
	// Any of "tool_search_tool_regex_20251119", "tool_search_tool_regex".
	Type ToolSearchToolRegex20251119Type `json:"type,omitzero" api:"required"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_regex".
	Name constant.ToolSearchToolRegex `json:"name" default:"tool_search_tool_regex"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (ToolSearchToolRegex20251119Param) MarshalJSON

func (r ToolSearchToolRegex20251119Param) MarshalJSON() (data []byte, err error)

func (*ToolSearchToolRegex20251119Param) UnmarshalJSON

func (r *ToolSearchToolRegex20251119Param) UnmarshalJSON(data []byte) error

type ToolSearchToolRegex20251119Type

type ToolSearchToolRegex20251119Type string
const (
	ToolSearchToolRegex20251119TypeToolSearchToolRegex20251119 ToolSearchToolRegex20251119Type = "tool_search_tool_regex_20251119"
	ToolSearchToolRegex20251119TypeToolSearchToolRegex         ToolSearchToolRegex20251119Type = "tool_search_tool_regex"
)

type ToolSearchToolResultBlock

type ToolSearchToolResultBlock struct {
	Content   ToolSearchToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                                `json:"tool_use_id" api:"required"`
	Type      constant.ToolSearchToolResult         `json:"type" default:"tool_search_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolSearchToolResultBlock) RawJSON

func (r ToolSearchToolResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (ToolSearchToolResultBlock) ToParam

func (*ToolSearchToolResultBlock) UnmarshalJSON

func (r *ToolSearchToolResultBlock) UnmarshalJSON(data []byte) error

type ToolSearchToolResultBlockContentUnion

type ToolSearchToolResultBlockContentUnion struct {
	// This field is from variant [ToolSearchToolResultError].
	ErrorCode ToolSearchToolResultErrorCode `json:"error_code"`
	// This field is from variant [ToolSearchToolResultError].
	ErrorMessage string `json:"error_message"`
	Type         string `json:"type"`
	// This field is from variant [ToolSearchToolSearchResultBlock].
	ToolReferences []ToolReferenceBlock `json:"tool_references"`
	JSON           struct {
		ErrorCode      respjson.Field
		ErrorMessage   respjson.Field
		Type           respjson.Field
		ToolReferences respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ToolSearchToolResultBlockContentUnion contains all possible properties and values from ToolSearchToolResultError, ToolSearchToolSearchResultBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ToolSearchToolResultBlockContentUnion) AsResponseToolSearchToolResultError

func (u ToolSearchToolResultBlockContentUnion) AsResponseToolSearchToolResultError() (v ToolSearchToolResultError)

func (ToolSearchToolResultBlockContentUnion) AsResponseToolSearchToolSearchResultBlock

func (u ToolSearchToolResultBlockContentUnion) AsResponseToolSearchToolSearchResultBlock() (v ToolSearchToolSearchResultBlock)

func (ToolSearchToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ToolSearchToolResultBlockContentUnion) UnmarshalJSON

func (r *ToolSearchToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type ToolSearchToolResultBlockParam

type ToolSearchToolResultBlockParam struct {
	Content   ToolSearchToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                     `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_result".
	Type constant.ToolSearchToolResult `json:"type" default:"tool_search_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (ToolSearchToolResultBlockParam) MarshalJSON

func (r ToolSearchToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*ToolSearchToolResultBlockParam) UnmarshalJSON

func (r *ToolSearchToolResultBlockParam) UnmarshalJSON(data []byte) error

type ToolSearchToolResultBlockParamContentUnion

type ToolSearchToolResultBlockParamContentUnion struct {
	OfRequestToolSearchToolResultError       *ToolSearchToolResultErrorParam       `json:",omitzero,inline"`
	OfRequestToolSearchToolSearchResultBlock *ToolSearchToolSearchResultBlockParam `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 (ToolSearchToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (ToolSearchToolResultBlockParamContentUnion) GetErrorMessage

Returns a pointer to the underlying variant's property, if present.

func (ToolSearchToolResultBlockParamContentUnion) GetToolReferences

Returns a pointer to the underlying variant's property, if present.

func (ToolSearchToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (ToolSearchToolResultBlockParamContentUnion) MarshalJSON

func (*ToolSearchToolResultBlockParamContentUnion) UnmarshalJSON

func (u *ToolSearchToolResultBlockParamContentUnion) UnmarshalJSON(data []byte) error

type ToolSearchToolResultError

type ToolSearchToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded".
	ErrorCode    ToolSearchToolResultErrorCode      `json:"error_code" api:"required"`
	ErrorMessage string                             `json:"error_message" api:"required"`
	Type         constant.ToolSearchToolResultError `json:"type" default:"tool_search_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode    respjson.Field
		ErrorMessage respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolSearchToolResultError) RawJSON

func (r ToolSearchToolResultError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ToolSearchToolResultError) UnmarshalJSON

func (r *ToolSearchToolResultError) UnmarshalJSON(data []byte) error

type ToolSearchToolResultErrorCode

type ToolSearchToolResultErrorCode string
const (
	ToolSearchToolResultErrorCodeInvalidToolInput      ToolSearchToolResultErrorCode = "invalid_tool_input"
	ToolSearchToolResultErrorCodeUnavailable           ToolSearchToolResultErrorCode = "unavailable"
	ToolSearchToolResultErrorCodeTooManyRequests       ToolSearchToolResultErrorCode = "too_many_requests"
	ToolSearchToolResultErrorCodeExecutionTimeExceeded ToolSearchToolResultErrorCode = "execution_time_exceeded"
)

type ToolSearchToolResultErrorParam

type ToolSearchToolResultErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "too_many_requests",
	// "execution_time_exceeded".
	ErrorCode    ToolSearchToolResultErrorCode `json:"error_code,omitzero" api:"required"`
	ErrorMessage param.Opt[string]             `json:"error_message,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_result_error".
	Type constant.ToolSearchToolResultError `json:"type" default:"tool_search_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (ToolSearchToolResultErrorParam) MarshalJSON

func (r ToolSearchToolResultErrorParam) MarshalJSON() (data []byte, err error)

func (*ToolSearchToolResultErrorParam) UnmarshalJSON

func (r *ToolSearchToolResultErrorParam) UnmarshalJSON(data []byte) error

type ToolSearchToolSearchResultBlock

type ToolSearchToolSearchResultBlock struct {
	ToolReferences []ToolReferenceBlock                `json:"tool_references" api:"required"`
	Type           constant.ToolSearchToolSearchResult `json:"type" default:"tool_search_tool_search_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ToolReferences respjson.Field
		Type           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolSearchToolSearchResultBlock) RawJSON

Returns the unmodified JSON received from the API

func (*ToolSearchToolSearchResultBlock) UnmarshalJSON

func (r *ToolSearchToolSearchResultBlock) UnmarshalJSON(data []byte) error

type ToolSearchToolSearchResultBlockParam

type ToolSearchToolSearchResultBlockParam struct {
	ToolReferences []ToolReferenceBlockParam `json:"tool_references,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "tool_search_tool_search_result".
	Type constant.ToolSearchToolSearchResult `json:"type" default:"tool_search_tool_search_result"`
	// contains filtered or unexported fields
}

The properties ToolReferences, Type are required.

func (ToolSearchToolSearchResultBlockParam) MarshalJSON

func (r ToolSearchToolSearchResultBlockParam) MarshalJSON() (data []byte, err error)

func (*ToolSearchToolSearchResultBlockParam) UnmarshalJSON

func (r *ToolSearchToolSearchResultBlockParam) UnmarshalJSON(data []byte) error

type ToolTextEditor20250124Param

type ToolTextEditor20250124Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  CacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any           `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "str_replace_editor".
	Name constant.StrReplaceEditor `json:"name" default:"str_replace_editor"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_20250124".
	Type constant.TextEditor20250124 `json:"type" default:"text_editor_20250124"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (ToolTextEditor20250124Param) MarshalJSON

func (r ToolTextEditor20250124Param) MarshalJSON() (data []byte, err error)

func (*ToolTextEditor20250124Param) UnmarshalJSON

func (r *ToolTextEditor20250124Param) UnmarshalJSON(data []byte) error

type ToolTextEditor20250429Param

type ToolTextEditor20250429Param struct {
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  CacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any           `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "str_replace_based_edit_tool".
	Name constant.StrReplaceBasedEditTool `json:"name" default:"str_replace_based_edit_tool"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_20250429".
	Type constant.TextEditor20250429 `json:"type" default:"text_editor_20250429"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (ToolTextEditor20250429Param) MarshalJSON

func (r ToolTextEditor20250429Param) MarshalJSON() (data []byte, err error)

func (*ToolTextEditor20250429Param) UnmarshalJSON

func (r *ToolTextEditor20250429Param) UnmarshalJSON(data []byte) error

type ToolTextEditor20250728Param

type ToolTextEditor20250728Param struct {
	// Maximum number of characters to display when viewing a file. If not specified,
	// defaults to displaying the full file.
	MaxCharacters param.Opt[int64] `json:"max_characters,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl  CacheControlEphemeralParam `json:"cache_control,omitzero"`
	InputExamples []map[string]any           `json:"input_examples,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as
	// "str_replace_based_edit_tool".
	Name constant.StrReplaceBasedEditTool `json:"name" default:"str_replace_based_edit_tool"`
	// This field can be elided, and will marshal its zero value as
	// "text_editor_20250728".
	Type constant.TextEditor20250728 `json:"type" default:"text_editor_20250728"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (ToolTextEditor20250728Param) MarshalJSON

func (r ToolTextEditor20250728Param) MarshalJSON() (data []byte, err error)

func (*ToolTextEditor20250728Param) UnmarshalJSON

func (r *ToolTextEditor20250728Param) UnmarshalJSON(data []byte) error

type ToolType

type ToolType string
const (
	ToolTypeCustom ToolType = "custom"
)

type ToolUnionParam

type ToolUnionParam struct {
	OfTool                        *ToolParam                        `json:",omitzero,inline"`
	OfBashTool20250124            *ToolBash20250124Param            `json:",omitzero,inline"`
	OfCodeExecutionTool20250522   *CodeExecutionTool20250522Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20250825   *CodeExecutionTool20250825Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20260120   *CodeExecutionTool20260120Param   `json:",omitzero,inline"`
	OfCodeExecutionTool20260521   *CodeExecutionTool20260521Param   `json:",omitzero,inline"`
	OfMemoryTool20250818          *MemoryTool20250818Param          `json:",omitzero,inline"`
	OfTextEditor20250124          *ToolTextEditor20250124Param      `json:",omitzero,inline"`
	OfTextEditor20250429          *ToolTextEditor20250429Param      `json:",omitzero,inline"`
	OfTextEditor20250728          *ToolTextEditor20250728Param      `json:",omitzero,inline"`
	OfWebSearchTool20250305       *WebSearchTool20250305Param       `json:",omitzero,inline"`
	OfWebFetchTool20250910        *WebFetchTool20250910Param        `json:",omitzero,inline"`
	OfWebSearchTool20260209       *WebSearchTool20260209Param       `json:",omitzero,inline"`
	OfWebFetchTool20260209        *WebFetchTool20260209Param        `json:",omitzero,inline"`
	OfWebFetchTool20260309        *WebFetchTool20260309Param        `json:",omitzero,inline"`
	OfWebSearchTool20260318       *WebSearchTool20260318Param       `json:",omitzero,inline"`
	OfWebFetchTool20260318        *WebFetchTool20260318Param        `json:",omitzero,inline"`
	OfToolSearchToolBm25_20251119 *ToolSearchToolBm25_20251119Param `json:",omitzero,inline"`
	OfToolSearchToolRegex20251119 *ToolSearchToolRegex20251119Param `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 ToolUnionParamOfTool

func ToolUnionParamOfTool(inputSchema ToolInputSchemaParam, name string) ToolUnionParam

func ToolUnionParamOfToolSearchToolBm25_20251119

func ToolUnionParamOfToolSearchToolBm25_20251119(type_ ToolSearchToolBm25_20251119Type) ToolUnionParam

func ToolUnionParamOfToolSearchToolRegex20251119

func ToolUnionParamOfToolSearchToolRegex20251119(type_ ToolSearchToolRegex20251119Type) ToolUnionParam

func (ToolUnionParam) GetAllowedCallers

func (u ToolUnionParam) GetAllowedCallers() []string

Returns a pointer to the underlying variant's AllowedCallers property, if present.

func (ToolUnionParam) GetAllowedDomains

func (u ToolUnionParam) GetAllowedDomains() []string

Returns a pointer to the underlying variant's AllowedDomains property, if present.

func (ToolUnionParam) GetBlockedDomains

func (u ToolUnionParam) GetBlockedDomains() []string

Returns a pointer to the underlying variant's BlockedDomains property, if present.

func (ToolUnionParam) GetCacheControl

func (u ToolUnionParam) GetCacheControl() *CacheControlEphemeralParam

Returns a pointer to the underlying variant's CacheControl property, if present.

func (ToolUnionParam) GetCitations

func (u ToolUnionParam) GetCitations() *CitationsConfigParam

Returns a pointer to the underlying variant's Citations property, if present.

func (ToolUnionParam) GetDeferLoading

func (u ToolUnionParam) GetDeferLoading() *bool

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetDescription

func (u ToolUnionParam) GetDescription() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetEagerInputStreaming

func (u ToolUnionParam) GetEagerInputStreaming() *bool

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetInputExamples

func (u ToolUnionParam) GetInputExamples() []map[string]any

Returns a pointer to the underlying variant's InputExamples property, if present.

func (ToolUnionParam) GetInputSchema

func (u ToolUnionParam) GetInputSchema() *ToolInputSchemaParam

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetMaxCharacters

func (u ToolUnionParam) GetMaxCharacters() *int64

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetMaxContentTokens

func (u ToolUnionParam) GetMaxContentTokens() *int64

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetMaxUses

func (u ToolUnionParam) GetMaxUses() *int64

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetName

func (u ToolUnionParam) GetName() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetResponseInclusion

func (u ToolUnionParam) GetResponseInclusion() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetStrict

func (u ToolUnionParam) GetStrict() *bool

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetType

func (u ToolUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetUseCache

func (u ToolUnionParam) GetUseCache() *bool

Returns a pointer to the underlying variant's property, if present.

func (ToolUnionParam) GetUserLocation

func (u ToolUnionParam) GetUserLocation() *UserLocationParam

Returns a pointer to the underlying variant's UserLocation property, if present.

func (ToolUnionParam) MarshalJSON

func (u ToolUnionParam) MarshalJSON() ([]byte, error)

func (*ToolUnionParam) UnmarshalJSON

func (u *ToolUnionParam) UnmarshalJSON(data []byte) error

type ToolUseBlock

type ToolUseBlock struct {
	ID string `json:"id" api:"required"`
	// Tool invocation directly from the model.
	Caller ToolUseBlockCallerUnion `json:"caller" api:"required"`
	// necessary custom code modification
	Input json.RawMessage  `json:"input,required"`
	Name  string           `json:"name" api:"required"`
	Type  constant.ToolUse `json:"type" default:"tool_use"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Caller      respjson.Field
		Input       respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ToolUseBlock) RawJSON

func (r ToolUseBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (ToolUseBlock) ToParam

func (r ToolUseBlock) ToParam() ToolUseBlockParam

func (*ToolUseBlock) UnmarshalJSON

func (r *ToolUseBlock) UnmarshalJSON(data []byte) error

type ToolUseBlockCallerUnion

type ToolUseBlockCallerUnion struct {
	// Any of "direct", "code_execution_20250825", "code_execution_20260120".
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ToolUseBlockCallerUnion contains all possible properties and values from DirectCaller, ServerToolCaller, ServerToolCaller20260120.

Use the ToolUseBlockCallerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ToolUseBlockCallerUnion) AsAny

func (u ToolUseBlockCallerUnion) AsAny() anyToolUseBlockCaller

Use the following switch statement to find the correct variant

switch variant := ToolUseBlockCallerUnion.AsAny().(type) {
case Juglow.DirectCaller:
case Juglow.ServerToolCaller:
case Juglow.ServerToolCaller20260120:
default:
  fmt.Errorf("no variant present")
}

func (ToolUseBlockCallerUnion) AsCodeExecution20250825

func (u ToolUseBlockCallerUnion) AsCodeExecution20250825() (v ServerToolCaller)

func (ToolUseBlockCallerUnion) AsCodeExecution20260120

func (u ToolUseBlockCallerUnion) AsCodeExecution20260120() (v ServerToolCaller20260120)

func (ToolUseBlockCallerUnion) AsDirect

func (u ToolUseBlockCallerUnion) AsDirect() (v DirectCaller)

func (ToolUseBlockCallerUnion) RawJSON

func (u ToolUseBlockCallerUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ToolUseBlockCallerUnion) UnmarshalJSON

func (r *ToolUseBlockCallerUnion) UnmarshalJSON(data []byte) error

type ToolUseBlockParam

type ToolUseBlockParam struct {
	ID    string `json:"id" api:"required"`
	Input any    `json:"input,omitzero" api:"required"`
	Name  string `json:"name" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Tool invocation directly from the model.
	Caller ToolUseBlockParamCallerUnion `json:"caller,omitzero"`
	// This field can be elided, and will marshal its zero value as "tool_use".
	Type constant.ToolUse `json:"type" default:"tool_use"`
	// contains filtered or unexported fields
}

The properties ID, Input, Name, Type are required.

func (ToolUseBlockParam) MarshalJSON

func (r ToolUseBlockParam) MarshalJSON() (data []byte, err error)

func (*ToolUseBlockParam) UnmarshalJSON

func (r *ToolUseBlockParam) UnmarshalJSON(data []byte) error

type ToolUseBlockParamCallerUnion

type ToolUseBlockParamCallerUnion struct {
	OfDirect                *DirectCallerParam             `json:",omitzero,inline"`
	OfCodeExecution20250825 *ServerToolCallerParam         `json:",omitzero,inline"`
	OfCodeExecution20260120 *ServerToolCaller20260120Param `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 (ToolUseBlockParamCallerUnion) GetToolID

func (u ToolUseBlockParamCallerUnion) GetToolID() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolUseBlockParamCallerUnion) GetType

func (u ToolUseBlockParamCallerUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (ToolUseBlockParamCallerUnion) MarshalJSON

func (u ToolUseBlockParamCallerUnion) MarshalJSON() ([]byte, error)

func (*ToolUseBlockParamCallerUnion) UnmarshalJSON

func (u *ToolUseBlockParamCallerUnion) UnmarshalJSON(data []byte) error

type URLImageSourceParam

type URLImageSourceParam struct {
	URL string `json:"url" api:"required"`
	// This field can be elided, and will marshal its zero value as "url".
	Type constant.URL `json:"type" default:"url"`
	// contains filtered or unexported fields
}

The properties Type, URL are required.

func (URLImageSourceParam) MarshalJSON

func (r URLImageSourceParam) MarshalJSON() (data []byte, err error)

func (*URLImageSourceParam) UnmarshalJSON

func (r *URLImageSourceParam) UnmarshalJSON(data []byte) error

type URLPDFSourceParam

type URLPDFSourceParam struct {
	URL string `json:"url" api:"required"`
	// This field can be elided, and will marshal its zero value as "url".
	Type constant.URL `json:"type" default:"url"`
	// contains filtered or unexported fields
}

The properties Type, URL are required.

func (URLPDFSourceParam) MarshalJSON

func (r URLPDFSourceParam) MarshalJSON() (data []byte, err error)

func (*URLPDFSourceParam) UnmarshalJSON

func (r *URLPDFSourceParam) UnmarshalJSON(data []byte) error

type UnwrapWebhookEvent

type UnwrapWebhookEvent struct {
	// Unique event identifier for idempotency.
	ID string `json:"id" api:"required"`
	// RFC 3339 timestamp when the event occurred.
	CreatedAt time.Time                 `json:"created_at" api:"required" format:"date-time"`
	Data      BetaWebhookEventDataUnion `json:"data" api:"required"`
	// Object type. Always `event` for webhook payloads.
	Type constant.Event `json:"type" default:"event"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UnwrapWebhookEvent) RawJSON

func (r UnwrapWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEvent) UnmarshalJSON

func (r *UnwrapWebhookEvent) UnmarshalJSON(data []byte) error

type Usage

type Usage struct {
	// Breakdown of cached tokens by TTL
	CacheCreation CacheCreation `json:"cache_creation" api:"required"`
	// The number of input tokens used to create the cache entry.
	CacheCreationInputTokens int64 `json:"cache_creation_input_tokens" api:"required"`
	// The number of input tokens read from the cache.
	CacheReadInputTokens int64 `json:"cache_read_input_tokens" api:"required"`
	// The geographic region where inference was performed for this request.
	InferenceGeo string `json:"inference_geo" api:"required"`
	// The number of input tokens which were used.
	InputTokens int64 `json:"input_tokens" api:"required"`
	// The number of output tokens which were used.
	OutputTokens int64 `json:"output_tokens" api:"required"`
	// Breakdown of output tokens by category.
	//
	// `output_tokens` remains the inclusive, authoritative total used for billing.
	// This object provides a read-only decomposition for observability — for example,
	// how many of the billed output tokens were spent on internal reasoning that may
	// have been summarized before being returned to you.
	OutputTokensDetails OutputTokensDetails `json:"output_tokens_details" api:"required"`
	// The number of server tool requests.
	ServerToolUse ServerToolUsage `json:"server_tool_use" api:"required"`
	// If the request used the priority, standard, or batch tier.
	//
	// Any of "standard", "priority", "batch".
	ServiceTier UsageServiceTier `json:"service_tier" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheCreation            respjson.Field
		CacheCreationInputTokens respjson.Field
		CacheReadInputTokens     respjson.Field
		InferenceGeo             respjson.Field
		InputTokens              respjson.Field
		OutputTokens             respjson.Field
		OutputTokensDetails      respjson.Field
		ServerToolUse            respjson.Field
		ServiceTier              respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Usage) RawJSON

func (r Usage) RawJSON() string

Returns the unmodified JSON received from the API

func (*Usage) UnmarshalJSON

func (r *Usage) UnmarshalJSON(data []byte) error

type UsageServiceTier

type UsageServiceTier string

If the request used the priority, standard, or batch tier.

const (
	UsageServiceTierStandard UsageServiceTier = "standard"
	UsageServiceTierPriority UsageServiceTier = "priority"
	UsageServiceTierBatch    UsageServiceTier = "batch"
)

type UserLocationParam

type UserLocationParam struct {
	// The city of the user.
	City param.Opt[string] `json:"city,omitzero"`
	// The two letter
	// [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the
	// user.
	Country param.Opt[string] `json:"country,omitzero"`
	// The region of the user.
	Region param.Opt[string] `json:"region,omitzero"`
	// The [IANA timezone](https://nodatime.org/TimeZones) of the user.
	Timezone param.Opt[string] `json:"timezone,omitzero"`
	// This field can be elided, and will marshal its zero value as "approximate".
	Type constant.Approximate `json:"type" default:"approximate"`
	// contains filtered or unexported fields
}

The property Type is required.

func (UserLocationParam) MarshalJSON

func (r UserLocationParam) MarshalJSON() (data []byte, err error)

func (*UserLocationParam) UnmarshalJSON

func (r *UserLocationParam) UnmarshalJSON(data []byte) error

type WebFetchBlock

type WebFetchBlock struct {
	Content DocumentBlock `json:"content" api:"required"`
	// ISO 8601 timestamp when the content was retrieved
	RetrievedAt string                  `json:"retrieved_at" api:"required"`
	Type        constant.WebFetchResult `json:"type" default:"web_fetch_result"`
	// Fetched content URL
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		RetrievedAt respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebFetchBlock) RawJSON

func (r WebFetchBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebFetchBlock) UnmarshalJSON

func (r *WebFetchBlock) UnmarshalJSON(data []byte) error

type WebFetchBlockParam

type WebFetchBlockParam struct {
	Content DocumentBlockParam `json:"content,omitzero" api:"required"`
	// Fetched content URL
	URL string `json:"url" api:"required"`
	// ISO 8601 timestamp when the content was retrieved
	RetrievedAt param.Opt[string] `json:"retrieved_at,omitzero"`
	// This field can be elided, and will marshal its zero value as "web_fetch_result".
	Type constant.WebFetchResult `json:"type" default:"web_fetch_result"`
	// contains filtered or unexported fields
}

The properties Content, Type, URL are required.

func (WebFetchBlockParam) MarshalJSON

func (r WebFetchBlockParam) MarshalJSON() (data []byte, err error)

func (*WebFetchBlockParam) UnmarshalJSON

func (r *WebFetchBlockParam) UnmarshalJSON(data []byte) error

type WebFetchTool20250910Param

type WebFetchTool20250910Param struct {
	// Maximum number of tokens used by including web page text content in the context.
	// The limit is approximate and does not apply to binary content such as PDFs.
	MaxContentTokens param.Opt[int64] `json:"max_content_tokens,omitzero"`
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// List of domains to allow fetching from
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// List of domains to block fetching from
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Citations configuration for fetched documents. Citations are disabled by
	// default.
	Citations CitationsConfigParam `json:"citations,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_fetch".
	Name constant.WebFetch `json:"name" default:"web_fetch"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_20250910".
	Type constant.WebFetch20250910 `json:"type" default:"web_fetch_20250910"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (WebFetchTool20250910Param) MarshalJSON

func (r WebFetchTool20250910Param) MarshalJSON() (data []byte, err error)

func (*WebFetchTool20250910Param) UnmarshalJSON

func (r *WebFetchTool20250910Param) UnmarshalJSON(data []byte) error

type WebFetchTool20260209Param

type WebFetchTool20260209Param struct {
	// Maximum number of tokens used by including web page text content in the context.
	// The limit is approximate and does not apply to binary content such as PDFs.
	MaxContentTokens param.Opt[int64] `json:"max_content_tokens,omitzero"`
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// List of domains to allow fetching from
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// List of domains to block fetching from
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Citations configuration for fetched documents. Citations are disabled by
	// default.
	Citations CitationsConfigParam `json:"citations,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_fetch".
	Name constant.WebFetch `json:"name" default:"web_fetch"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_20260209".
	Type constant.WebFetch20260209 `json:"type" default:"web_fetch_20260209"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (WebFetchTool20260209Param) MarshalJSON

func (r WebFetchTool20260209Param) MarshalJSON() (data []byte, err error)

func (*WebFetchTool20260209Param) UnmarshalJSON

func (r *WebFetchTool20260209Param) UnmarshalJSON(data []byte) error

type WebFetchTool20260309Param

type WebFetchTool20260309Param struct {
	// Maximum number of tokens used by including web page text content in the context.
	// The limit is approximate and does not apply to binary content such as PDFs.
	MaxContentTokens param.Opt[int64] `json:"max_content_tokens,omitzero"`
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Whether to use cached content. Set to false to bypass the cache and fetch fresh
	// content. Only set to false when the user explicitly requests fresh content or
	// when fetching rapidly-changing sources.
	UseCache param.Opt[bool] `json:"use_cache,omitzero"`
	// List of domains to allow fetching from
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// List of domains to block fetching from
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Citations configuration for fetched documents. Citations are disabled by
	// default.
	Citations CitationsConfigParam `json:"citations,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_fetch".
	Name constant.WebFetch `json:"name" default:"web_fetch"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_20260309".
	Type constant.WebFetch20260309 `json:"type" default:"web_fetch_20260309"`
	// contains filtered or unexported fields
}

Web fetch tool with use_cache parameter for bypassing cached content.

The properties Name, Type are required.

func (WebFetchTool20260309Param) MarshalJSON

func (r WebFetchTool20260309Param) MarshalJSON() (data []byte, err error)

func (*WebFetchTool20260309Param) UnmarshalJSON

func (r *WebFetchTool20260309Param) UnmarshalJSON(data []byte) error

type WebFetchTool20260318Param

type WebFetchTool20260318Param struct {
	// Maximum number of tokens used by including web page text content in the context.
	// The limit is approximate and does not apply to binary content such as PDFs.
	MaxContentTokens param.Opt[int64] `json:"max_content_tokens,omitzero"`
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// Whether to use cached content. Set to false to bypass the cache and fetch fresh
	// content. Only set to false when the user explicitly requests fresh content or
	// when fetching rapidly-changing sources.
	UseCache param.Opt[bool] `json:"use_cache,omitzero"`
	// List of domains to allow fetching from
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// List of domains to block fetching from
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Citations configuration for fetched documents. Citations are disabled by
	// default.
	Citations CitationsConfigParam `json:"citations,omitzero"`
	// How this tool's result blocks appear in the API response when the result was
	// consumed by a completed code_execution call in the same turn. 'full' returns the
	// complete content (default). 'excluded' drops the nested server_tool_use and
	// result block pair entirely. Results from direct calls, or from code_execution
	// calls that paused before completing, are always returned in full so they can be
	// sent back on the next turn.
	//
	// Any of "full", "excluded".
	ResponseInclusion WebFetchTool20260318ResponseInclusion `json:"response_inclusion,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_fetch".
	Name constant.WebFetch `json:"name" default:"web_fetch"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_20260318".
	Type constant.WebFetch20260318 `json:"type" default:"web_fetch_20260318"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (WebFetchTool20260318Param) MarshalJSON

func (r WebFetchTool20260318Param) MarshalJSON() (data []byte, err error)

func (*WebFetchTool20260318Param) UnmarshalJSON

func (r *WebFetchTool20260318Param) UnmarshalJSON(data []byte) error

type WebFetchTool20260318ResponseInclusion

type WebFetchTool20260318ResponseInclusion string

How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.

const (
	WebFetchTool20260318ResponseInclusionFull     WebFetchTool20260318ResponseInclusion = "full"
	WebFetchTool20260318ResponseInclusionExcluded WebFetchTool20260318ResponseInclusion = "excluded"
)

type WebFetchToolResultBlock

type WebFetchToolResultBlock struct {
	// Tool invocation directly from the model.
	Caller    WebFetchToolResultBlockCallerUnion  `json:"caller" api:"required"`
	Content   WebFetchToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                              `json:"tool_use_id" api:"required"`
	Type      constant.WebFetchToolResult         `json:"type" default:"web_fetch_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Caller      respjson.Field
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebFetchToolResultBlock) RawJSON

func (r WebFetchToolResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (WebFetchToolResultBlock) ToParam

func (*WebFetchToolResultBlock) UnmarshalJSON

func (r *WebFetchToolResultBlock) UnmarshalJSON(data []byte) error

type WebFetchToolResultBlockCallerUnion

type WebFetchToolResultBlockCallerUnion struct {
	// Any of "direct", "code_execution_20250825", "code_execution_20260120".
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebFetchToolResultBlockCallerUnion contains all possible properties and values from DirectCaller, ServerToolCaller, ServerToolCaller20260120.

Use the WebFetchToolResultBlockCallerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (WebFetchToolResultBlockCallerUnion) AsAny

func (u WebFetchToolResultBlockCallerUnion) AsAny() anyWebFetchToolResultBlockCaller

Use the following switch statement to find the correct variant

switch variant := WebFetchToolResultBlockCallerUnion.AsAny().(type) {
case Juglow.DirectCaller:
case Juglow.ServerToolCaller:
case Juglow.ServerToolCaller20260120:
default:
  fmt.Errorf("no variant present")
}

func (WebFetchToolResultBlockCallerUnion) AsCodeExecution20250825

func (u WebFetchToolResultBlockCallerUnion) AsCodeExecution20250825() (v ServerToolCaller)

func (WebFetchToolResultBlockCallerUnion) AsCodeExecution20260120

func (u WebFetchToolResultBlockCallerUnion) AsCodeExecution20260120() (v ServerToolCaller20260120)

func (WebFetchToolResultBlockCallerUnion) AsDirect

func (WebFetchToolResultBlockCallerUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebFetchToolResultBlockCallerUnion) UnmarshalJSON

func (r *WebFetchToolResultBlockCallerUnion) UnmarshalJSON(data []byte) error

type WebFetchToolResultBlockContentUnion

type WebFetchToolResultBlockContentUnion struct {
	// This field is from variant [WebFetchToolResultErrorBlock].
	ErrorCode WebFetchToolResultErrorCode `json:"error_code"`
	Type      string                      `json:"type"`
	// This field is from variant [WebFetchBlock].
	Content DocumentBlock `json:"content"`
	// This field is from variant [WebFetchBlock].
	RetrievedAt string `json:"retrieved_at"`
	// This field is from variant [WebFetchBlock].
	URL  string `json:"url"`
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		Content     respjson.Field
		RetrievedAt respjson.Field
		URL         respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebFetchToolResultBlockContentUnion contains all possible properties and values from WebFetchToolResultErrorBlock, WebFetchBlock.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (WebFetchToolResultBlockContentUnion) AsResponseWebFetchResultBlock

func (u WebFetchToolResultBlockContentUnion) AsResponseWebFetchResultBlock() (v WebFetchBlock)

func (WebFetchToolResultBlockContentUnion) AsResponseWebFetchToolResultError

func (u WebFetchToolResultBlockContentUnion) AsResponseWebFetchToolResultError() (v WebFetchToolResultErrorBlock)

func (WebFetchToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebFetchToolResultBlockContentUnion) UnmarshalJSON

func (r *WebFetchToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type WebFetchToolResultBlockParam

type WebFetchToolResultBlockParam struct {
	Content   WebFetchToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                   `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Tool invocation directly from the model.
	Caller WebFetchToolResultBlockParamCallerUnion `json:"caller,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_tool_result".
	Type constant.WebFetchToolResult `json:"type" default:"web_fetch_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (WebFetchToolResultBlockParam) MarshalJSON

func (r WebFetchToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*WebFetchToolResultBlockParam) UnmarshalJSON

func (r *WebFetchToolResultBlockParam) UnmarshalJSON(data []byte) error

type WebFetchToolResultBlockParamCallerUnion

type WebFetchToolResultBlockParamCallerUnion struct {
	OfDirect                *DirectCallerParam             `json:",omitzero,inline"`
	OfCodeExecution20250825 *ServerToolCallerParam         `json:",omitzero,inline"`
	OfCodeExecution20260120 *ServerToolCaller20260120Param `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 (WebFetchToolResultBlockParamCallerUnion) GetToolID

Returns a pointer to the underlying variant's property, if present.

func (WebFetchToolResultBlockParamCallerUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (WebFetchToolResultBlockParamCallerUnion) MarshalJSON

func (u WebFetchToolResultBlockParamCallerUnion) MarshalJSON() ([]byte, error)

func (*WebFetchToolResultBlockParamCallerUnion) UnmarshalJSON

func (u *WebFetchToolResultBlockParamCallerUnion) UnmarshalJSON(data []byte) error

type WebFetchToolResultBlockParamContentUnion

type WebFetchToolResultBlockParamContentUnion struct {
	OfRequestWebFetchToolResultError *WebFetchToolResultErrorBlockParam `json:",omitzero,inline"`
	OfRequestWebFetchResultBlock     *WebFetchBlockParam                `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 (WebFetchToolResultBlockParamContentUnion) GetContent

Returns a pointer to the underlying variant's property, if present.

func (WebFetchToolResultBlockParamContentUnion) GetErrorCode

Returns a pointer to the underlying variant's property, if present.

func (WebFetchToolResultBlockParamContentUnion) GetRetrievedAt

Returns a pointer to the underlying variant's property, if present.

func (WebFetchToolResultBlockParamContentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (WebFetchToolResultBlockParamContentUnion) GetURL

Returns a pointer to the underlying variant's property, if present.

func (WebFetchToolResultBlockParamContentUnion) MarshalJSON

func (*WebFetchToolResultBlockParamContentUnion) UnmarshalJSON

func (u *WebFetchToolResultBlockParamContentUnion) UnmarshalJSON(data []byte) error

type WebFetchToolResultErrorBlock

type WebFetchToolResultErrorBlock struct {
	// Any of "invalid_tool_input", "url_too_long", "url_not_allowed",
	// "url_not_in_prior_context", "url_not_accessible", "unsupported_content_type",
	// "too_many_requests", "max_uses_exceeded", "unavailable".
	ErrorCode WebFetchToolResultErrorCode      `json:"error_code" api:"required"`
	Type      constant.WebFetchToolResultError `json:"type" default:"web_fetch_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebFetchToolResultErrorBlock) RawJSON

Returns the unmodified JSON received from the API

func (*WebFetchToolResultErrorBlock) UnmarshalJSON

func (r *WebFetchToolResultErrorBlock) UnmarshalJSON(data []byte) error

type WebFetchToolResultErrorBlockParam

type WebFetchToolResultErrorBlockParam struct {
	// Any of "invalid_tool_input", "url_too_long", "url_not_allowed",
	// "url_not_in_prior_context", "url_not_accessible", "unsupported_content_type",
	// "too_many_requests", "max_uses_exceeded", "unavailable".
	ErrorCode WebFetchToolResultErrorCode `json:"error_code,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "web_fetch_tool_result_error".
	Type constant.WebFetchToolResultError `json:"type" default:"web_fetch_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (WebFetchToolResultErrorBlockParam) MarshalJSON

func (r WebFetchToolResultErrorBlockParam) MarshalJSON() (data []byte, err error)

func (*WebFetchToolResultErrorBlockParam) UnmarshalJSON

func (r *WebFetchToolResultErrorBlockParam) UnmarshalJSON(data []byte) error

type WebFetchToolResultErrorCode

type WebFetchToolResultErrorCode string
const (
	WebFetchToolResultErrorCodeInvalidToolInput       WebFetchToolResultErrorCode = "invalid_tool_input"
	WebFetchToolResultErrorCodeURLTooLong             WebFetchToolResultErrorCode = "url_too_long"
	WebFetchToolResultErrorCodeURLNotAllowed          WebFetchToolResultErrorCode = "url_not_allowed"
	WebFetchToolResultErrorCodeURLNotInPriorContext   WebFetchToolResultErrorCode = "url_not_in_prior_context"
	WebFetchToolResultErrorCodeURLNotAccessible       WebFetchToolResultErrorCode = "url_not_accessible"
	WebFetchToolResultErrorCodeUnsupportedContentType WebFetchToolResultErrorCode = "unsupported_content_type"
	WebFetchToolResultErrorCodeTooManyRequests        WebFetchToolResultErrorCode = "too_many_requests"
	WebFetchToolResultErrorCodeMaxUsesExceeded        WebFetchToolResultErrorCode = "max_uses_exceeded"
	WebFetchToolResultErrorCodeUnavailable            WebFetchToolResultErrorCode = "unavailable"
)

type WebSearchResultBlock

type WebSearchResultBlock struct {
	EncryptedContent string                   `json:"encrypted_content" api:"required"`
	PageAge          string                   `json:"page_age" api:"required"`
	Title            string                   `json:"title" api:"required"`
	Type             constant.WebSearchResult `json:"type" default:"web_search_result"`
	URL              string                   `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EncryptedContent respjson.Field
		PageAge          respjson.Field
		Title            respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebSearchResultBlock) RawJSON

func (r WebSearchResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (WebSearchResultBlock) ToParam

func (*WebSearchResultBlock) UnmarshalJSON

func (r *WebSearchResultBlock) UnmarshalJSON(data []byte) error

type WebSearchResultBlockParam

type WebSearchResultBlockParam struct {
	EncryptedContent string            `json:"encrypted_content" api:"required"`
	Title            string            `json:"title" api:"required"`
	URL              string            `json:"url" api:"required"`
	PageAge          param.Opt[string] `json:"page_age,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_result".
	Type constant.WebSearchResult `json:"type" default:"web_search_result"`
	// contains filtered or unexported fields
}

The properties EncryptedContent, Title, Type, URL are required.

func (WebSearchResultBlockParam) MarshalJSON

func (r WebSearchResultBlockParam) MarshalJSON() (data []byte, err error)

func (*WebSearchResultBlockParam) UnmarshalJSON

func (r *WebSearchResultBlockParam) UnmarshalJSON(data []byte) error

type WebSearchTool20250305Param

type WebSearchTool20250305Param struct {
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// If provided, only these domains will be included in results. Cannot be used
	// alongside `blocked_domains`.
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// If provided, these domains will never appear in results. Cannot be used
	// alongside `allowed_domains`.
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Parameters for the user's location. Used to provide more relevant search
	// results.
	UserLocation UserLocationParam `json:"user_location,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_search".
	Name constant.WebSearch `json:"name" default:"web_search"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_20250305".
	Type constant.WebSearch20250305 `json:"type" default:"web_search_20250305"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (WebSearchTool20250305Param) MarshalJSON

func (r WebSearchTool20250305Param) MarshalJSON() (data []byte, err error)

func (*WebSearchTool20250305Param) UnmarshalJSON

func (r *WebSearchTool20250305Param) UnmarshalJSON(data []byte) error

type WebSearchTool20250305UserLocationParam

type WebSearchTool20250305UserLocationParam = UserLocationParam

type WebSearchTool20260209Param

type WebSearchTool20260209Param struct {
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// If provided, only these domains will be included in results. Cannot be used
	// alongside `blocked_domains`.
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// If provided, these domains will never appear in results. Cannot be used
	// alongside `allowed_domains`.
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Parameters for the user's location. Used to provide more relevant search
	// results.
	UserLocation UserLocationParam `json:"user_location,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_search".
	Name constant.WebSearch `json:"name" default:"web_search"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_20260209".
	Type constant.WebSearch20260209 `json:"type" default:"web_search_20260209"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (WebSearchTool20260209Param) MarshalJSON

func (r WebSearchTool20260209Param) MarshalJSON() (data []byte, err error)

func (*WebSearchTool20260209Param) UnmarshalJSON

func (r *WebSearchTool20260209Param) UnmarshalJSON(data []byte) error

type WebSearchTool20260209UserLocationParam

type WebSearchTool20260209UserLocationParam = UserLocationParam

type WebSearchTool20260318Param

type WebSearchTool20260318Param struct {
	// Maximum number of times the tool can be used in the API request.
	MaxUses param.Opt[int64] `json:"max_uses,omitzero"`
	// If true, tool will not be included in initial system prompt. Only loaded when
	// returned via tool_reference from tool search.
	DeferLoading param.Opt[bool] `json:"defer_loading,omitzero"`
	// When true, guarantees schema validation on tool names and inputs
	Strict param.Opt[bool] `json:"strict,omitzero"`
	// If provided, only these domains will be included in results. Cannot be used
	// alongside `blocked_domains`.
	AllowedDomains []string `json:"allowed_domains,omitzero"`
	// If provided, these domains will never appear in results. Cannot be used
	// alongside `allowed_domains`.
	BlockedDomains []string `json:"blocked_domains,omitzero"`
	// Any of "direct", "code_execution_20250825", "code_execution_20260120",
	// "code_execution_20260521".
	AllowedCallers []string `json:"allowed_callers,omitzero"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// How this tool's result blocks appear in the API response when the result was
	// consumed by a completed code_execution call in the same turn. 'full' returns the
	// complete content (default). 'excluded' drops the nested server_tool_use and
	// result block pair entirely. Results from direct calls, or from code_execution
	// calls that paused before completing, are always returned in full so they can be
	// sent back on the next turn.
	//
	// Any of "full", "excluded".
	ResponseInclusion WebSearchTool20260318ResponseInclusion `json:"response_inclusion,omitzero"`
	// Parameters for the user's location. Used to provide more relevant search
	// results.
	UserLocation UserLocationParam `json:"user_location,omitzero"`
	// Name of the tool.
	//
	// This is how the tool will be called by the model and in `tool_use` blocks.
	//
	// This field can be elided, and will marshal its zero value as "web_search".
	Name constant.WebSearch `json:"name" default:"web_search"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_20260318".
	Type constant.WebSearch20260318 `json:"type" default:"web_search_20260318"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (WebSearchTool20260318Param) MarshalJSON

func (r WebSearchTool20260318Param) MarshalJSON() (data []byte, err error)

func (*WebSearchTool20260318Param) UnmarshalJSON

func (r *WebSearchTool20260318Param) UnmarshalJSON(data []byte) error

type WebSearchTool20260318ResponseInclusion

type WebSearchTool20260318ResponseInclusion string

How this tool's result blocks appear in the API response when the result was consumed by a completed code_execution call in the same turn. 'full' returns the complete content (default). 'excluded' drops the nested server_tool_use and result block pair entirely. Results from direct calls, or from code_execution calls that paused before completing, are always returned in full so they can be sent back on the next turn.

const (
	WebSearchTool20260318ResponseInclusionFull     WebSearchTool20260318ResponseInclusion = "full"
	WebSearchTool20260318ResponseInclusionExcluded WebSearchTool20260318ResponseInclusion = "excluded"
)

type WebSearchToolRequestErrorErrorCode

type WebSearchToolRequestErrorErrorCode = WebSearchToolResultErrorCode

type WebSearchToolRequestErrorParam

type WebSearchToolRequestErrorParam struct {
	// Any of "invalid_tool_input", "unavailable", "max_uses_exceeded",
	// "too_many_requests", "query_too_long", "request_too_large".
	ErrorCode WebSearchToolResultErrorCode `json:"error_code,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_tool_result_error".
	Type constant.WebSearchToolResultError `json:"type" default:"web_search_tool_result_error"`
	// contains filtered or unexported fields
}

The properties ErrorCode, Type are required.

func (WebSearchToolRequestErrorParam) MarshalJSON

func (r WebSearchToolRequestErrorParam) MarshalJSON() (data []byte, err error)

func (*WebSearchToolRequestErrorParam) UnmarshalJSON

func (r *WebSearchToolRequestErrorParam) UnmarshalJSON(data []byte) error

type WebSearchToolResultBlock

type WebSearchToolResultBlock struct {
	// Tool invocation directly from the model.
	Caller    WebSearchToolResultBlockCallerUnion  `json:"caller" api:"required"`
	Content   WebSearchToolResultBlockContentUnion `json:"content" api:"required"`
	ToolUseID string                               `json:"tool_use_id" api:"required"`
	Type      constant.WebSearchToolResult         `json:"type" default:"web_search_tool_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Caller      respjson.Field
		Content     respjson.Field
		ToolUseID   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebSearchToolResultBlock) RawJSON

func (r WebSearchToolResultBlock) RawJSON() string

Returns the unmodified JSON received from the API

func (WebSearchToolResultBlock) ToParam

func (*WebSearchToolResultBlock) UnmarshalJSON

func (r *WebSearchToolResultBlock) UnmarshalJSON(data []byte) error

type WebSearchToolResultBlockCallerUnion

type WebSearchToolResultBlockCallerUnion struct {
	// Any of "direct", "code_execution_20250825", "code_execution_20260120".
	Type   string `json:"type"`
	ToolID string `json:"tool_id"`
	JSON   struct {
		Type   respjson.Field
		ToolID respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebSearchToolResultBlockCallerUnion contains all possible properties and values from DirectCaller, ServerToolCaller, ServerToolCaller20260120.

Use the WebSearchToolResultBlockCallerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (WebSearchToolResultBlockCallerUnion) AsAny

func (u WebSearchToolResultBlockCallerUnion) AsAny() anyWebSearchToolResultBlockCaller

Use the following switch statement to find the correct variant

switch variant := WebSearchToolResultBlockCallerUnion.AsAny().(type) {
case Juglow.DirectCaller:
case Juglow.ServerToolCaller:
case Juglow.ServerToolCaller20260120:
default:
  fmt.Errorf("no variant present")
}

func (WebSearchToolResultBlockCallerUnion) AsCodeExecution20250825

func (u WebSearchToolResultBlockCallerUnion) AsCodeExecution20250825() (v ServerToolCaller)

func (WebSearchToolResultBlockCallerUnion) AsCodeExecution20260120

func (u WebSearchToolResultBlockCallerUnion) AsCodeExecution20260120() (v ServerToolCaller20260120)

func (WebSearchToolResultBlockCallerUnion) AsDirect

func (WebSearchToolResultBlockCallerUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebSearchToolResultBlockCallerUnion) UnmarshalJSON

func (r *WebSearchToolResultBlockCallerUnion) UnmarshalJSON(data []byte) error

type WebSearchToolResultBlockContentUnion

type WebSearchToolResultBlockContentUnion struct {
	// This field will be present if the value is a [[]WebSearchResultBlock] instead of
	// an object.
	OfWebSearchResultBlockArray []WebSearchResultBlock `json:",inline"`
	// This field is from variant [WebSearchToolResultError].
	ErrorCode WebSearchToolResultErrorCode `json:"error_code"`
	// This field is from variant [WebSearchToolResultError].
	Type constant.WebSearchToolResultError `json:"type"`
	JSON struct {
		OfWebSearchResultBlockArray respjson.Field
		ErrorCode                   respjson.Field
		Type                        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WebSearchToolResultBlockContentUnion contains all possible properties and values from WebSearchToolResultError, [[]WebSearchResultBlock].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfWebSearchResultBlockArray]

func (WebSearchToolResultBlockContentUnion) AsResponseWebSearchToolResultError

func (u WebSearchToolResultBlockContentUnion) AsResponseWebSearchToolResultError() (v WebSearchToolResultError)

func (WebSearchToolResultBlockContentUnion) AsWebSearchResultBlockArray

func (u WebSearchToolResultBlockContentUnion) AsWebSearchResultBlockArray() (v []WebSearchResultBlock)

func (WebSearchToolResultBlockContentUnion) RawJSON

Returns the unmodified JSON received from the API

func (WebSearchToolResultBlockContentUnion) ToParam

func (*WebSearchToolResultBlockContentUnion) UnmarshalJSON

func (r *WebSearchToolResultBlockContentUnion) UnmarshalJSON(data []byte) error

type WebSearchToolResultBlockParam

type WebSearchToolResultBlockParam struct {
	Content   WebSearchToolResultBlockParamContentUnion `json:"content,omitzero" api:"required"`
	ToolUseID string                                    `json:"tool_use_id" api:"required"`
	// Create a cache control breakpoint at this content block.
	CacheControl CacheControlEphemeralParam `json:"cache_control,omitzero"`
	// Tool invocation directly from the model.
	Caller WebSearchToolResultBlockParamCallerUnion `json:"caller,omitzero"`
	// This field can be elided, and will marshal its zero value as
	// "web_search_tool_result".
	Type constant.WebSearchToolResult `json:"type" default:"web_search_tool_result"`
	// contains filtered or unexported fields
}

The properties Content, ToolUseID, Type are required.

func (WebSearchToolResultBlockParam) MarshalJSON

func (r WebSearchToolResultBlockParam) MarshalJSON() (data []byte, err error)

func (*WebSearchToolResultBlockParam) UnmarshalJSON

func (r *WebSearchToolResultBlockParam) UnmarshalJSON(data []byte) error

type WebSearchToolResultBlockParamCallerUnion

type WebSearchToolResultBlockParamCallerUnion struct {
	OfDirect                *DirectCallerParam             `json:",omitzero,inline"`
	OfCodeExecution20250825 *ServerToolCallerParam         `json:",omitzero,inline"`
	OfCodeExecution20260120 *ServerToolCaller20260120Param `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 (WebSearchToolResultBlockParamCallerUnion) GetToolID

Returns a pointer to the underlying variant's property, if present.

func (WebSearchToolResultBlockParamCallerUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (WebSearchToolResultBlockParamCallerUnion) MarshalJSON

func (*WebSearchToolResultBlockParamCallerUnion) UnmarshalJSON

func (u *WebSearchToolResultBlockParamCallerUnion) UnmarshalJSON(data []byte) error

type WebSearchToolResultBlockParamContentUnion

type WebSearchToolResultBlockParamContentUnion struct {
	OfWebSearchToolResultBlockItem    []WebSearchResultBlockParam     `json:",omitzero,inline"`
	OfRequestWebSearchToolResultError *WebSearchToolRequestErrorParam `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 (WebSearchToolResultBlockParamContentUnion) MarshalJSON

func (*WebSearchToolResultBlockParamContentUnion) UnmarshalJSON

func (u *WebSearchToolResultBlockParamContentUnion) UnmarshalJSON(data []byte) error

type WebSearchToolResultError

type WebSearchToolResultError struct {
	// Any of "invalid_tool_input", "unavailable", "max_uses_exceeded",
	// "too_many_requests", "query_too_long", "request_too_large".
	ErrorCode WebSearchToolResultErrorCode      `json:"error_code" api:"required"`
	Type      constant.WebSearchToolResultError `json:"type" default:"web_search_tool_result_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebSearchToolResultError) RawJSON

func (r WebSearchToolResultError) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebSearchToolResultError) UnmarshalJSON

func (r *WebSearchToolResultError) UnmarshalJSON(data []byte) error

type WebSearchToolResultErrorCode

type WebSearchToolResultErrorCode string
const (
	WebSearchToolResultErrorCodeInvalidToolInput WebSearchToolResultErrorCode = "invalid_tool_input"
	WebSearchToolResultErrorCodeUnavailable      WebSearchToolResultErrorCode = "unavailable"
	WebSearchToolResultErrorCodeMaxUsesExceeded  WebSearchToolResultErrorCode = "max_uses_exceeded"
	WebSearchToolResultErrorCodeTooManyRequests  WebSearchToolResultErrorCode = "too_many_requests"
	WebSearchToolResultErrorCodeQueryTooLong     WebSearchToolResultErrorCode = "query_too_long"
	WebSearchToolResultErrorCodeRequestTooLarge  WebSearchToolResultErrorCode = "request_too_large"
)

type WebSearchToolResultErrorErrorCode

type WebSearchToolResultErrorErrorCode = WebSearchToolResultErrorCode

Directories

Path Synopsis
Package aws provides client configuration for the Juglow AWS gateway.
Package aws provides client configuration for the Juglow AWS gateway.
Package googlecloud provides client configuration for haijun Platform on Google Cloud — the first-party Juglow API served through the Google Cloud gateway.
Package googlecloud provides client configuration for haijun Platform on Google Cloud — the first-party Juglow API served through the Google Cloud gateway.
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.
stainlessheader
Package stainlessheader is the single source of truth for the x-stainless-helper telemetry header — the key, the closed set of tag values shared across SDKs, and the append-don't-clobber request option.
Package stainlessheader is the single source of truth for the x-stainless-helper telemetry header — the key, the closed set of tag values shared across SDKs, and the append-don't-clobber request option.
lib
betafallback
Package betafallback retries refused Messages requests down a fallback chain, client-side.
Package betafallback retries refused Messages requests down a fallback chain, client-side.
environments
Package environments provides helpers for running self-hosted environment workers: the control-plane WorkPoller (claim work items and hand them back) and the EnvironmentWorker composition (poll + tracks + run the session tools while heartbeating + force-stop + loop).
Package environments provides helpers for running self-hosted environment workers: the control-plane WorkPoller (claim work items and hand them back) and the EnvironmentWorker composition (poll + tracks + run the session tools while heartbeating + force-stop + loop).
Package mcp provides helpers for using Model Context Protocol tools and resources with the Juglow SDK.
Package mcp provides helpers for using Model Context Protocol tools and resources with the Juglow SDK.
packages
tools
agenttoolset
Package agenttoolset provides Node-equivalent local executors for the `agent_toolset_20260401` tool set — `bash`, `read`, `write`, `edit`, `glob`, `grep` — plus the workdir/tracks AgentToolContext and the track-download helper (AgentToolContext.SetupTracks).
Package agenttoolset provides Node-equivalent local executors for the `agent_toolset_20260401` tool set — `bash`, `read`, `write`, `edit`, `glob`, `grep` — plus the workdir/tracks AgentToolContext and the track-download helper (AgentToolContext.SetupTracks).

Jump to

Keyboard shortcuts

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