Help us shape the future of Go! Take the 2026 Go Developer Survey

perplexity

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 12 Imported by: 0

README

go-perplexity

Go Reference CI version license imported by

Unofficial Go client for the Perplexity API, generated with oapi-codegen from the OpenAPI document Perplexity publishes. I am not affiliated with Perplexity.

The package is perplexity, in the repository root. Everything in client.gen.go is generated. Don't edit it by hand, regenerate it.

Install

go get github.com/psyb0t/go-perplexity

Usage

Every endpoint in the spec has a typed method on ClientWithResponses. Responses decode into JSON200 and the other status fields.

package main

import (
	"context"
	"net/http"
	"os"

	"github.com/psyb0t/go-perplexity"
)

func main() {
	auth := perplexity.WithRequestEditorFn(func(_ context.Context, req *http.Request) error {
		req.Header.Set("Authorization", "Bearer "+os.Getenv("PERPLEXITY_API_KEY"))

		return nil
	})

	client, err := perplexity.NewClientWithResponses("https://api.perplexity.ai", auth)
	if err != nil {
		panic(err)
	}

	res, err := client.ListModelsWithResponse(context.Background())
	if err != nil {
		panic(err)
	}

	_ = res.JSON200
}

The same code is in example_test.go, so make test checks that it compiles.

The full API is in the Go reference; from inside your module, go doc github.com/psyb0t/go-perplexity prints the same.

Method names come from the spec's operation IDs. Some are long because the spec derives them from the route: the Sonar chat endpoint is ChatCompletionsChatCompletionsPost, search is SearchSearchPost, and the async Sonar endpoints carry an AsyncChatCompletions prefix and suffix. The list models response type is ListModelsResponse2, because ListModelsResponse is already a schema name in the spec.

Auth

Perplexity authenticates with a bearer token. Create an API key in the API settings of a Perplexity account and send it in the Authorization header, as in the request editor above. The base URL is https://api.perplexity.ai.

Regenerating

The spec is not committed. make generate downloads the current OpenAPI document into the gitignored api/ directory and regenerates the client:

make generate

gen.go declares the steps, so make generate is just go generate ./...:

  • scripts/fetch-spec.sh downloads https://docs.perplexity.ai/openapi.json to api/openapi.json.
  • oapi-codegen runs with config.yaml. The config maps number to float64, because the spec gives most numbers no format and oapi-codegen would otherwise use float32.

.github/workflows/regen.yml does the same every day in CI. When the new spec changes the client, it runs make lint, make test and make sec. If a check fails, Claude edits the code and the checks run again, up to three times, and a review step reads the result. A passing change is committed with a CHANGELOG entry and tagged as the next release: a patch version for fixes and additions, a minor version for breaking changes.

Agent integrations

The skill teaches a coding agent how to use go-perplexity when it writes Go. It works in any agent that reads .agents/skills/, and installs natively in the clients below.

Claude Code
claude plugin marketplace add psyb0t/agents
claude plugin install go-perplexity@psyb0t
Codex
codex plugin marketplace add psyb0t/agents
codex plugin add go-perplexity@psyb0t

Codex also picks the skill up with no install in any checkout of this repo.

OpenClaw

The skill is published to ClawHub on every release:

openclaw skills install @psyb0t/go-perplexity

Development

Every command runs in the Dockerfile.dev image. The host needs only Docker and Make.

make help      # list targets
make dep       # go mod tidy + vendor
make lint      # shellcheck, shfmt, go fix, golangci-lint
make test      # go test -race
make sec       # gitleaks, govulncheck, semgrep
make generate  # download the spec and regenerate

License

MIT. The generated code comes from Perplexity's published API specification. The specification itself is not redistributed here.

Documentation

Overview

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

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

Package perplexity is a Go client for the Perplexity REST API, generated with oapi-codegen from the OpenAPI document Perplexity publishes.

Example

This is the README usage example. It talks to the live API, so it has no Output comment and only has to compile.

package main

import (
	"context"
	"net/http"
	"os"

	"github.com/psyb0t/go-perplexity"
)

func main() {
	auth := perplexity.WithRequestEditorFn(
		func(_ context.Context, req *http.Request) error {
			req.Header.Set(
				"Authorization",
				"Bearer "+os.Getenv("PERPLEXITY_API_KEY"),
			)

			return nil
		},
	)

	client, err := perplexity.NewClientWithResponses(
		"https://api.perplexity.ai",
		auth,
	)
	if err != nil {
		panic(err)
	}

	res, err := client.ListModelsWithResponse(context.Background())
	if err != nil {
		panic(err)
	}

	_ = res.JSON200
}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCancelAgentResponseRequest

func NewCancelAgentResponseRequest(server string, id string) (*http.Request, error)

NewCancelAgentResponseRequest constructs an http.Request for the CancelAgentResponse method

func NewCancelBatchRequest added in v0.2.0

func NewCancelBatchRequest(server string, batchId BatchId) (*http.Request, error)

NewCancelBatchRequest constructs an http.Request for the CancelBatch method

func NewChatCompletionsChatCompletionsPostRequest

func NewChatCompletionsChatCompletionsPostRequest(server string, body ChatCompletionsChatCompletionsPostJSONRequestBody) (*http.Request, error)

NewChatCompletionsChatCompletionsPostRequest calls the generic ChatCompletionsChatCompletionsPost builder with application/json body

func NewChatCompletionsChatCompletionsPostRequestWithBody

func NewChatCompletionsChatCompletionsPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewChatCompletionsChatCompletionsPostRequestWithBody constructs an http.Request for the ChatCompletionsChatCompletionsPost method, with any body, and a specified content type

func NewContextualizedEmbeddingsV1ContextualizedembeddingsPostRequest

func NewContextualizedEmbeddingsV1ContextualizedembeddingsPostRequest(server string, body ContextualizedEmbeddingsV1ContextualizedembeddingsPostJSONRequestBody) (*http.Request, error)

NewContextualizedEmbeddingsV1ContextualizedembeddingsPostRequest calls the generic ContextualizedEmbeddingsV1ContextualizedembeddingsPost builder with application/json body

func NewContextualizedEmbeddingsV1ContextualizedembeddingsPostRequestWithBody

func NewContextualizedEmbeddingsV1ContextualizedembeddingsPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewContextualizedEmbeddingsV1ContextualizedembeddingsPostRequestWithBody constructs an http.Request for the ContextualizedEmbeddingsV1ContextualizedembeddingsPost method, with any body, and a specified content type

func NewCreateAgentRequest

func NewCreateAgentRequest(server string, body CreateAgentJSONRequestBody) (*http.Request, error)

NewCreateAgentRequest calls the generic CreateAgent builder with application/json body

func NewCreateAgentRequestWithBody

func NewCreateAgentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateAgentRequestWithBody constructs an http.Request for the CreateAgent method, with any body, and a specified content type

func NewCreateAsyncChatCompletionsAsyncChatCompletionsPostRequest

func NewCreateAsyncChatCompletionsAsyncChatCompletionsPostRequest(server string, body CreateAsyncChatCompletionsAsyncChatCompletionsPostJSONRequestBody) (*http.Request, error)

NewCreateAsyncChatCompletionsAsyncChatCompletionsPostRequest calls the generic CreateAsyncChatCompletionsAsyncChatCompletionsPost builder with application/json body

func NewCreateAsyncChatCompletionsAsyncChatCompletionsPostRequestWithBody

func NewCreateAsyncChatCompletionsAsyncChatCompletionsPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateAsyncChatCompletionsAsyncChatCompletionsPostRequestWithBody constructs an http.Request for the CreateAsyncChatCompletionsAsyncChatCompletionsPost method, with any body, and a specified content type

func NewCreateBatchRequest added in v0.2.0

func NewCreateBatchRequest(server string, params *CreateBatchParams, body CreateBatchJSONRequestBody) (*http.Request, error)

NewCreateBatchRequest calls the generic CreateBatch builder with application/json body

func NewCreateBatchRequestWithBody added in v0.2.0

func NewCreateBatchRequestWithBody(server string, params *CreateBatchParams, contentType string, body io.Reader) (*http.Request, error)

NewCreateBatchRequestWithBody constructs an http.Request for the CreateBatch method, with any body, and a specified content type

func NewCreateFileRequestWithBody added in v0.2.0

func NewCreateFileRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateFileRequestWithBody constructs an http.Request for the CreateFile method, with any body, and a specified content type

func NewCreateSkillRequestWithBody

func NewCreateSkillRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateSkillRequestWithBody constructs an http.Request for the CreateSkill method, with any body, and a specified content type

func NewDecisionsV1DecisionsPostRequest

func NewDecisionsV1DecisionsPostRequest(server string, body DecisionsV1DecisionsPostJSONRequestBody) (*http.Request, error)

NewDecisionsV1DecisionsPostRequest calls the generic DecisionsV1DecisionsPost builder with application/json body

func NewDecisionsV1DecisionsPostRequestWithBody

func NewDecisionsV1DecisionsPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewDecisionsV1DecisionsPostRequestWithBody constructs an http.Request for the DecisionsV1DecisionsPost method, with any body, and a specified content type

func NewDeleteFileRequest added in v0.2.0

func NewDeleteFileRequest(server string, fileId BatchFileId) (*http.Request, error)

NewDeleteFileRequest constructs an http.Request for the DeleteFile method

func NewDeleteSkillRequest

func NewDeleteSkillRequest(server string, skillId SkillId, params *DeleteSkillParams) (*http.Request, error)

NewDeleteSkillRequest constructs an http.Request for the DeleteSkill method

func NewDownloadAgentFileRequest

func NewDownloadAgentFileRequest(server string, id string, fileId string) (*http.Request, error)

NewDownloadAgentFileRequest constructs an http.Request for the DownloadAgentFile method

func NewDownloadSkillRequest

func NewDownloadSkillRequest(server string, skillId SkillId, params *DownloadSkillParams) (*http.Request, error)

NewDownloadSkillRequest constructs an http.Request for the DownloadSkill method

func NewEmbeddingsV1EmbeddingsPostRequest

func NewEmbeddingsV1EmbeddingsPostRequest(server string, body EmbeddingsV1EmbeddingsPostJSONRequestBody) (*http.Request, error)

NewEmbeddingsV1EmbeddingsPostRequest calls the generic EmbeddingsV1EmbeddingsPost builder with application/json body

func NewEmbeddingsV1EmbeddingsPostRequestWithBody

func NewEmbeddingsV1EmbeddingsPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewEmbeddingsV1EmbeddingsPostRequestWithBody constructs an http.Request for the EmbeddingsV1EmbeddingsPost method, with any body, and a specified content type

func NewGetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetRequest

func NewGetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetRequest(server string, apiRequest string) (*http.Request, error)

NewGetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetRequest constructs an http.Request for the GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet method

func NewGetBatchRequest added in v0.2.0

func NewGetBatchRequest(server string, batchId BatchId) (*http.Request, error)

NewGetBatchRequest constructs an http.Request for the GetBatch method

func NewGetComputerUsageAnalyticsRequest

func NewGetComputerUsageAnalyticsRequest(server string, params *GetComputerUsageAnalyticsParams) (*http.Request, error)

NewGetComputerUsageAnalyticsRequest constructs an http.Request for the GetComputerUsageAnalytics method

func NewGetComputerUsageAnalyticsV2Request

func NewGetComputerUsageAnalyticsV2Request(server string, params *GetComputerUsageAnalyticsV2Params) (*http.Request, error)

NewGetComputerUsageAnalyticsV2Request constructs an http.Request for the GetComputerUsageAnalyticsV2 method

func NewGetFileContentRequest added in v0.2.0

func NewGetFileContentRequest(server string, fileId BatchFileId) (*http.Request, error)

NewGetFileContentRequest constructs an http.Request for the GetFileContent method

func NewGetFileRequest added in v0.2.0

func NewGetFileRequest(server string, fileId BatchFileId) (*http.Request, error)

NewGetFileRequest constructs an http.Request for the GetFile method

func NewGetSkillRequest

func NewGetSkillRequest(server string, skillId SkillId, params *GetSkillParams) (*http.Request, error)

NewGetSkillRequest constructs an http.Request for the GetSkill method

func NewListAgentFilesRequest

func NewListAgentFilesRequest(server string, id string) (*http.Request, error)

NewListAgentFilesRequest constructs an http.Request for the ListAgentFiles method

func NewListAsyncChatCompletionsAsyncChatCompletionsGetRequest

func NewListAsyncChatCompletionsAsyncChatCompletionsGetRequest(server string) (*http.Request, error)

NewListAsyncChatCompletionsAsyncChatCompletionsGetRequest constructs an http.Request for the ListAsyncChatCompletionsAsyncChatCompletionsGet method

func NewListBatchesRequest added in v0.2.0

func NewListBatchesRequest(server string, params *ListBatchesParams) (*http.Request, error)

NewListBatchesRequest constructs an http.Request for the ListBatches method

func NewListFilesRequest added in v0.2.0

func NewListFilesRequest(server string, params *ListFilesParams) (*http.Request, error)

NewListFilesRequest constructs an http.Request for the ListFiles method

func NewListModelsRequest

func NewListModelsRequest(server string) (*http.Request, error)

NewListModelsRequest constructs an http.Request for the ListModels method

func NewListSkillRevisionsRequest

func NewListSkillRevisionsRequest(server string, skillId SkillId, params *ListSkillRevisionsParams) (*http.Request, error)

NewListSkillRevisionsRequest constructs an http.Request for the ListSkillRevisions method

func NewListSkillsRequest

func NewListSkillsRequest(server string, params *ListSkillsParams) (*http.Request, error)

NewListSkillsRequest constructs an http.Request for the ListSkills method

func NewRetrieveAgentRequest

func NewRetrieveAgentRequest(server string, id string) (*http.Request, error)

NewRetrieveAgentRequest constructs an http.Request for the RetrieveAgent method

func NewSearchSearchPostRequest

func NewSearchSearchPostRequest(server string, body SearchSearchPostJSONRequestBody) (*http.Request, error)

NewSearchSearchPostRequest calls the generic SearchSearchPost builder with application/json body

func NewSearchSearchPostRequestWithBody

func NewSearchSearchPostRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewSearchSearchPostRequestWithBody constructs an http.Request for the SearchSearchPost method, with any body, and a specified content type

func NewUpdateSkillRequestWithBody

func NewUpdateSkillRequestWithBody(server string, skillId SkillId, params *UpdateSkillParams, contentType string, body io.Reader) (*http.Request, error)

NewUpdateSkillRequestWithBody constructs an http.Request for the UpdateSkill method, with any body, and a specified content type

Types

type AnalyticsErrorResponse

type AnalyticsErrorResponse struct {
	Error struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
		Type    string `json:"type"`
	} `json:"error"`
}

AnalyticsErrorResponse defines model for AnalyticsErrorResponse.

type Annotation

type Annotation struct {
	// EndIndex End character index of the annotated text
	EndIndex *int32 `json:"end_index,omitempty"`

	// StartIndex Start character index of the annotated text
	StartIndex *int32 `json:"start_index,omitempty"`

	// Title Title of the cited source
	Title *string `json:"title,omitempty"`

	// Type Annotation type (url_citation)
	Type *string `json:"type,omitempty"`

	// Url URL of the cited source
	Url *string `json:"url,omitempty"`
}

Annotation Text annotation (URL citation)

type Answer

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

Answer One answer. Its `type` matches the question's `type`.

func (Answer) AsChoiceAnswer

func (t Answer) AsChoiceAnswer() (ChoiceAnswer, error)

AsChoiceAnswer returns the union data inside the Answer as a ChoiceAnswer

func (Answer) AsNoulAnswer

func (t Answer) AsNoulAnswer() (NoulAnswer, error)

AsNoulAnswer returns the union data inside the Answer as a NoulAnswer

func (Answer) AsScoreAnswer

func (t Answer) AsScoreAnswer() (ScoreAnswer, error)

AsScoreAnswer returns the union data inside the Answer as a ScoreAnswer

func (Answer) Discriminator

func (t Answer) Discriminator() (string, error)

func (*Answer) FromChoiceAnswer

func (t *Answer) FromChoiceAnswer(v ChoiceAnswer) error

FromChoiceAnswer overwrites any union data inside the Answer as the provided ChoiceAnswer

func (*Answer) FromNoulAnswer

func (t *Answer) FromNoulAnswer(v NoulAnswer) error

FromNoulAnswer overwrites any union data inside the Answer as the provided NoulAnswer

func (*Answer) FromScoreAnswer

func (t *Answer) FromScoreAnswer(v ScoreAnswer) error

FromScoreAnswer overwrites any union data inside the Answer as the provided ScoreAnswer

func (Answer) MarshalJSON

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

func (*Answer) MergeChoiceAnswer

func (t *Answer) MergeChoiceAnswer(v ChoiceAnswer) error

MergeChoiceAnswer performs a merge with any union data inside the Answer, using the provided ChoiceAnswer

func (*Answer) MergeNoulAnswer

func (t *Answer) MergeNoulAnswer(v NoulAnswer) error

MergeNoulAnswer performs a merge with any union data inside the Answer, using the provided NoulAnswer

func (*Answer) MergeScoreAnswer

func (t *Answer) MergeScoreAnswer(v ScoreAnswer) error

MergeScoreAnswer performs a merge with any union data inside the Answer, using the provided ScoreAnswer

func (*Answer) UnmarshalJSON

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

func (Answer) ValueByDiscriminator

func (t Answer) ValueByDiscriminator() (interface{}, error)

type ApiChatCompletionsRequest

type ApiChatCompletionsRequest struct {
	// DisableSearch When true, disables all web search capabilities. The model responds based solely on its training data
	DisableSearch *bool `json:"disable_search,omitempty"`

	// EnableSearchClassifier When true, uses a classifier to determine if web search is needed for the query
	EnableSearchClassifier *bool `json:"enable_search_classifier,omitempty"`

	// ImageDomainFilter Limit image results to specific domains
	ImageDomainFilter *[]string `json:"image_domain_filter,omitempty"`

	// ImageFormatFilter Filter image results by format (e.g. png, jpg)
	ImageFormatFilter *[]string `json:"image_format_filter,omitempty"`

	// LanguagePreference ISO 639-1 language code for preferred response language
	LanguagePreference *string `json:"language_preference,omitempty"`

	// LastUpdatedAfterFilter Return results last updated after this date (MM/DD/YYYY)
	LastUpdatedAfterFilter *string `json:"last_updated_after_filter,omitempty"`

	// LastUpdatedBeforeFilter Return results last updated before this date (MM/DD/YYYY)
	LastUpdatedBeforeFilter *string `json:"last_updated_before_filter,omitempty"`

	// MaxTokens Maximum number of completion tokens to generate
	MaxTokens *int `json:"max_tokens,omitempty"`

	// Messages Array of messages forming the conversation history
	Messages []ChatMessageInput `json:"messages"`

	// Model Model to use, for example, sonar-pro
	Model ApiChatCompletionsRequestModel `json:"model"`

	// ReasoningEffort Controls how much effort the model spends on reasoning
	ReasoningEffort *ApiChatCompletionsRequestReasoningEffort `json:"reasoning_effort,omitempty"`

	// ResponseFormat Optional. Controls the output format. Omit for default text output. Set `type` to `json_schema` for structured output.
	ResponseFormat *ApiChatCompletionsRequest_ResponseFormat `json:"response_format,omitempty"`

	// ReturnImages When true, include image results in the response
	ReturnImages *bool `json:"return_images,omitempty"`

	// ReturnRelatedQuestions When true, generates suggested follow-up queries based on the search results
	ReturnRelatedQuestions *bool `json:"return_related_questions,omitempty"`

	// SearchAfterDateFilter Return results published after this date (MM/DD/YYYY)
	SearchAfterDateFilter *string `json:"search_after_date_filter,omitempty"`

	// SearchBeforeDateFilter Return results published before this date (MM/DD/YYYY)
	SearchBeforeDateFilter *string `json:"search_before_date_filter,omitempty"`

	// SearchDomainFilter Limit search results to specific domains (e.g. github.com, wikipedia.org)
	SearchDomainFilter *[]string `json:"search_domain_filter,omitempty"`

	// SearchLanguageFilter Filter results by language using ISO 639-1 codes (e.g. en, fr, de)
	SearchLanguageFilter *[]string `json:"search_language_filter,omitempty"`

	// SearchMode Source of search results (web, academic, or sec)
	SearchMode *ApiChatCompletionsRequestSearchMode `json:"search_mode,omitempty"`

	// SearchRecencyFilter Filter by publication recency (hour, day, week, month, or year)
	SearchRecencyFilter *ApiChatCompletionsRequestSearchRecencyFilter `json:"search_recency_filter,omitempty"`

	// Stop Stop sequences. Generation stops when one of these strings is produced
	Stop *ApiChatCompletionsRequest_Stop `json:"stop,omitempty"`

	// Stream If true, returns streaming SSE response
	Stream *bool `json:"stream,omitempty"`

	// StreamMode Controls the format of streaming events. 'full' suppresses reasoning events and includes metadata inline; 'concise' emits reasoning events separately
	StreamMode *ApiChatCompletionsRequestStreamMode `json:"stream_mode,omitempty"`

	// Temperature Controls randomness in the response. Higher values make output more random. Range: 0-2
	Temperature *float64 `json:"temperature,omitempty"`

	// TopP Nucleus sampling parameter. Controls diversity via nucleus sampling
	TopP *float64 `json:"top_p,omitempty"`

	// WebSearchOptions Configuration options for web search behavior
	WebSearchOptions *WebSearchOptions `json:"web_search_options,omitempty"`
}

ApiChatCompletionsRequest defines model for ApiChatCompletionsRequest.

type ApiChatCompletionsRequestModel

type ApiChatCompletionsRequestModel string

ApiChatCompletionsRequestModel Model to use, for example, sonar-pro

const (
	ApiChatCompletionsRequestModelSonar             ApiChatCompletionsRequestModel = "sonar"
	ApiChatCompletionsRequestModelSonarDeepResearch ApiChatCompletionsRequestModel = "sonar-deep-research"
	ApiChatCompletionsRequestModelSonarPro          ApiChatCompletionsRequestModel = "sonar-pro"
	ApiChatCompletionsRequestModelSonarReasoningPro ApiChatCompletionsRequestModel = "sonar-reasoning-pro"
)

Defines values for ApiChatCompletionsRequestModel.

func (ApiChatCompletionsRequestModel) Valid

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

type ApiChatCompletionsRequestReasoningEffort

type ApiChatCompletionsRequestReasoningEffort string

ApiChatCompletionsRequestReasoningEffort defines model for ApiChatCompletionsRequest.ReasoningEffort.

const (
	ApiChatCompletionsRequestReasoningEffortHigh    ApiChatCompletionsRequestReasoningEffort = "high"
	ApiChatCompletionsRequestReasoningEffortLow     ApiChatCompletionsRequestReasoningEffort = "low"
	ApiChatCompletionsRequestReasoningEffortMedium  ApiChatCompletionsRequestReasoningEffort = "medium"
	ApiChatCompletionsRequestReasoningEffortMinimal ApiChatCompletionsRequestReasoningEffort = "minimal"
)

Defines values for ApiChatCompletionsRequestReasoningEffort.

func (ApiChatCompletionsRequestReasoningEffort) Valid

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

type ApiChatCompletionsRequestSearchMode

type ApiChatCompletionsRequestSearchMode string

ApiChatCompletionsRequestSearchMode defines model for ApiChatCompletionsRequest.SearchMode.

const (
	ApiChatCompletionsRequestSearchModeAcademic ApiChatCompletionsRequestSearchMode = "academic"
	ApiChatCompletionsRequestSearchModeSec      ApiChatCompletionsRequestSearchMode = "sec"
	ApiChatCompletionsRequestSearchModeWeb      ApiChatCompletionsRequestSearchMode = "web"
)

Defines values for ApiChatCompletionsRequestSearchMode.

func (ApiChatCompletionsRequestSearchMode) Valid

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

type ApiChatCompletionsRequestSearchRecencyFilter

type ApiChatCompletionsRequestSearchRecencyFilter string

ApiChatCompletionsRequestSearchRecencyFilter defines model for ApiChatCompletionsRequest.SearchRecencyFilter.

const (
	ApiChatCompletionsRequestSearchRecencyFilterDay   ApiChatCompletionsRequestSearchRecencyFilter = "day"
	ApiChatCompletionsRequestSearchRecencyFilterHour  ApiChatCompletionsRequestSearchRecencyFilter = "hour"
	ApiChatCompletionsRequestSearchRecencyFilterMonth ApiChatCompletionsRequestSearchRecencyFilter = "month"
	ApiChatCompletionsRequestSearchRecencyFilterWeek  ApiChatCompletionsRequestSearchRecencyFilter = "week"
	ApiChatCompletionsRequestSearchRecencyFilterYear  ApiChatCompletionsRequestSearchRecencyFilter = "year"
)

Defines values for ApiChatCompletionsRequestSearchRecencyFilter.

func (ApiChatCompletionsRequestSearchRecencyFilter) Valid

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

type ApiChatCompletionsRequestStop0

type ApiChatCompletionsRequestStop0 = string

ApiChatCompletionsRequestStop0 defines model for ApiChatCompletionsRequest.Stop.0.

type ApiChatCompletionsRequestStop1

type ApiChatCompletionsRequestStop1 = []string

ApiChatCompletionsRequestStop1 defines model for ApiChatCompletionsRequest.Stop.1.

type ApiChatCompletionsRequestStreamMode

type ApiChatCompletionsRequestStreamMode string

ApiChatCompletionsRequestStreamMode Controls the format of streaming events. 'full' suppresses reasoning events and includes metadata inline; 'concise' emits reasoning events separately

const (
	ApiChatCompletionsRequestStreamModeConcise ApiChatCompletionsRequestStreamMode = "concise"
	ApiChatCompletionsRequestStreamModeFull    ApiChatCompletionsRequestStreamMode = "full"
)

Defines values for ApiChatCompletionsRequestStreamMode.

func (ApiChatCompletionsRequestStreamMode) Valid

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

type ApiChatCompletionsRequest_ResponseFormat

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

ApiChatCompletionsRequest_ResponseFormat Optional. Controls the output format. Omit for default text output. Set `type` to `json_schema` for structured output.

func (ApiChatCompletionsRequest_ResponseFormat) AsResponseFormatJSONSchema

AsResponseFormatJSONSchema returns the union data inside the ApiChatCompletionsRequest_ResponseFormat as a ResponseFormatJSONSchema

func (ApiChatCompletionsRequest_ResponseFormat) AsResponseFormatText

AsResponseFormatText returns the union data inside the ApiChatCompletionsRequest_ResponseFormat as a ResponseFormatText

func (ApiChatCompletionsRequest_ResponseFormat) Discriminator

func (*ApiChatCompletionsRequest_ResponseFormat) FromResponseFormatJSONSchema

func (t *ApiChatCompletionsRequest_ResponseFormat) FromResponseFormatJSONSchema(v ResponseFormatJSONSchema) error

FromResponseFormatJSONSchema overwrites any union data inside the ApiChatCompletionsRequest_ResponseFormat as the provided ResponseFormatJSONSchema

func (*ApiChatCompletionsRequest_ResponseFormat) FromResponseFormatText

FromResponseFormatText overwrites any union data inside the ApiChatCompletionsRequest_ResponseFormat as the provided ResponseFormatText

func (ApiChatCompletionsRequest_ResponseFormat) MarshalJSON

func (*ApiChatCompletionsRequest_ResponseFormat) MergeResponseFormatJSONSchema

func (t *ApiChatCompletionsRequest_ResponseFormat) MergeResponseFormatJSONSchema(v ResponseFormatJSONSchema) error

MergeResponseFormatJSONSchema performs a merge with any union data inside the ApiChatCompletionsRequest_ResponseFormat, using the provided ResponseFormatJSONSchema

func (*ApiChatCompletionsRequest_ResponseFormat) MergeResponseFormatText

MergeResponseFormatText performs a merge with any union data inside the ApiChatCompletionsRequest_ResponseFormat, using the provided ResponseFormatText

func (*ApiChatCompletionsRequest_ResponseFormat) UnmarshalJSON

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

func (ApiChatCompletionsRequest_ResponseFormat) ValueByDiscriminator

func (t ApiChatCompletionsRequest_ResponseFormat) ValueByDiscriminator() (interface{}, error)

type ApiChatCompletionsRequest_Stop

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

ApiChatCompletionsRequest_Stop Stop sequences. Generation stops when one of these strings is produced

func (ApiChatCompletionsRequest_Stop) AsApiChatCompletionsRequestStop0

func (t ApiChatCompletionsRequest_Stop) AsApiChatCompletionsRequestStop0() (ApiChatCompletionsRequestStop0, error)

AsApiChatCompletionsRequestStop0 returns the union data inside the ApiChatCompletionsRequest_Stop as a ApiChatCompletionsRequestStop0

func (ApiChatCompletionsRequest_Stop) AsApiChatCompletionsRequestStop1

func (t ApiChatCompletionsRequest_Stop) AsApiChatCompletionsRequestStop1() (ApiChatCompletionsRequestStop1, error)

AsApiChatCompletionsRequestStop1 returns the union data inside the ApiChatCompletionsRequest_Stop as a ApiChatCompletionsRequestStop1

func (*ApiChatCompletionsRequest_Stop) FromApiChatCompletionsRequestStop0

func (t *ApiChatCompletionsRequest_Stop) FromApiChatCompletionsRequestStop0(v ApiChatCompletionsRequestStop0) error

FromApiChatCompletionsRequestStop0 overwrites any union data inside the ApiChatCompletionsRequest_Stop as the provided ApiChatCompletionsRequestStop0

func (*ApiChatCompletionsRequest_Stop) FromApiChatCompletionsRequestStop1

func (t *ApiChatCompletionsRequest_Stop) FromApiChatCompletionsRequestStop1(v ApiChatCompletionsRequestStop1) error

FromApiChatCompletionsRequestStop1 overwrites any union data inside the ApiChatCompletionsRequest_Stop as the provided ApiChatCompletionsRequestStop1

func (ApiChatCompletionsRequest_Stop) MarshalJSON

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

func (*ApiChatCompletionsRequest_Stop) MergeApiChatCompletionsRequestStop0

func (t *ApiChatCompletionsRequest_Stop) MergeApiChatCompletionsRequestStop0(v ApiChatCompletionsRequestStop0) error

MergeApiChatCompletionsRequestStop0 performs a merge with any union data inside the ApiChatCompletionsRequest_Stop, using the provided ApiChatCompletionsRequestStop0

func (*ApiChatCompletionsRequest_Stop) MergeApiChatCompletionsRequestStop1

func (t *ApiChatCompletionsRequest_Stop) MergeApiChatCompletionsRequestStop1(v ApiChatCompletionsRequestStop1) error

MergeApiChatCompletionsRequestStop1 performs a merge with any union data inside the ApiChatCompletionsRequest_Stop, using the provided ApiChatCompletionsRequestStop1

func (*ApiChatCompletionsRequest_Stop) UnmarshalJSON

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

type ApiError

type ApiError struct {
	Error *struct {
		// Code HTTP status code
		Code int `json:"code"`

		// Message Human-readable error message
		Message string `json:"message"`

		// Param Parameter that caused the error
		Param *string `json:"param,omitempty"`

		// Type Error type identifier
		Type string `json:"type"`
	} `json:"error,omitempty"`
}

ApiError defines model for ApiError.

type ApiPublicSearchResult

type ApiPublicSearchResult struct {
	// Date Publication date of the result
	Date *string `json:"date,omitempty"`

	// LastUpdated Date the result was last updated
	LastUpdated *string `json:"last_updated,omitempty"`

	// Snippet Text snippet from the search result
	Snippet *string `json:"snippet,omitempty"`

	// Source Source type of the result (web or attachment)
	Source *ApiPublicSearchResultSource `json:"source,omitempty"`

	// Title Title of the search result page
	Title string `json:"title"`

	// Url URL of the search result page
	Url string `json:"url"`
}

ApiPublicSearchResult A single search result from the web

type ApiPublicSearchResultSource

type ApiPublicSearchResultSource string

ApiPublicSearchResultSource Source type of the result (web or attachment)

const (
	ApiPublicSearchResultSourceAttachment ApiPublicSearchResultSource = "attachment"
	ApiPublicSearchResultSourceWeb        ApiPublicSearchResultSource = "web"
)

Defines values for ApiPublicSearchResultSource.

func (ApiPublicSearchResultSource) Valid

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

type ApiSearchPage

type ApiSearchPage struct {
	// Date Publication date of the page
	Date *string `json:"date,omitempty"`

	// LastUpdated Date the page was last updated
	LastUpdated *string `json:"last_updated,omitempty"`

	// Snippet Content snippet extracted from the page
	Snippet string `json:"snippet"`

	// Title Title of the page
	Title string `json:"title"`

	// Url URL of the page
	Url string `json:"url"`
}

ApiSearchPage A single page from search results

type ApiSearchRequest

type ApiSearchRequest struct {
	// Country ISO 3166-1 alpha-2 country code
	Country *string `json:"country,omitempty"`

	// LastUpdatedAfterFilter Return results updated after this date (MM/DD/YYYY)
	LastUpdatedAfterFilter *Date `json:"last_updated_after_filter,omitempty"`

	// LastUpdatedBeforeFilter Return results updated before this date (MM/DD/YYYY)
	LastUpdatedBeforeFilter *Date `json:"last_updated_before_filter,omitempty"`

	// MaxResults Maximum number of results. Values above 20 require search_type=people. Supports up to 20 for web search and up to 50 for people search.
	MaxResults *int `json:"max_results,omitempty"`

	// MaxTokens Maximum total webpage content tokens to return across all search results
	MaxTokens *int `json:"max_tokens,omitempty"`

	// MaxTokensPerPage Maximum webpage content tokens to extract from each result page
	MaxTokensPerPage *int `json:"max_tokens_per_page,omitempty"`

	// Query Search query (required)
	Query ApiSearchRequest_Query `json:"query"`

	// SearchAfterDateFilter Return results published after this date (MM/DD/YYYY)
	SearchAfterDateFilter *Date `json:"search_after_date_filter,omitempty"`

	// SearchBeforeDateFilter Return results published before this date (MM/DD/YYYY)
	SearchBeforeDateFilter *Date `json:"search_before_date_filter,omitempty"`

	// SearchDomainFilter Limit search results to specific domains (max 20)
	SearchDomainFilter *[]string `json:"search_domain_filter,omitempty"`

	// SearchLanguageFilter ISO 639-1 language codes (2-character max)
	SearchLanguageFilter *[]string `json:"search_language_filter,omitempty"`

	// SearchRecencyFilter Filter by publication recency (hour/day/week/month/year)
	SearchRecencyFilter *SearchRecencyFilter `json:"search_recency_filter,omitempty"`

	// SearchType Search type - "web" for general web search, "fast" for lower-latency, lower-cost web search, "people" for people search. max_results above 20 is only supported for people search.
	SearchType *ApiSearchRequestSearchType `json:"search_type,omitempty"`
}

ApiSearchRequest defines model for ApiSearchRequest.

type ApiSearchRequestQuery0

type ApiSearchRequestQuery0 = string

ApiSearchRequestQuery0 defines model for ApiSearchRequest.Query.0.

type ApiSearchRequestQuery1

type ApiSearchRequestQuery1 = []string

ApiSearchRequestQuery1 defines model for ApiSearchRequest.Query.1.

type ApiSearchRequestSearchType

type ApiSearchRequestSearchType string

ApiSearchRequestSearchType Search type - "web" for general web search, "fast" for lower-latency, lower-cost web search, "people" for people search. max_results above 20 is only supported for people search.

const (
	ApiSearchRequestSearchTypeFast   ApiSearchRequestSearchType = "fast"
	ApiSearchRequestSearchTypePeople ApiSearchRequestSearchType = "people"
	ApiSearchRequestSearchTypeWeb    ApiSearchRequestSearchType = "web"
)

Defines values for ApiSearchRequestSearchType.

func (ApiSearchRequestSearchType) Valid

func (e ApiSearchRequestSearchType) Valid() bool

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

type ApiSearchRequest_Query

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

ApiSearchRequest_Query Search query (required)

func (ApiSearchRequest_Query) AsApiSearchRequestQuery0

func (t ApiSearchRequest_Query) AsApiSearchRequestQuery0() (ApiSearchRequestQuery0, error)

AsApiSearchRequestQuery0 returns the union data inside the ApiSearchRequest_Query as a ApiSearchRequestQuery0

func (ApiSearchRequest_Query) AsApiSearchRequestQuery1

func (t ApiSearchRequest_Query) AsApiSearchRequestQuery1() (ApiSearchRequestQuery1, error)

AsApiSearchRequestQuery1 returns the union data inside the ApiSearchRequest_Query as a ApiSearchRequestQuery1

func (*ApiSearchRequest_Query) FromApiSearchRequestQuery0

func (t *ApiSearchRequest_Query) FromApiSearchRequestQuery0(v ApiSearchRequestQuery0) error

FromApiSearchRequestQuery0 overwrites any union data inside the ApiSearchRequest_Query as the provided ApiSearchRequestQuery0

func (*ApiSearchRequest_Query) FromApiSearchRequestQuery1

func (t *ApiSearchRequest_Query) FromApiSearchRequestQuery1(v ApiSearchRequestQuery1) error

FromApiSearchRequestQuery1 overwrites any union data inside the ApiSearchRequest_Query as the provided ApiSearchRequestQuery1

func (ApiSearchRequest_Query) MarshalJSON

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

func (*ApiSearchRequest_Query) MergeApiSearchRequestQuery0

func (t *ApiSearchRequest_Query) MergeApiSearchRequestQuery0(v ApiSearchRequestQuery0) error

MergeApiSearchRequestQuery0 performs a merge with any union data inside the ApiSearchRequest_Query, using the provided ApiSearchRequestQuery0

func (*ApiSearchRequest_Query) MergeApiSearchRequestQuery1

func (t *ApiSearchRequest_Query) MergeApiSearchRequestQuery1(v ApiSearchRequestQuery1) error

MergeApiSearchRequestQuery1 performs a merge with any union data inside the ApiSearchRequest_Query, using the provided ApiSearchRequestQuery1

func (*ApiSearchRequest_Query) UnmarshalJSON

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

type ApiSearchResponse

type ApiSearchResponse struct {
	Id         string          `json:"id"`
	Results    []ApiSearchPage `json:"results"`
	ServerTime *string         `json:"server_time,omitempty"`
}

ApiSearchResponse defines model for ApiSearchResponse.

type ApprovalFilter

type ApprovalFilter struct {
	// ReadOnly Matches the untrusted catalog classification reported as `mcp_list_tools.tools[].annotations.read_only`. Omitted or null imposes no classification constraint.
	ReadOnly *bool `json:"read_only,omitempty"`

	// ToolNames Exact, case-sensitive tool names. Omitted, null, or empty imposes no name constraint.
	ToolNames *[]string `json:"tool_names,omitempty"`
}

ApprovalFilter Matches a tool when every present field matches. An empty filter matches every tool.

type ApprovalFilters

type ApprovalFilters struct {
	// Always Calls matching this filter require approval.
	Always *ApprovalFilter `json:"always,omitempty"`

	// Never Calls matching this filter run automatically unless `always` also matches.
	Never *ApprovalFilter `json:"never,omitempty"`
}

ApprovalFilters Per-tool approval filters. An absent or null member matches no tool. Matching `always` takes precedence over matching `never`, and an unmatched call requires approval.

type AsyncApiChatCompletionsRequest

type AsyncApiChatCompletionsRequest struct {
	// IdempotencyKey Unique key to prevent duplicate requests
	IdempotencyKey *string `json:"idempotency_key,omitempty"`

	// Request The chat completion request to execute asynchronously
	Request ApiChatCompletionsRequest `json:"request"`
}

AsyncApiChatCompletionsRequest Request body for creating an asynchronous chat completion

type AsyncApiChatCompletionsResponse

type AsyncApiChatCompletionsResponse struct {
	// CompletedAt Unix timestamp when processing completed
	CompletedAt *int `json:"completed_at,omitempty"`

	// CreatedAt Unix timestamp when the request was created
	CreatedAt int `json:"created_at"`

	// ErrorMessage Error message if the request failed
	ErrorMessage *string `json:"error_message,omitempty"`

	// FailedAt Unix timestamp when the request failed (if applicable)
	FailedAt *int `json:"failed_at,omitempty"`

	// Id Unique identifier for the async request
	Id string `json:"id"`

	// Model Model used for the request
	Model    string              `json:"model"`
	Response *CompletionResponse `json:"response,omitempty"`

	// StartedAt Unix timestamp when processing started
	StartedAt *int `json:"started_at,omitempty"`

	// Status Current processing status of the request
	Status AsyncProcessingStatus `json:"status"`
}

AsyncApiChatCompletionsResponse defines model for AsyncApiChatCompletionsResponse.

type AsyncApiChatCompletionsResponseSummary

type AsyncApiChatCompletionsResponseSummary struct {
	CompletedAt *int   `json:"completed_at,omitempty"`
	CreatedAt   int    `json:"created_at"`
	FailedAt    *int   `json:"failed_at,omitempty"`
	Id          string `json:"id"`
	Model       string `json:"model"`
	StartedAt   *int   `json:"started_at,omitempty"`

	// Status Status enum for async processing.
	Status AsyncProcessingStatus `json:"status"`
}

AsyncApiChatCompletionsResponseSummary defines model for AsyncApiChatCompletionsResponseSummary.

type AsyncProcessingStatus

type AsyncProcessingStatus string

AsyncProcessingStatus Status enum for async processing.

const (
	AsyncProcessingStatusCOMPLETED  AsyncProcessingStatus = "COMPLETED"
	AsyncProcessingStatusCREATED    AsyncProcessingStatus = "CREATED"
	AsyncProcessingStatusFAILED     AsyncProcessingStatus = "FAILED"
	AsyncProcessingStatusINPROGRESS AsyncProcessingStatus = "IN_PROGRESS"
)

Defines values for AsyncProcessingStatus.

func (AsyncProcessingStatus) Valid

func (e AsyncProcessingStatus) Valid() bool

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

type BadRequest

type BadRequest = ErrorResponse

BadRequest The body of an error response.

type Batch added in v0.2.0

type Batch struct {
	CancelledAt      *int64 `json:"cancelled_at,omitempty"`
	CancellingAt     *int64 `json:"cancelling_at,omitempty"`
	CompletedAt      *int64 `json:"completed_at,omitempty"`
	CompletionWindow string `json:"completion_window"`

	// CreatedAt Unix seconds
	CreatedAt     int64              `json:"created_at"`
	Endpoint      string             `json:"endpoint"`
	ErrorFileId   *string            `json:"error_file_id,omitempty"`
	Errors        *BatchErrors       `json:"errors,omitempty"`
	ExpiredAt     *int64             `json:"expired_at,omitempty"`
	ExpiresAt     *int64             `json:"expires_at,omitempty"`
	FailedAt      *int64             `json:"failed_at,omitempty"`
	FinalizingAt  *int64             `json:"finalizing_at,omitempty"`
	Id            string             `json:"id"`
	InProgressAt  *int64             `json:"in_progress_at,omitempty"`
	InputFileId   string             `json:"input_file_id"`
	Metadata      *map[string]string `json:"metadata,omitempty"`
	Object        BatchObject        `json:"object"`
	OutputFileId  *string            `json:"output_file_id,omitempty"`
	RequestCounts BatchRequestCounts `json:"request_counts"`
	Status        BatchStatus        `json:"status"`
	Usage         BatchUsage         `json:"usage"`
}

Batch defines model for Batch.

type BatchError added in v0.2.0

type BatchError struct {
	Code string `json:"code"`

	// Line 1-based input line the error refers to
	Line    *int64 `json:"line,omitempty"`
	Message string `json:"message"`
}

BatchError defines model for BatchError.

type BatchErrors added in v0.2.0

type BatchErrors struct {
	Data   []BatchError      `json:"data"`
	Object BatchErrorsObject `json:"object"`
}

BatchErrors defines model for BatchErrors.

type BatchErrorsObject added in v0.2.0

type BatchErrorsObject string

BatchErrorsObject defines model for BatchErrors.Object.

const (
	BatchErrorsObjectList BatchErrorsObject = "list"
)

Defines values for BatchErrorsObject.

func (BatchErrorsObject) Valid added in v0.2.0

func (e BatchErrorsObject) Valid() bool

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

type BatchFile added in v0.2.0

type BatchFile struct {
	Bytes int64 `json:"bytes"`

	// CreatedAt Unix seconds
	CreatedAt int64 `json:"created_at"`

	// ExpiresAt Unix seconds
	ExpiresAt *int64          `json:"expires_at,omitempty"`
	Filename  string          `json:"filename"`
	Id        string          `json:"id"`
	Object    BatchFileObject `json:"object"`

	// Purpose `batch` for uploads, `batch_output` for output and error files
	Purpose BatchFilePurpose `json:"purpose"`
}

BatchFile defines model for BatchFile.

type BatchFileDeleted added in v0.2.0

type BatchFileDeleted struct {
	Deleted bool                   `json:"deleted"`
	Id      string                 `json:"id"`
	Object  BatchFileDeletedObject `json:"object"`
}

BatchFileDeleted defines model for BatchFileDeleted.

type BatchFileDeletedObject added in v0.2.0

type BatchFileDeletedObject string

BatchFileDeletedObject defines model for BatchFileDeleted.Object.

const (
	BatchFileDeletedObjectFile BatchFileDeletedObject = "file"
)

Defines values for BatchFileDeletedObject.

func (BatchFileDeletedObject) Valid added in v0.2.0

func (e BatchFileDeletedObject) Valid() bool

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

type BatchFileId added in v0.2.0

type BatchFileId = string

BatchFileId defines model for BatchFileId.

type BatchFileList added in v0.2.0

type BatchFileList struct {
	Data    []BatchFile         `json:"data"`
	FirstId *string             `json:"first_id,omitempty"`
	HasMore bool                `json:"has_more"`
	LastId  *string             `json:"last_id,omitempty"`
	Object  BatchFileListObject `json:"object"`
}

BatchFileList defines model for BatchFileList.

type BatchFileListObject added in v0.2.0

type BatchFileListObject string

BatchFileListObject defines model for BatchFileList.Object.

const (
	BatchFileListObjectList BatchFileListObject = "list"
)

Defines values for BatchFileListObject.

func (BatchFileListObject) Valid added in v0.2.0

func (e BatchFileListObject) Valid() bool

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

type BatchFileObject added in v0.2.0

type BatchFileObject string

BatchFileObject defines model for BatchFile.Object.

const (
	BatchFileObjectFile BatchFileObject = "file"
)

Defines values for BatchFileObject.

func (BatchFileObject) Valid added in v0.2.0

func (e BatchFileObject) Valid() bool

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

type BatchFilePurpose added in v0.2.0

type BatchFilePurpose string

BatchFilePurpose `batch` for uploads, `batch_output` for output and error files

const (
	BatchFilePurposeBatch       BatchFilePurpose = "batch"
	BatchFilePurposeBatchOutput BatchFilePurpose = "batch_output"
)

Defines values for BatchFilePurpose.

func (BatchFilePurpose) Valid added in v0.2.0

func (e BatchFilePurpose) Valid() bool

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

type BatchId added in v0.2.0

type BatchId = string

BatchId defines model for BatchId.

type BatchIdempotencyKey added in v0.2.0

type BatchIdempotencyKey = string

BatchIdempotencyKey defines model for BatchIdempotencyKey.

type BatchList added in v0.2.0

type BatchList struct {
	Data    []Batch         `json:"data"`
	FirstId *string         `json:"first_id,omitempty"`
	HasMore bool            `json:"has_more"`
	LastId  *string         `json:"last_id,omitempty"`
	Object  BatchListObject `json:"object"`
}

BatchList defines model for BatchList.

type BatchListObject added in v0.2.0

type BatchListObject string

BatchListObject defines model for BatchList.Object.

const (
	BatchListObjectList BatchListObject = "list"
)

Defines values for BatchListObject.

func (BatchListObject) Valid added in v0.2.0

func (e BatchListObject) Valid() bool

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

type BatchObject added in v0.2.0

type BatchObject string

BatchObject defines model for Batch.Object.

const (
	BatchObjectBatch BatchObject = "batch"
)

Defines values for BatchObject.

func (BatchObject) Valid added in v0.2.0

func (e BatchObject) Valid() bool

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

type BatchRequestCounts added in v0.2.0

type BatchRequestCounts struct {
	Completed int64 `json:"completed"`
	Failed    int64 `json:"failed"`
	Total     int64 `json:"total"`
}

BatchRequestCounts defines model for BatchRequestCounts.

type BatchStatus added in v0.2.0

type BatchStatus string

BatchStatus defines model for BatchStatus.

const (
	BatchStatusCancelled  BatchStatus = "cancelled"
	BatchStatusCancelling BatchStatus = "cancelling"
	BatchStatusCompleted  BatchStatus = "completed"
	BatchStatusExpired    BatchStatus = "expired"
	BatchStatusFailed     BatchStatus = "failed"
	BatchStatusFinalizing BatchStatus = "finalizing"
	BatchStatusInProgress BatchStatus = "in_progress"
	BatchStatusValidating BatchStatus = "validating"
)

Defines values for BatchStatus.

func (BatchStatus) Valid added in v0.2.0

func (e BatchStatus) Valid() bool

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

type BatchUsage added in v0.2.0

type BatchUsage struct {
	InputTokens        int64 `json:"input_tokens"`
	InputTokensDetails struct {
		CachedTokens int64 `json:"cached_tokens"`
	} `json:"input_tokens_details"`
	OutputTokens        int64 `json:"output_tokens"`
	OutputTokensDetails struct {
		ReasoningTokens int64 `json:"reasoning_tokens"`
	} `json:"output_tokens_details"`
	TotalTokens int64 `json:"total_tokens"`
}

BatchUsage defines model for BatchUsage.

type BuiltinSkill

type BuiltinSkill struct {
	// Name Built-in skill to make available to the model. office is the full Office bundle (enables all four leaves). office/docx, office/pdf, office/pptx, office/xlsx each create polished documents of that type from scratch, with structural validation and visual QA.
	Name BuiltinSkillName `json:"name"`
	Type BuiltinSkillType `json:"type"`
}

BuiltinSkill defines model for BuiltinSkill.

type BuiltinSkillName

type BuiltinSkillName string

BuiltinSkillName Built-in skill to make available to the model. office is the full Office bundle (enables all four leaves). office/docx, office/pdf, office/pptx, office/xlsx each create polished documents of that type from scratch, with structural validation and visual QA.

const (
	BuiltinSkillNameOffice     BuiltinSkillName = "office"
	BuiltinSkillNameOfficedocx BuiltinSkillName = "office/docx"
	BuiltinSkillNameOfficepdf  BuiltinSkillName = "office/pdf"
	BuiltinSkillNameOfficepptx BuiltinSkillName = "office/pptx"
	BuiltinSkillNameOfficexlsx BuiltinSkillName = "office/xlsx"
)

Defines values for BuiltinSkillName.

func (BuiltinSkillName) Valid

func (e BuiltinSkillName) Valid() bool

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

type BuiltinSkillType

type BuiltinSkillType string

BuiltinSkillType defines model for BuiltinSkill.Type.

const (
	BuiltinSkillTypeBuiltin BuiltinSkillType = "builtin"
)

Defines values for BuiltinSkillType.

func (BuiltinSkillType) Valid

func (e BuiltinSkillType) Valid() bool

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

type CancelAgentResponse200JSONResponseBodyStatus

type CancelAgentResponse200JSONResponseBodyStatus string

CancelAgentResponse200JSONResponseBodyStatus defines parameters for CancelAgentResponse.

const (
	CancelAgentResponse200JSONResponseBodyStatusCancelling CancelAgentResponse200JSONResponseBodyStatus = "cancelling"
)

Defines values for CancelAgentResponse200JSONResponseBodyStatus.

func (CancelAgentResponse200JSONResponseBodyStatus) Valid

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

type CancelAgentResponseResponse

type CancelAgentResponseResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *struct {
		// ResponseId The response id (`resp_<...>`).
		ResponseId string `json:"response_id"`

		// Status Always `cancelling` - the cancel was accepted and the run stops asynchronously. An already-terminal run returns `400` instead, so no terminal status appears here.
		Status CancelAgentResponse200JSONResponseBodyStatus `json:"status"`
	}
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *struct {
		// Error Error information returned when a request fails
		Error *ErrorInfo `json:"error,omitempty"`
	}
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *struct {
		// Error Error information returned when a request fails
		Error *ErrorInfo `json:"error,omitempty"`
	}
}

func ParseCancelAgentResponseResponse

func ParseCancelAgentResponseResponse(rsp *http.Response) (*CancelAgentResponseResponse, error)

ParseCancelAgentResponseResponse parses an HTTP response from a CancelAgentResponseWithResponse call

func (CancelAgentResponseResponse) ContentType

func (r CancelAgentResponseResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CancelAgentResponseResponse) GetBody

func (r CancelAgentResponseResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CancelAgentResponseResponse) GetJSON200

func (r CancelAgentResponseResponse) GetJSON200() *struct {
	// ResponseId The response id (`resp_<...>`).
	ResponseId string `json:"response_id"`

	// Status Always `cancelling` - the cancel was accepted and the run stops asynchronously. An already-terminal run returns `400` instead, so no terminal status appears here.
	Status CancelAgentResponse200JSONResponseBodyStatus `json:"status"`
}

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CancelAgentResponseResponse) GetJSON400

func (r CancelAgentResponseResponse) GetJSON400() *struct {
	// Error Error information returned when a request fails
	Error *ErrorInfo `json:"error,omitempty"`
}

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (CancelAgentResponseResponse) GetJSON404

func (r CancelAgentResponseResponse) GetJSON404() *struct {
	// Error Error information returned when a request fails
	Error *ErrorInfo `json:"error,omitempty"`
}

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (CancelAgentResponseResponse) Status

Status returns HTTPResponse.Status

func (CancelAgentResponseResponse) StatusCode

func (r CancelAgentResponseResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CancelBatchResponse added in v0.2.0

type CancelBatchResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Batch
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
	// JSON409 the response for an HTTP 409 `application/json` response
	JSON409 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
}

func ParseCancelBatchResponse added in v0.2.0

func ParseCancelBatchResponse(rsp *http.Response) (*CancelBatchResponse, error)

ParseCancelBatchResponse parses an HTTP response from a CancelBatchWithResponse call

func (CancelBatchResponse) ContentType added in v0.2.0

func (r CancelBatchResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CancelBatchResponse) GetBody added in v0.2.0

func (r CancelBatchResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CancelBatchResponse) GetJSON200 added in v0.2.0

func (r CancelBatchResponse) GetJSON200() *Batch

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CancelBatchResponse) GetJSON404 added in v0.2.0

func (r CancelBatchResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (CancelBatchResponse) GetJSON409 added in v0.2.0

func (r CancelBatchResponse) GetJSON409() *ApiError

GetJSON409 returns the response for an HTTP 409 `application/json` response

func (CancelBatchResponse) GetJSON429 added in v0.2.0

func (r CancelBatchResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (CancelBatchResponse) Status added in v0.2.0

func (r CancelBatchResponse) Status() string

Status returns HTTPResponse.Status

func (CancelBatchResponse) StatusCode added in v0.2.0

func (r CancelBatchResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ChatCompletionsChatCompletionsPostJSONRequestBody

type ChatCompletionsChatCompletionsPostJSONRequestBody = ApiChatCompletionsRequest

ChatCompletionsChatCompletionsPostJSONRequestBody defines body for ChatCompletionsChatCompletionsPost for application/json ContentType.

type ChatCompletionsChatCompletionsPostResponse

type ChatCompletionsChatCompletionsPostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *CompletionResponse
	// JSON422 the response for an HTTP 422 `application/json` response
	JSON422 *HTTPValidationError
}

func ParseChatCompletionsChatCompletionsPostResponse

func ParseChatCompletionsChatCompletionsPostResponse(rsp *http.Response) (*ChatCompletionsChatCompletionsPostResponse, error)

ParseChatCompletionsChatCompletionsPostResponse parses an HTTP response from a ChatCompletionsChatCompletionsPostWithResponse call

func (ChatCompletionsChatCompletionsPostResponse) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ChatCompletionsChatCompletionsPostResponse) GetBody

GetBody returns the raw response body bytes

func (ChatCompletionsChatCompletionsPostResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ChatCompletionsChatCompletionsPostResponse) GetJSON422

GetJSON422 returns the response for an HTTP 422 `application/json` response

func (ChatCompletionsChatCompletionsPostResponse) Status

Status returns HTTPResponse.Status

func (ChatCompletionsChatCompletionsPostResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type ChatMessageContentFileChunk

type ChatMessageContentFileChunk struct {
	FileName *string                             `json:"file_name,omitempty"`
	FileUrl  ChatMessageContentFileChunk_FileUrl `json:"file_url"`
	Type     ChatMessageContentFileChunkType     `json:"type"`
}

ChatMessageContentFileChunk defines model for ChatMessageContentFileChunk.

type ChatMessageContentFileChunkFileUrl1

type ChatMessageContentFileChunkFileUrl1 = string

ChatMessageContentFileChunkFileUrl1 defines model for ChatMessageContentFileChunk.FileUrl.1.

type ChatMessageContentFileChunkType

type ChatMessageContentFileChunkType string

ChatMessageContentFileChunkType defines model for ChatMessageContentFileChunk.Type.

const (
	ChatMessageContentFileChunkTypeFileUrl ChatMessageContentFileChunkType = "file_url"
)

Defines values for ChatMessageContentFileChunkType.

func (ChatMessageContentFileChunkType) Valid

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

type ChatMessageContentFileChunk_FileUrl

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

ChatMessageContentFileChunk_FileUrl defines model for ChatMessageContentFileChunk.FileUrl.

func (ChatMessageContentFileChunk_FileUrl) AsChatMessageContentFileChunkFileUrl1

func (t ChatMessageContentFileChunk_FileUrl) AsChatMessageContentFileChunkFileUrl1() (ChatMessageContentFileChunkFileUrl1, error)

AsChatMessageContentFileChunkFileUrl1 returns the union data inside the ChatMessageContentFileChunk_FileUrl as a ChatMessageContentFileChunkFileUrl1

func (ChatMessageContentFileChunk_FileUrl) AsURL

AsURL returns the union data inside the ChatMessageContentFileChunk_FileUrl as a URL

func (*ChatMessageContentFileChunk_FileUrl) FromChatMessageContentFileChunkFileUrl1

func (t *ChatMessageContentFileChunk_FileUrl) FromChatMessageContentFileChunkFileUrl1(v ChatMessageContentFileChunkFileUrl1) error

FromChatMessageContentFileChunkFileUrl1 overwrites any union data inside the ChatMessageContentFileChunk_FileUrl as the provided ChatMessageContentFileChunkFileUrl1

func (*ChatMessageContentFileChunk_FileUrl) FromURL

FromURL overwrites any union data inside the ChatMessageContentFileChunk_FileUrl as the provided URL

func (ChatMessageContentFileChunk_FileUrl) MarshalJSON

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

func (*ChatMessageContentFileChunk_FileUrl) MergeChatMessageContentFileChunkFileUrl1

func (t *ChatMessageContentFileChunk_FileUrl) MergeChatMessageContentFileChunkFileUrl1(v ChatMessageContentFileChunkFileUrl1) error

MergeChatMessageContentFileChunkFileUrl1 performs a merge with any union data inside the ChatMessageContentFileChunk_FileUrl, using the provided ChatMessageContentFileChunkFileUrl1

func (*ChatMessageContentFileChunk_FileUrl) MergeURL

MergeURL performs a merge with any union data inside the ChatMessageContentFileChunk_FileUrl, using the provided URL

func (*ChatMessageContentFileChunk_FileUrl) UnmarshalJSON

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

type ChatMessageContentImageChunk

type ChatMessageContentImageChunk struct {
	ImageUrl ChatMessageContentImageChunk_ImageUrl `json:"image_url"`
	Type     ChatMessageContentImageChunkType      `json:"type"`
}

ChatMessageContentImageChunk defines model for ChatMessageContentImageChunk.

type ChatMessageContentImageChunkImageUrl1

type ChatMessageContentImageChunkImageUrl1 = string

ChatMessageContentImageChunkImageUrl1 defines model for ChatMessageContentImageChunk.ImageUrl.1.

type ChatMessageContentImageChunkType

type ChatMessageContentImageChunkType string

ChatMessageContentImageChunkType defines model for ChatMessageContentImageChunk.Type.

const (
	ChatMessageContentImageChunkTypeImageUrl ChatMessageContentImageChunkType = "image_url"
)

Defines values for ChatMessageContentImageChunkType.

func (ChatMessageContentImageChunkType) Valid

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

type ChatMessageContentImageChunk_ImageUrl

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

ChatMessageContentImageChunk_ImageUrl defines model for ChatMessageContentImageChunk.ImageUrl.

func (ChatMessageContentImageChunk_ImageUrl) AsChatMessageContentImageChunkImageUrl1

func (t ChatMessageContentImageChunk_ImageUrl) AsChatMessageContentImageChunkImageUrl1() (ChatMessageContentImageChunkImageUrl1, error)

AsChatMessageContentImageChunkImageUrl1 returns the union data inside the ChatMessageContentImageChunk_ImageUrl as a ChatMessageContentImageChunkImageUrl1

func (ChatMessageContentImageChunk_ImageUrl) AsURL

AsURL returns the union data inside the ChatMessageContentImageChunk_ImageUrl as a URL

func (*ChatMessageContentImageChunk_ImageUrl) FromChatMessageContentImageChunkImageUrl1

func (t *ChatMessageContentImageChunk_ImageUrl) FromChatMessageContentImageChunkImageUrl1(v ChatMessageContentImageChunkImageUrl1) error

FromChatMessageContentImageChunkImageUrl1 overwrites any union data inside the ChatMessageContentImageChunk_ImageUrl as the provided ChatMessageContentImageChunkImageUrl1

func (*ChatMessageContentImageChunk_ImageUrl) FromURL

FromURL overwrites any union data inside the ChatMessageContentImageChunk_ImageUrl as the provided URL

func (ChatMessageContentImageChunk_ImageUrl) MarshalJSON

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

func (*ChatMessageContentImageChunk_ImageUrl) MergeChatMessageContentImageChunkImageUrl1

func (t *ChatMessageContentImageChunk_ImageUrl) MergeChatMessageContentImageChunkImageUrl1(v ChatMessageContentImageChunkImageUrl1) error

MergeChatMessageContentImageChunkImageUrl1 performs a merge with any union data inside the ChatMessageContentImageChunk_ImageUrl, using the provided ChatMessageContentImageChunkImageUrl1

func (*ChatMessageContentImageChunk_ImageUrl) MergeURL

MergeURL performs a merge with any union data inside the ChatMessageContentImageChunk_ImageUrl, using the provided URL

func (*ChatMessageContentImageChunk_ImageUrl) UnmarshalJSON

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

type ChatMessageContentPDFChunk

type ChatMessageContentPDFChunk struct {
	PdfUrl ChatMessageContentPDFChunk_PdfUrl `json:"pdf_url"`
	Type   ChatMessageContentPDFChunkType    `json:"type"`
}

ChatMessageContentPDFChunk defines model for ChatMessageContentPDFChunk.

type ChatMessageContentPDFChunkPdfUrl1

type ChatMessageContentPDFChunkPdfUrl1 = string

ChatMessageContentPDFChunkPdfUrl1 defines model for ChatMessageContentPDFChunk.PdfUrl.1.

type ChatMessageContentPDFChunkType

type ChatMessageContentPDFChunkType string

ChatMessageContentPDFChunkType defines model for ChatMessageContentPDFChunk.Type.

const (
	ChatMessageContentPDFChunkTypePdfUrl ChatMessageContentPDFChunkType = "pdf_url"
)

Defines values for ChatMessageContentPDFChunkType.

func (ChatMessageContentPDFChunkType) Valid

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

type ChatMessageContentPDFChunk_PdfUrl

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

ChatMessageContentPDFChunk_PdfUrl defines model for ChatMessageContentPDFChunk.PdfUrl.

func (ChatMessageContentPDFChunk_PdfUrl) AsChatMessageContentPDFChunkPdfUrl1

func (t ChatMessageContentPDFChunk_PdfUrl) AsChatMessageContentPDFChunkPdfUrl1() (ChatMessageContentPDFChunkPdfUrl1, error)

AsChatMessageContentPDFChunkPdfUrl1 returns the union data inside the ChatMessageContentPDFChunk_PdfUrl as a ChatMessageContentPDFChunkPdfUrl1

func (ChatMessageContentPDFChunk_PdfUrl) AsURL

AsURL returns the union data inside the ChatMessageContentPDFChunk_PdfUrl as a URL

func (*ChatMessageContentPDFChunk_PdfUrl) FromChatMessageContentPDFChunkPdfUrl1

func (t *ChatMessageContentPDFChunk_PdfUrl) FromChatMessageContentPDFChunkPdfUrl1(v ChatMessageContentPDFChunkPdfUrl1) error

FromChatMessageContentPDFChunkPdfUrl1 overwrites any union data inside the ChatMessageContentPDFChunk_PdfUrl as the provided ChatMessageContentPDFChunkPdfUrl1

func (*ChatMessageContentPDFChunk_PdfUrl) FromURL

FromURL overwrites any union data inside the ChatMessageContentPDFChunk_PdfUrl as the provided URL

func (ChatMessageContentPDFChunk_PdfUrl) MarshalJSON

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

func (*ChatMessageContentPDFChunk_PdfUrl) MergeChatMessageContentPDFChunkPdfUrl1

func (t *ChatMessageContentPDFChunk_PdfUrl) MergeChatMessageContentPDFChunkPdfUrl1(v ChatMessageContentPDFChunkPdfUrl1) error

MergeChatMessageContentPDFChunkPdfUrl1 performs a merge with any union data inside the ChatMessageContentPDFChunk_PdfUrl, using the provided ChatMessageContentPDFChunkPdfUrl1

func (*ChatMessageContentPDFChunk_PdfUrl) MergeURL

MergeURL performs a merge with any union data inside the ChatMessageContentPDFChunk_PdfUrl, using the provided URL

func (*ChatMessageContentPDFChunk_PdfUrl) UnmarshalJSON

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

type ChatMessageContentTextChunk

type ChatMessageContentTextChunk struct {
	Text string                          `json:"text"`
	Type ChatMessageContentTextChunkType `json:"type"`
}

ChatMessageContentTextChunk defines model for ChatMessageContentTextChunk.

type ChatMessageContentTextChunkType

type ChatMessageContentTextChunkType string

ChatMessageContentTextChunkType defines model for ChatMessageContentTextChunk.Type.

const (
	ChatMessageContentTextChunkTypeText ChatMessageContentTextChunkType = "text"
)

Defines values for ChatMessageContentTextChunkType.

func (ChatMessageContentTextChunkType) Valid

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

type ChatMessageContentVideoChunk

type ChatMessageContentVideoChunk struct {
	Type     ChatMessageContentVideoChunkType      `json:"type"`
	VideoUrl ChatMessageContentVideoChunk_VideoUrl `json:"video_url"`
}

ChatMessageContentVideoChunk defines model for ChatMessageContentVideoChunk.

type ChatMessageContentVideoChunkType

type ChatMessageContentVideoChunkType string

ChatMessageContentVideoChunkType defines model for ChatMessageContentVideoChunk.Type.

const (
	ChatMessageContentVideoChunkTypeVideoUrl ChatMessageContentVideoChunkType = "video_url"
)

Defines values for ChatMessageContentVideoChunkType.

func (ChatMessageContentVideoChunkType) Valid

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

type ChatMessageContentVideoChunkVideoUrl1

type ChatMessageContentVideoChunkVideoUrl1 = string

ChatMessageContentVideoChunkVideoUrl1 defines model for ChatMessageContentVideoChunk.VideoUrl.1.

type ChatMessageContentVideoChunk_VideoUrl

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

ChatMessageContentVideoChunk_VideoUrl defines model for ChatMessageContentVideoChunk.VideoUrl.

func (ChatMessageContentVideoChunk_VideoUrl) AsChatMessageContentVideoChunkVideoUrl1

func (t ChatMessageContentVideoChunk_VideoUrl) AsChatMessageContentVideoChunkVideoUrl1() (ChatMessageContentVideoChunkVideoUrl1, error)

AsChatMessageContentVideoChunkVideoUrl1 returns the union data inside the ChatMessageContentVideoChunk_VideoUrl as a ChatMessageContentVideoChunkVideoUrl1

func (ChatMessageContentVideoChunk_VideoUrl) AsVideoURL

AsVideoURL returns the union data inside the ChatMessageContentVideoChunk_VideoUrl as a VideoURL

func (*ChatMessageContentVideoChunk_VideoUrl) FromChatMessageContentVideoChunkVideoUrl1

func (t *ChatMessageContentVideoChunk_VideoUrl) FromChatMessageContentVideoChunkVideoUrl1(v ChatMessageContentVideoChunkVideoUrl1) error

FromChatMessageContentVideoChunkVideoUrl1 overwrites any union data inside the ChatMessageContentVideoChunk_VideoUrl as the provided ChatMessageContentVideoChunkVideoUrl1

func (*ChatMessageContentVideoChunk_VideoUrl) FromVideoURL

FromVideoURL overwrites any union data inside the ChatMessageContentVideoChunk_VideoUrl as the provided VideoURL

func (ChatMessageContentVideoChunk_VideoUrl) MarshalJSON

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

func (*ChatMessageContentVideoChunk_VideoUrl) MergeChatMessageContentVideoChunkVideoUrl1

func (t *ChatMessageContentVideoChunk_VideoUrl) MergeChatMessageContentVideoChunkVideoUrl1(v ChatMessageContentVideoChunkVideoUrl1) error

MergeChatMessageContentVideoChunkVideoUrl1 performs a merge with any union data inside the ChatMessageContentVideoChunk_VideoUrl, using the provided ChatMessageContentVideoChunkVideoUrl1

func (*ChatMessageContentVideoChunk_VideoUrl) MergeVideoURL

MergeVideoURL performs a merge with any union data inside the ChatMessageContentVideoChunk_VideoUrl, using the provided VideoURL

func (*ChatMessageContentVideoChunk_VideoUrl) UnmarshalJSON

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

type ChatMessageInput

type ChatMessageInput struct {
	Content *ChatMessageInput_Content `json:"content"`

	// Role Chat roles enum
	Role ChatMessageRole `json:"role"`
}

ChatMessageInput defines model for ChatMessage-Input.

type ChatMessageInputContent0

type ChatMessageInputContent0 = string

ChatMessageInputContent0 defines model for ChatMessageInput.Content.0.

type ChatMessageInputContent1

type ChatMessageInputContent1 = []ChatMessageInput_Content_1_Item

ChatMessageInputContent1 defines model for ChatMessageInput.Content.1.

type ChatMessageInput_Content

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

ChatMessageInput_Content defines model for ChatMessageInput.Content.

func (ChatMessageInput_Content) AsChatMessageInputContent0

func (t ChatMessageInput_Content) AsChatMessageInputContent0() (ChatMessageInputContent0, error)

AsChatMessageInputContent0 returns the union data inside the ChatMessageInput_Content as a ChatMessageInputContent0

func (ChatMessageInput_Content) AsChatMessageInputContent1

func (t ChatMessageInput_Content) AsChatMessageInputContent1() (ChatMessageInputContent1, error)

AsChatMessageInputContent1 returns the union data inside the ChatMessageInput_Content as a ChatMessageInputContent1

func (*ChatMessageInput_Content) FromChatMessageInputContent0

func (t *ChatMessageInput_Content) FromChatMessageInputContent0(v ChatMessageInputContent0) error

FromChatMessageInputContent0 overwrites any union data inside the ChatMessageInput_Content as the provided ChatMessageInputContent0

func (*ChatMessageInput_Content) FromChatMessageInputContent1

func (t *ChatMessageInput_Content) FromChatMessageInputContent1(v ChatMessageInputContent1) error

FromChatMessageInputContent1 overwrites any union data inside the ChatMessageInput_Content as the provided ChatMessageInputContent1

func (ChatMessageInput_Content) MarshalJSON

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

func (*ChatMessageInput_Content) MergeChatMessageInputContent0

func (t *ChatMessageInput_Content) MergeChatMessageInputContent0(v ChatMessageInputContent0) error

MergeChatMessageInputContent0 performs a merge with any union data inside the ChatMessageInput_Content, using the provided ChatMessageInputContent0

func (*ChatMessageInput_Content) MergeChatMessageInputContent1

func (t *ChatMessageInput_Content) MergeChatMessageInputContent1(v ChatMessageInputContent1) error

MergeChatMessageInputContent1 performs a merge with any union data inside the ChatMessageInput_Content, using the provided ChatMessageInputContent1

func (*ChatMessageInput_Content) UnmarshalJSON

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

type ChatMessageInput_Content_1_Item

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

ChatMessageInput_Content_1_Item defines model for ChatMessageInput.Content.1.Item.

func (ChatMessageInput_Content_1_Item) AsChatMessageContentFileChunk

func (t ChatMessageInput_Content_1_Item) AsChatMessageContentFileChunk() (ChatMessageContentFileChunk, error)

AsChatMessageContentFileChunk returns the union data inside the ChatMessageInput_Content_1_Item as a ChatMessageContentFileChunk

func (ChatMessageInput_Content_1_Item) AsChatMessageContentImageChunk

func (t ChatMessageInput_Content_1_Item) AsChatMessageContentImageChunk() (ChatMessageContentImageChunk, error)

AsChatMessageContentImageChunk returns the union data inside the ChatMessageInput_Content_1_Item as a ChatMessageContentImageChunk

func (ChatMessageInput_Content_1_Item) AsChatMessageContentPDFChunk

func (t ChatMessageInput_Content_1_Item) AsChatMessageContentPDFChunk() (ChatMessageContentPDFChunk, error)

AsChatMessageContentPDFChunk returns the union data inside the ChatMessageInput_Content_1_Item as a ChatMessageContentPDFChunk

func (ChatMessageInput_Content_1_Item) AsChatMessageContentTextChunk

func (t ChatMessageInput_Content_1_Item) AsChatMessageContentTextChunk() (ChatMessageContentTextChunk, error)

AsChatMessageContentTextChunk returns the union data inside the ChatMessageInput_Content_1_Item as a ChatMessageContentTextChunk

func (ChatMessageInput_Content_1_Item) AsChatMessageContentVideoChunk

func (t ChatMessageInput_Content_1_Item) AsChatMessageContentVideoChunk() (ChatMessageContentVideoChunk, error)

AsChatMessageContentVideoChunk returns the union data inside the ChatMessageInput_Content_1_Item as a ChatMessageContentVideoChunk

func (*ChatMessageInput_Content_1_Item) FromChatMessageContentFileChunk

func (t *ChatMessageInput_Content_1_Item) FromChatMessageContentFileChunk(v ChatMessageContentFileChunk) error

FromChatMessageContentFileChunk overwrites any union data inside the ChatMessageInput_Content_1_Item as the provided ChatMessageContentFileChunk

func (*ChatMessageInput_Content_1_Item) FromChatMessageContentImageChunk

func (t *ChatMessageInput_Content_1_Item) FromChatMessageContentImageChunk(v ChatMessageContentImageChunk) error

FromChatMessageContentImageChunk overwrites any union data inside the ChatMessageInput_Content_1_Item as the provided ChatMessageContentImageChunk

func (*ChatMessageInput_Content_1_Item) FromChatMessageContentPDFChunk

func (t *ChatMessageInput_Content_1_Item) FromChatMessageContentPDFChunk(v ChatMessageContentPDFChunk) error

FromChatMessageContentPDFChunk overwrites any union data inside the ChatMessageInput_Content_1_Item as the provided ChatMessageContentPDFChunk

func (*ChatMessageInput_Content_1_Item) FromChatMessageContentTextChunk

func (t *ChatMessageInput_Content_1_Item) FromChatMessageContentTextChunk(v ChatMessageContentTextChunk) error

FromChatMessageContentTextChunk overwrites any union data inside the ChatMessageInput_Content_1_Item as the provided ChatMessageContentTextChunk

func (*ChatMessageInput_Content_1_Item) FromChatMessageContentVideoChunk

func (t *ChatMessageInput_Content_1_Item) FromChatMessageContentVideoChunk(v ChatMessageContentVideoChunk) error

FromChatMessageContentVideoChunk overwrites any union data inside the ChatMessageInput_Content_1_Item as the provided ChatMessageContentVideoChunk

func (ChatMessageInput_Content_1_Item) MarshalJSON

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

func (*ChatMessageInput_Content_1_Item) MergeChatMessageContentFileChunk

func (t *ChatMessageInput_Content_1_Item) MergeChatMessageContentFileChunk(v ChatMessageContentFileChunk) error

MergeChatMessageContentFileChunk performs a merge with any union data inside the ChatMessageInput_Content_1_Item, using the provided ChatMessageContentFileChunk

func (*ChatMessageInput_Content_1_Item) MergeChatMessageContentImageChunk

func (t *ChatMessageInput_Content_1_Item) MergeChatMessageContentImageChunk(v ChatMessageContentImageChunk) error

MergeChatMessageContentImageChunk performs a merge with any union data inside the ChatMessageInput_Content_1_Item, using the provided ChatMessageContentImageChunk

func (*ChatMessageInput_Content_1_Item) MergeChatMessageContentPDFChunk

func (t *ChatMessageInput_Content_1_Item) MergeChatMessageContentPDFChunk(v ChatMessageContentPDFChunk) error

MergeChatMessageContentPDFChunk performs a merge with any union data inside the ChatMessageInput_Content_1_Item, using the provided ChatMessageContentPDFChunk

func (*ChatMessageInput_Content_1_Item) MergeChatMessageContentTextChunk

func (t *ChatMessageInput_Content_1_Item) MergeChatMessageContentTextChunk(v ChatMessageContentTextChunk) error

MergeChatMessageContentTextChunk performs a merge with any union data inside the ChatMessageInput_Content_1_Item, using the provided ChatMessageContentTextChunk

func (*ChatMessageInput_Content_1_Item) MergeChatMessageContentVideoChunk

func (t *ChatMessageInput_Content_1_Item) MergeChatMessageContentVideoChunk(v ChatMessageContentVideoChunk) error

MergeChatMessageContentVideoChunk performs a merge with any union data inside the ChatMessageInput_Content_1_Item, using the provided ChatMessageContentVideoChunk

func (*ChatMessageInput_Content_1_Item) UnmarshalJSON

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

type ChatMessageOutput

type ChatMessageOutput struct {
	Content *ChatMessageOutput_Content `json:"content"`

	// Role Chat roles enum
	Role ChatMessageRole `json:"role"`
}

ChatMessageOutput defines model for ChatMessage-Output.

type ChatMessageOutputContent0

type ChatMessageOutputContent0 = string

ChatMessageOutputContent0 defines model for ChatMessageOutput.Content.0.

type ChatMessageOutputContent1

type ChatMessageOutputContent1 = []ChatMessageOutput_Content_1_Item

ChatMessageOutputContent1 defines model for ChatMessageOutput.Content.1.

type ChatMessageOutput_Content

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

ChatMessageOutput_Content defines model for ChatMessageOutput.Content.

func (ChatMessageOutput_Content) AsChatMessageOutputContent0

func (t ChatMessageOutput_Content) AsChatMessageOutputContent0() (ChatMessageOutputContent0, error)

AsChatMessageOutputContent0 returns the union data inside the ChatMessageOutput_Content as a ChatMessageOutputContent0

func (ChatMessageOutput_Content) AsChatMessageOutputContent1

func (t ChatMessageOutput_Content) AsChatMessageOutputContent1() (ChatMessageOutputContent1, error)

AsChatMessageOutputContent1 returns the union data inside the ChatMessageOutput_Content as a ChatMessageOutputContent1

func (*ChatMessageOutput_Content) FromChatMessageOutputContent0

func (t *ChatMessageOutput_Content) FromChatMessageOutputContent0(v ChatMessageOutputContent0) error

FromChatMessageOutputContent0 overwrites any union data inside the ChatMessageOutput_Content as the provided ChatMessageOutputContent0

func (*ChatMessageOutput_Content) FromChatMessageOutputContent1

func (t *ChatMessageOutput_Content) FromChatMessageOutputContent1(v ChatMessageOutputContent1) error

FromChatMessageOutputContent1 overwrites any union data inside the ChatMessageOutput_Content as the provided ChatMessageOutputContent1

func (ChatMessageOutput_Content) MarshalJSON

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

func (*ChatMessageOutput_Content) MergeChatMessageOutputContent0

func (t *ChatMessageOutput_Content) MergeChatMessageOutputContent0(v ChatMessageOutputContent0) error

MergeChatMessageOutputContent0 performs a merge with any union data inside the ChatMessageOutput_Content, using the provided ChatMessageOutputContent0

func (*ChatMessageOutput_Content) MergeChatMessageOutputContent1

func (t *ChatMessageOutput_Content) MergeChatMessageOutputContent1(v ChatMessageOutputContent1) error

MergeChatMessageOutputContent1 performs a merge with any union data inside the ChatMessageOutput_Content, using the provided ChatMessageOutputContent1

func (*ChatMessageOutput_Content) UnmarshalJSON

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

type ChatMessageOutput_Content_1_Item

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

ChatMessageOutput_Content_1_Item defines model for ChatMessageOutput.Content.1.Item.

func (ChatMessageOutput_Content_1_Item) AsChatMessageContentFileChunk

func (t ChatMessageOutput_Content_1_Item) AsChatMessageContentFileChunk() (ChatMessageContentFileChunk, error)

AsChatMessageContentFileChunk returns the union data inside the ChatMessageOutput_Content_1_Item as a ChatMessageContentFileChunk

func (ChatMessageOutput_Content_1_Item) AsChatMessageContentImageChunk

func (t ChatMessageOutput_Content_1_Item) AsChatMessageContentImageChunk() (ChatMessageContentImageChunk, error)

AsChatMessageContentImageChunk returns the union data inside the ChatMessageOutput_Content_1_Item as a ChatMessageContentImageChunk

func (ChatMessageOutput_Content_1_Item) AsChatMessageContentPDFChunk

func (t ChatMessageOutput_Content_1_Item) AsChatMessageContentPDFChunk() (ChatMessageContentPDFChunk, error)

AsChatMessageContentPDFChunk returns the union data inside the ChatMessageOutput_Content_1_Item as a ChatMessageContentPDFChunk

func (ChatMessageOutput_Content_1_Item) AsChatMessageContentTextChunk

func (t ChatMessageOutput_Content_1_Item) AsChatMessageContentTextChunk() (ChatMessageContentTextChunk, error)

AsChatMessageContentTextChunk returns the union data inside the ChatMessageOutput_Content_1_Item as a ChatMessageContentTextChunk

func (ChatMessageOutput_Content_1_Item) AsChatMessageContentVideoChunk

func (t ChatMessageOutput_Content_1_Item) AsChatMessageContentVideoChunk() (ChatMessageContentVideoChunk, error)

AsChatMessageContentVideoChunk returns the union data inside the ChatMessageOutput_Content_1_Item as a ChatMessageContentVideoChunk

func (*ChatMessageOutput_Content_1_Item) FromChatMessageContentFileChunk

func (t *ChatMessageOutput_Content_1_Item) FromChatMessageContentFileChunk(v ChatMessageContentFileChunk) error

FromChatMessageContentFileChunk overwrites any union data inside the ChatMessageOutput_Content_1_Item as the provided ChatMessageContentFileChunk

func (*ChatMessageOutput_Content_1_Item) FromChatMessageContentImageChunk

func (t *ChatMessageOutput_Content_1_Item) FromChatMessageContentImageChunk(v ChatMessageContentImageChunk) error

FromChatMessageContentImageChunk overwrites any union data inside the ChatMessageOutput_Content_1_Item as the provided ChatMessageContentImageChunk

func (*ChatMessageOutput_Content_1_Item) FromChatMessageContentPDFChunk

func (t *ChatMessageOutput_Content_1_Item) FromChatMessageContentPDFChunk(v ChatMessageContentPDFChunk) error

FromChatMessageContentPDFChunk overwrites any union data inside the ChatMessageOutput_Content_1_Item as the provided ChatMessageContentPDFChunk

func (*ChatMessageOutput_Content_1_Item) FromChatMessageContentTextChunk

func (t *ChatMessageOutput_Content_1_Item) FromChatMessageContentTextChunk(v ChatMessageContentTextChunk) error

FromChatMessageContentTextChunk overwrites any union data inside the ChatMessageOutput_Content_1_Item as the provided ChatMessageContentTextChunk

func (*ChatMessageOutput_Content_1_Item) FromChatMessageContentVideoChunk

func (t *ChatMessageOutput_Content_1_Item) FromChatMessageContentVideoChunk(v ChatMessageContentVideoChunk) error

FromChatMessageContentVideoChunk overwrites any union data inside the ChatMessageOutput_Content_1_Item as the provided ChatMessageContentVideoChunk

func (ChatMessageOutput_Content_1_Item) MarshalJSON

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

func (*ChatMessageOutput_Content_1_Item) MergeChatMessageContentFileChunk

func (t *ChatMessageOutput_Content_1_Item) MergeChatMessageContentFileChunk(v ChatMessageContentFileChunk) error

MergeChatMessageContentFileChunk performs a merge with any union data inside the ChatMessageOutput_Content_1_Item, using the provided ChatMessageContentFileChunk

func (*ChatMessageOutput_Content_1_Item) MergeChatMessageContentImageChunk

func (t *ChatMessageOutput_Content_1_Item) MergeChatMessageContentImageChunk(v ChatMessageContentImageChunk) error

MergeChatMessageContentImageChunk performs a merge with any union data inside the ChatMessageOutput_Content_1_Item, using the provided ChatMessageContentImageChunk

func (*ChatMessageOutput_Content_1_Item) MergeChatMessageContentPDFChunk

func (t *ChatMessageOutput_Content_1_Item) MergeChatMessageContentPDFChunk(v ChatMessageContentPDFChunk) error

MergeChatMessageContentPDFChunk performs a merge with any union data inside the ChatMessageOutput_Content_1_Item, using the provided ChatMessageContentPDFChunk

func (*ChatMessageOutput_Content_1_Item) MergeChatMessageContentTextChunk

func (t *ChatMessageOutput_Content_1_Item) MergeChatMessageContentTextChunk(v ChatMessageContentTextChunk) error

MergeChatMessageContentTextChunk performs a merge with any union data inside the ChatMessageOutput_Content_1_Item, using the provided ChatMessageContentTextChunk

func (*ChatMessageOutput_Content_1_Item) MergeChatMessageContentVideoChunk

func (t *ChatMessageOutput_Content_1_Item) MergeChatMessageContentVideoChunk(v ChatMessageContentVideoChunk) error

MergeChatMessageContentVideoChunk performs a merge with any union data inside the ChatMessageOutput_Content_1_Item, using the provided ChatMessageContentVideoChunk

func (*ChatMessageOutput_Content_1_Item) UnmarshalJSON

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

type ChatMessageRole

type ChatMessageRole string

ChatMessageRole Chat roles enum

const (
	ChatMessageRoleAssistant ChatMessageRole = "assistant"
	ChatMessageRoleSystem    ChatMessageRole = "system"
	ChatMessageRoleTool      ChatMessageRole = "tool"
	ChatMessageRoleUser      ChatMessageRole = "user"
)

Defines values for ChatMessageRole.

func (ChatMessageRole) Valid

func (e ChatMessageRole) Valid() bool

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

type Choice

type Choice struct {
	// Delta Incremental message delta (streaming)
	Delta ChatMessageOutput `json:"delta"`

	// FinishReason Reason generation stopped (stop or length)
	FinishReason *ChoiceFinishReason `json:"finish_reason,omitempty"`

	// Index Index of the choice in the array
	Index int `json:"index"`

	// Message Complete message (non-streaming)
	Message ChatMessageOutput `json:"message"`
}

Choice A single completion choice

type ChoiceAnswer

type ChoiceAnswer struct {
	// Choice The option with the highest probability.
	Choice string `json:"choice"`

	// Confidence Computed from `probabilities` as `(p_top - 1/n) / (1 - 1/n)`, where `p_top` is the highest probability and `n` is the number of options. 0 when every option is equally likely; 1 when one option has all the probability or there is only one option.
	Confidence float64 `json:"confidence"`

	// Probabilities Probability of each option, keyed by option name. Values are between 0 and 1 and sum to approximately 1.
	Probabilities map[string]float64 `json:"probabilities"`

	// Type Always `choice`.
	Type ChoiceAnswerType `json:"type"`
}

ChoiceAnswer Answer to a `choice` question: the selected option, a confidence value, and the probability of each option.

type ChoiceAnswerType

type ChoiceAnswerType string

ChoiceAnswerType Always `choice`.

const (
	ChoiceAnswerTypeChoice ChoiceAnswerType = "choice"
)

Defines values for ChoiceAnswerType.

func (ChoiceAnswerType) Valid

func (e ChoiceAnswerType) Valid() bool

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

type ChoiceFinishReason

type ChoiceFinishReason string

ChoiceFinishReason defines model for Choice.FinishReason.

const (
	ChoiceFinishReasonLength ChoiceFinishReason = "length"
	ChoiceFinishReasonStop   ChoiceFinishReason = "stop"
)

Defines values for ChoiceFinishReason.

func (ChoiceFinishReason) Valid

func (e ChoiceFinishReason) Valid() bool

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

type ChoiceQuestion

type ChoiceQuestion struct {
	// Criteria Option names mapped to a description of when each applies. Use `null` to let the name speak for itself. 1 to 255 options.
	Criteria map[string]*ChoiceQuestion_Criteria_AdditionalProperties `json:"criteria"`

	// Instructions What to decide when choosing between the options.
	Instructions *ChoiceQuestion_Instructions `json:"instructions,omitempty"`

	// Type Always `choice`.
	Type ChoiceQuestionType `json:"type"`
}

ChoiceQuestion A question that picks one of the options you define.

type ChoiceQuestionCriteria0

type ChoiceQuestionCriteria0 = string

ChoiceQuestionCriteria0 defines model for ChoiceQuestion.Criteria.0.

type ChoiceQuestionCriteria1

type ChoiceQuestionCriteria1 map[string]interface{}

ChoiceQuestionCriteria1 defines model for ChoiceQuestion.Criteria.1.

type ChoiceQuestionCriteria2

type ChoiceQuestionCriteria2 = []interface{}

ChoiceQuestionCriteria2 defines model for ChoiceQuestion.Criteria.2.

type ChoiceQuestionInstructions0

type ChoiceQuestionInstructions0 = string

ChoiceQuestionInstructions0 defines model for ChoiceQuestion.Instructions.0.

type ChoiceQuestionInstructions1

type ChoiceQuestionInstructions1 map[string]interface{}

ChoiceQuestionInstructions1 defines model for ChoiceQuestion.Instructions.1.

type ChoiceQuestionInstructions2

type ChoiceQuestionInstructions2 = []interface{}

ChoiceQuestionInstructions2 defines model for ChoiceQuestion.Instructions.2.

type ChoiceQuestionType

type ChoiceQuestionType string

ChoiceQuestionType Always `choice`.

const (
	ChoiceQuestionTypeChoice ChoiceQuestionType = "choice"
)

Defines values for ChoiceQuestionType.

func (ChoiceQuestionType) Valid

func (e ChoiceQuestionType) Valid() bool

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

type ChoiceQuestion_Criteria_AdditionalProperties

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

ChoiceQuestion_Criteria_AdditionalProperties defines model for ChoiceQuestion.criteria.AdditionalProperties.

func (ChoiceQuestion_Criteria_AdditionalProperties) AsChoiceQuestionCriteria0

AsChoiceQuestionCriteria0 returns the union data inside the ChoiceQuestion_Criteria_AdditionalProperties as a ChoiceQuestionCriteria0

func (ChoiceQuestion_Criteria_AdditionalProperties) AsChoiceQuestionCriteria1

AsChoiceQuestionCriteria1 returns the union data inside the ChoiceQuestion_Criteria_AdditionalProperties as a ChoiceQuestionCriteria1

func (ChoiceQuestion_Criteria_AdditionalProperties) AsChoiceQuestionCriteria2

AsChoiceQuestionCriteria2 returns the union data inside the ChoiceQuestion_Criteria_AdditionalProperties as a ChoiceQuestionCriteria2

func (*ChoiceQuestion_Criteria_AdditionalProperties) FromChoiceQuestionCriteria0

FromChoiceQuestionCriteria0 overwrites any union data inside the ChoiceQuestion_Criteria_AdditionalProperties as the provided ChoiceQuestionCriteria0

func (*ChoiceQuestion_Criteria_AdditionalProperties) FromChoiceQuestionCriteria1

FromChoiceQuestionCriteria1 overwrites any union data inside the ChoiceQuestion_Criteria_AdditionalProperties as the provided ChoiceQuestionCriteria1

func (*ChoiceQuestion_Criteria_AdditionalProperties) FromChoiceQuestionCriteria2

FromChoiceQuestionCriteria2 overwrites any union data inside the ChoiceQuestion_Criteria_AdditionalProperties as the provided ChoiceQuestionCriteria2

func (ChoiceQuestion_Criteria_AdditionalProperties) MarshalJSON

func (*ChoiceQuestion_Criteria_AdditionalProperties) MergeChoiceQuestionCriteria0

MergeChoiceQuestionCriteria0 performs a merge with any union data inside the ChoiceQuestion_Criteria_AdditionalProperties, using the provided ChoiceQuestionCriteria0

func (*ChoiceQuestion_Criteria_AdditionalProperties) MergeChoiceQuestionCriteria1

MergeChoiceQuestionCriteria1 performs a merge with any union data inside the ChoiceQuestion_Criteria_AdditionalProperties, using the provided ChoiceQuestionCriteria1

func (*ChoiceQuestion_Criteria_AdditionalProperties) MergeChoiceQuestionCriteria2

MergeChoiceQuestionCriteria2 performs a merge with any union data inside the ChoiceQuestion_Criteria_AdditionalProperties, using the provided ChoiceQuestionCriteria2

func (*ChoiceQuestion_Criteria_AdditionalProperties) UnmarshalJSON

type ChoiceQuestion_Instructions

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

ChoiceQuestion_Instructions What to decide when choosing between the options.

func (ChoiceQuestion_Instructions) AsChoiceQuestionInstructions0

func (t ChoiceQuestion_Instructions) AsChoiceQuestionInstructions0() (ChoiceQuestionInstructions0, error)

AsChoiceQuestionInstructions0 returns the union data inside the ChoiceQuestion_Instructions as a ChoiceQuestionInstructions0

func (ChoiceQuestion_Instructions) AsChoiceQuestionInstructions1

func (t ChoiceQuestion_Instructions) AsChoiceQuestionInstructions1() (ChoiceQuestionInstructions1, error)

AsChoiceQuestionInstructions1 returns the union data inside the ChoiceQuestion_Instructions as a ChoiceQuestionInstructions1

func (ChoiceQuestion_Instructions) AsChoiceQuestionInstructions2

func (t ChoiceQuestion_Instructions) AsChoiceQuestionInstructions2() (ChoiceQuestionInstructions2, error)

AsChoiceQuestionInstructions2 returns the union data inside the ChoiceQuestion_Instructions as a ChoiceQuestionInstructions2

func (*ChoiceQuestion_Instructions) FromChoiceQuestionInstructions0

func (t *ChoiceQuestion_Instructions) FromChoiceQuestionInstructions0(v ChoiceQuestionInstructions0) error

FromChoiceQuestionInstructions0 overwrites any union data inside the ChoiceQuestion_Instructions as the provided ChoiceQuestionInstructions0

func (*ChoiceQuestion_Instructions) FromChoiceQuestionInstructions1

func (t *ChoiceQuestion_Instructions) FromChoiceQuestionInstructions1(v ChoiceQuestionInstructions1) error

FromChoiceQuestionInstructions1 overwrites any union data inside the ChoiceQuestion_Instructions as the provided ChoiceQuestionInstructions1

func (*ChoiceQuestion_Instructions) FromChoiceQuestionInstructions2

func (t *ChoiceQuestion_Instructions) FromChoiceQuestionInstructions2(v ChoiceQuestionInstructions2) error

FromChoiceQuestionInstructions2 overwrites any union data inside the ChoiceQuestion_Instructions as the provided ChoiceQuestionInstructions2

func (ChoiceQuestion_Instructions) MarshalJSON

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

func (*ChoiceQuestion_Instructions) MergeChoiceQuestionInstructions0

func (t *ChoiceQuestion_Instructions) MergeChoiceQuestionInstructions0(v ChoiceQuestionInstructions0) error

MergeChoiceQuestionInstructions0 performs a merge with any union data inside the ChoiceQuestion_Instructions, using the provided ChoiceQuestionInstructions0

func (*ChoiceQuestion_Instructions) MergeChoiceQuestionInstructions1

func (t *ChoiceQuestion_Instructions) MergeChoiceQuestionInstructions1(v ChoiceQuestionInstructions1) error

MergeChoiceQuestionInstructions1 performs a merge with any union data inside the ChoiceQuestion_Instructions, using the provided ChoiceQuestionInstructions1

func (*ChoiceQuestion_Instructions) MergeChoiceQuestionInstructions2

func (t *ChoiceQuestion_Instructions) MergeChoiceQuestionInstructions2(v ChoiceQuestionInstructions2) error

MergeChoiceQuestionInstructions2 performs a merge with any union data inside the ChoiceQuestion_Instructions, using the provided ChoiceQuestionInstructions2

func (*ChoiceQuestion_Instructions) UnmarshalJSON

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

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CancelAgentResponse

func (c *Client) CancelAgentResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

CancelAgentResponse Cancel Agent Response

Requests cancellation of response `{id}`. Acts on durable state, so it works for background runs that outlive the client connection. Cancellation is asynchronous: a `200` acknowledges the request (`status: cancelling`) and the run stops shortly after - poll `GET /v1/agent/{id}` for its terminal status. Cancelling a run that is already terminal returns `400`. Ownership is enforced server side; a cross-tenant or unknown id surfaces as `404`.

Corresponds with POST /v1/agent/{id}/cancel (the `CancelAgentResponse` operationId).

func (*Client) CancelBatch added in v0.2.0

func (c *Client) CancelBatch(ctx context.Context, batchId BatchId, reqEditors ...RequestEditorFn) (*http.Response, error)

CancelBatch Cancel a batch

Moves the batch to `cancelling`; it becomes `cancelled` once running items stop. Completed items stay in the output file and are billed. Cancelling a cancelled or cancelling batch returns it unchanged.

Corresponds with POST /v1/batches/{batch_id}/cancel (the `CancelBatch` operationId).

func (*Client) ChatCompletionsChatCompletionsPost

func (c *Client) ChatCompletionsChatCompletionsPost(ctx context.Context, body ChatCompletionsChatCompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

ChatCompletionsChatCompletionsPost Create Chat Completion

Generate a chat completion response for the given conversation.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/sonar (the `ChatCompletionsChatCompletionsPost` operationId).

func (*Client) ChatCompletionsChatCompletionsPostWithBody

func (c *Client) ChatCompletionsChatCompletionsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

ChatCompletionsChatCompletionsPostWithBody Create Chat Completion

Generate a chat completion response for the given conversation.

Takes any type of body and a specified content type.

Corresponds with POST /v1/sonar (the `ChatCompletionsChatCompletionsPost` operationId).

func (*Client) ContextualizedEmbeddingsV1ContextualizedembeddingsPost

func (c *Client) ContextualizedEmbeddingsV1ContextualizedembeddingsPost(ctx context.Context, body ContextualizedEmbeddingsV1ContextualizedembeddingsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

ContextualizedEmbeddingsV1ContextualizedembeddingsPost Create Contextualized Embeddings

Generate contextualized embeddings for document chunks. Chunks from the same document share context awareness, improving retrieval quality for document-based applications.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/contextualizedembeddings (the `ContextualizedEmbeddingsV1ContextualizedembeddingsPost` operationId).

func (*Client) ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBody

func (c *Client) ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBody Create Contextualized Embeddings

Generate contextualized embeddings for document chunks. Chunks from the same document share context awareness, improving retrieval quality for document-based applications.

Takes any type of body and a specified content type.

Corresponds with POST /v1/contextualizedembeddings (the `ContextualizedEmbeddingsV1ContextualizedembeddingsPost` operationId).

func (*Client) CreateAgent

func (c *Client) CreateAgent(ctx context.Context, body CreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateAgent Create Agent Response

Generate a response for the provided input with optional web search and reasoning.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/agent (the `CreateAgent` operationId).

func (*Client) CreateAgentWithBody

func (c *Client) CreateAgentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateAgentWithBody Create Agent Response

Generate a response for the provided input with optional web search and reasoning.

Takes any type of body and a specified content type.

Corresponds with POST /v1/agent (the `CreateAgent` operationId).

func (*Client) CreateAsyncChatCompletionsAsyncChatCompletionsPost

func (c *Client) CreateAsyncChatCompletionsAsyncChatCompletionsPost(ctx context.Context, body CreateAsyncChatCompletionsAsyncChatCompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateAsyncChatCompletionsAsyncChatCompletionsPost Create Async Chat Completion

Submit an asynchronous chat completion request.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/async/sonar (the `CreateAsyncChatCompletionsAsyncChatCompletionsPost` operationId).

func (*Client) CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBody

func (c *Client) CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBody Create Async Chat Completion

Submit an asynchronous chat completion request.

Takes any type of body and a specified content type.

Corresponds with POST /v1/async/sonar (the `CreateAsyncChatCompletionsAsyncChatCompletionsPost` operationId).

func (*Client) CreateBatch added in v0.2.0

func (c *Client) CreateBatch(ctx context.Context, params *CreateBatchParams, body CreateBatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateBatch Create a batch

Creates a batch from an uploaded input file. The batch starts in `validating`. Send an `Idempotency-Key` header to make retries safe: a repeat with the same key returns the original batch. `output_expires_after` is not supported and is rejected with a 400; output and error files are kept 30 days.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/batches (the `CreateBatch` operationId).

func (*Client) CreateBatchWithBody added in v0.2.0

func (c *Client) CreateBatchWithBody(ctx context.Context, params *CreateBatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateBatchWithBody Create a batch

Creates a batch from an uploaded input file. The batch starts in `validating`. Send an `Idempotency-Key` header to make retries safe: a repeat with the same key returns the original batch. `output_expires_after` is not supported and is rejected with a 400; output and error files are kept 30 days.

Takes any type of body and a specified content type.

Corresponds with POST /v1/batches (the `CreateBatch` operationId).

func (*Client) CreateFileWithBody added in v0.2.0

func (c *Client) CreateFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateFileWithBody Upload a file

Uploads a JSONL batch input file, up to 50,000 lines and 200 MB. Every line is validated before the file is stored. Files expire after 30 days; `expires_after` is not supported and is rejected with a 400.

Takes any type of body and a specified content type.

Corresponds with POST /v1/files (the `CreateFile` operationId).

func (*Client) CreateSkillWithBody

func (c *Client) CreateSkillWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

CreateSkillWithBody Create a skill

Creates a skill from a zip bundle. The bundle must contain a `SKILL.md` that provides the skill name and description; those fields are read from the bundle, not from the request.

Takes any type of body and a specified content type.

Corresponds with POST /v1/skills (the `CreateSkill` operationId).

func (*Client) DecisionsV1DecisionsPost

func (c *Client) DecisionsV1DecisionsPost(ctx context.Context, body DecisionsV1DecisionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

DecisionsV1DecisionsPost Answer questions

Evaluate one or more named questions against the content in `state`. Mix `noul`, `choice`, and `score` questions in one request; the response returns one answer per question under the same name, plus the model name and token usage. Set `model` to `pplx-decider-v1.2` or `pplx-decider-flash-v1.2`, or to the alias `pplx-decider-latest` or `pplx-decider-flash-latest`; a missing or unknown model returns `400`. Send the key as `Authorization: Bearer <key>`; an `x-api-key` header is not read and returns `401`.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/decisions (the `DecisionsV1DecisionsPost` operationId).

func (*Client) DecisionsV1DecisionsPostWithBody

func (c *Client) DecisionsV1DecisionsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

DecisionsV1DecisionsPostWithBody Answer questions

Evaluate one or more named questions against the content in `state`. Mix `noul`, `choice`, and `score` questions in one request; the response returns one answer per question under the same name, plus the model name and token usage. Set `model` to `pplx-decider-v1.2` or `pplx-decider-flash-v1.2`, or to the alias `pplx-decider-latest` or `pplx-decider-flash-latest`; a missing or unknown model returns `400`. Send the key as `Authorization: Bearer <key>`; an `x-api-key` header is not read and returns `401`.

Takes any type of body and a specified content type.

Corresponds with POST /v1/decisions (the `DecisionsV1DecisionsPost` operationId).

func (*Client) DeleteFile added in v0.2.0

func (c *Client) DeleteFile(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteFile Delete a file

Deletes a file. Batches already created from it are not affected.

Corresponds with DELETE /v1/files/{file_id} (the `DeleteFile` operationId).

func (*Client) DeleteSkill

func (c *Client) DeleteSkill(ctx context.Context, skillId SkillId, params *DeleteSkillParams, reqEditors ...RequestEditorFn) (*http.Response, error)

DeleteSkill Delete a skill

Deletes a skill. Pass the current revision as `expected_revision`; the delete fails with `409` if the skill has a newer revision, so a delete never races a concurrent update.

Corresponds with DELETE /v1/skills/{skill_id} (the `DeleteSkill` operationId).

func (*Client) DownloadAgentFile

func (c *Client) DownloadAgentFile(ctx context.Context, id string, fileId string, reqEditors ...RequestEditorFn) (*http.Response, error)

DownloadAgentFile Download Agent Response File

Download the raw bytes of a file the response delivered with the `share_file` tool. The `file_id` comes from the file list endpoint and is distinct from the response `id`. The response streams raw bytes, not JSON, with a `Content-Type` matching the file and a `Content-Disposition: attachment` header carrying the original filename.

Corresponds with GET /v1/agent/{id}/files/{file_id}/content (the `DownloadAgentFile` operationId).

func (*Client) DownloadSkill

func (c *Client) DownloadSkill(ctx context.Context, skillId SkillId, params *DownloadSkillParams, reqEditors ...RequestEditorFn) (*http.Response, error)

DownloadSkill Get a skill download URL

Returns a short-lived URL to download the skill bundle as a zip. Without `revision`, returns the active revision.

Corresponds with GET /v1/skills/{skill_id}/download (the `DownloadSkill` operationId).

func (*Client) EmbeddingsV1EmbeddingsPost

func (c *Client) EmbeddingsV1EmbeddingsPost(ctx context.Context, body EmbeddingsV1EmbeddingsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

EmbeddingsV1EmbeddingsPost Create Embeddings

Generate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.

Takes a body of the `application/json` content type.

Corresponds with POST /v1/embeddings (the `EmbeddingsV1EmbeddingsPost` operationId).

func (*Client) EmbeddingsV1EmbeddingsPostWithBody

func (c *Client) EmbeddingsV1EmbeddingsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

EmbeddingsV1EmbeddingsPostWithBody Create Embeddings

Generate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.

Takes any type of body and a specified content type.

Corresponds with POST /v1/embeddings (the `EmbeddingsV1EmbeddingsPost` operationId).

func (*Client) GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet

func (c *Client) GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet(ctx context.Context, apiRequest string, reqEditors ...RequestEditorFn) (*http.Response, error)

GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet Get Async Chat Completion

Retrieve the response for a given asynchronous chat completion request.

Corresponds with GET /v1/async/sonar/{api_request} (the `GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet` operationId).

func (*Client) GetBatch added in v0.2.0

func (c *Client) GetBatch(ctx context.Context, batchId BatchId, reqEditors ...RequestEditorFn) (*http.Response, error)

GetBatch Retrieve a batch

Corresponds with GET /v1/batches/{batch_id} (the `GetBatch` operationId).

func (*Client) GetComputerUsageAnalytics

func (c *Client) GetComputerUsageAnalytics(ctx context.Context, params *GetComputerUsageAnalyticsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetComputerUsageAnalytics Usage Analytics

Returns your organization's Perplexity usage analytics as a bucketed time series for a single dataset. Requires an organization analytics API key, generated by an org admin from Settings → Organization → Computer in the Perplexity web app. Only complete UTC grid buckets are returned: start_time snaps down to its bucket, and the in-progress bucket is never included. Datasets differ in what they count: credits for credit_usage, queries for query_volume, distinct active members for daily_active_users, and thread counts for the rest. Buckets of daily_active_users are not additive — a member active on several days is counted once per day, so summing them is not the window's active-member count.

Corresponds with GET /v1/analytics/computer/usage (the `GetComputerUsageAnalytics` operationId).

func (*Client) GetComputerUsageAnalyticsV2

func (c *Client) GetComputerUsageAnalyticsV2(ctx context.Context, params *GetComputerUsageAnalyticsV2Params, reqEditors ...RequestEditorFn) (*http.Response, error)

GetComputerUsageAnalyticsV2 Usage Analytics per Member

Returns your organization's Perplexity usage broken down per member, as daily buckets. Each day lists one row per member with usage that day, keyed by email. credit_usage carries the same Model and Credit Source breakdown as v1; query_volume carries Feature, Project and Comet. Uses the same organization analytics API key as v1. Only complete UTC days are returned; the in-progress day is never included.

Corresponds with GET /v2/analytics/computer/usage (the `GetComputerUsageAnalyticsV2` operationId).

func (*Client) GetFile added in v0.2.0

func (c *Client) GetFile(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*http.Response, error)

GetFile Retrieve a file

Corresponds with GET /v1/files/{file_id} (the `GetFile` operationId).

func (*Client) GetFileContent added in v0.2.0

func (c *Client) GetFileContent(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*http.Response, error)

GetFileContent Download file content

Streams the raw bytes of an input, output, or error file.

Corresponds with GET /v1/files/{file_id}/content (the `GetFileContent` operationId).

func (*Client) GetSkill

func (c *Client) GetSkill(ctx context.Context, skillId SkillId, params *GetSkillParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetSkill Get a skill

Returns a skill. Without `revision`, returns the active revision.

Corresponds with GET /v1/skills/{skill_id} (the `GetSkill` operationId).

func (*Client) ListAgentFiles

func (c *Client) ListAgentFiles(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

ListAgentFiles List Agent Response Files

List the files a response produced in the sandbox and delivered with the `share_file` tool. Scoped to the authenticated account, which only ever sees its own files. File content is not returned inline; download it with the file content endpoint.

Corresponds with GET /v1/agent/{id}/files (the `ListAgentFiles` operationId).

func (*Client) ListAsyncChatCompletionsAsyncChatCompletionsGet

func (c *Client) ListAsyncChatCompletionsAsyncChatCompletionsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

ListAsyncChatCompletionsAsyncChatCompletionsGet List Async Chat Completions

Retrieve a list of all asynchronous chat completion requests for a given user.

Corresponds with GET /v1/async/sonar (the `ListAsyncChatCompletionsAsyncChatCompletionsGet` operationId).

func (*Client) ListBatches added in v0.2.0

func (c *Client) ListBatches(ctx context.Context, params *ListBatchesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListBatches List batches

Lists your organization's batches, newest first.

Corresponds with GET /v1/batches (the `ListBatches` operationId).

func (*Client) ListFiles added in v0.2.0

func (c *Client) ListFiles(ctx context.Context, params *ListFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListFiles List files

Lists your organization's files, both uploads and the output and error files batches write. Deleted and expired files are not listed.

Corresponds with GET /v1/files (the `ListFiles` operationId).

func (*Client) ListModels

func (c *Client) ListModels(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

ListModels List Models

List the models available for the Agent API. Returns model identifiers that can be used with the `POST /v1/agent` endpoint. The response follows the OpenAI List Models format for compatibility with third-party tools.

Corresponds with GET /v1/models (the `ListModels` operationId).

func (*Client) ListSkillRevisions

func (c *Client) ListSkillRevisions(ctx context.Context, skillId SkillId, params *ListSkillRevisionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSkillRevisions List skill revisions

Lists the revisions of a skill, newest first.

Corresponds with GET /v1/skills/{skill_id}/revisions (the `ListSkillRevisions` operationId).

func (*Client) ListSkills

func (c *Client) ListSkills(ctx context.Context, params *ListSkillsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListSkills List skills

Lists the skills in your Project, newest first.

Corresponds with GET /v1/skills (the `ListSkills` operationId).

func (*Client) RetrieveAgent

func (c *Client) RetrieveAgent(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

RetrieveAgent Retrieve Agent Response

Retrieve a response created earlier. Returns a JSON snapshot of the response. Only responses created with `store` omitted or `true` can be retrieved; `store: false` responses return a 404.

Corresponds with GET /v1/agent/{id} (the `RetrieveAgent` operationId).

func (*Client) SearchSearchPost

func (c *Client) SearchSearchPost(ctx context.Context, body SearchSearchPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

SearchSearchPost Search the Web

Search the web and retrieve relevant web page contents.

Takes a body of the `application/json` content type.

Corresponds with POST /search (the `SearchSearchPost` operationId).

func (*Client) SearchSearchPostWithBody

func (c *Client) SearchSearchPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

SearchSearchPostWithBody Search the Web

Search the web and retrieve relevant web page contents.

Takes any type of body and a specified content type.

Corresponds with POST /search (the `SearchSearchPost` operationId).

func (*Client) UpdateSkillWithBody

func (c *Client) UpdateSkillWithBody(ctx context.Context, skillId SkillId, params *UpdateSkillParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

UpdateSkillWithBody Add a skill revision

Uploads a new zip bundle as a new revision of an existing skill. Pass the revision you expect to replace as the required `expected_revision`; the request fails with `409` if the skill has already moved past it, so the update cannot race a concurrent write. Name and description are re-read from the new bundle.

Takes any type of body and a specified content type.

Corresponds with PUT /v1/skills/{skill_id} (the `UpdateSkill` operationId).

type ClientInterface

type ClientInterface interface {

	// SearchSearchPostWithBody Search the Web
	//
	// Search the web and retrieve relevant web page contents.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /search (the `SearchSearchPost` operationId).
	SearchSearchPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SearchSearchPost Search the Web
	//
	// Search the web and retrieve relevant web page contents.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /search (the `SearchSearchPost` operationId).
	SearchSearchPost(ctx context.Context, body SearchSearchPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateAgentWithBody Create Agent Response
	//
	// Generate a response for the provided input with optional web search and reasoning.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/agent (the `CreateAgent` operationId).
	CreateAgentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateAgent Create Agent Response
	//
	// Generate a response for the provided input with optional web search and reasoning.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/agent (the `CreateAgent` operationId).
	CreateAgent(ctx context.Context, body CreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RetrieveAgent Retrieve Agent Response
	//
	// Retrieve a response created earlier. Returns a JSON snapshot of the response. Only responses created with `store` omitted or `true` can be retrieved; `store: false` responses return a 404.
	//
	// Corresponds with GET /v1/agent/{id} (the `RetrieveAgent` operationId).
	RetrieveAgent(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CancelAgentResponse Cancel Agent Response
	//
	// Requests cancellation of response `{id}`. Acts on durable state, so it works for background runs that outlive the client connection. Cancellation is asynchronous: a `200` acknowledges the request (`status: cancelling`) and the run stops shortly after - poll `GET /v1/agent/{id}` for its terminal status. Cancelling a run that is already terminal returns `400`. Ownership is enforced server side; a cross-tenant or unknown id surfaces as `404`.
	//
	// Corresponds with POST /v1/agent/{id}/cancel (the `CancelAgentResponse` operationId).
	CancelAgentResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListAgentFiles List Agent Response Files
	//
	// List the files a response produced in the sandbox and delivered with the `share_file` tool. Scoped to the authenticated account, which only ever sees its own files. File content is not returned inline; download it with the file content endpoint.
	//
	// Corresponds with GET /v1/agent/{id}/files (the `ListAgentFiles` operationId).
	ListAgentFiles(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DownloadAgentFile Download Agent Response File
	//
	// Download the raw bytes of a file the response delivered with the `share_file` tool. The `file_id` comes from the file list endpoint and is distinct from the response `id`. The response streams raw bytes, not JSON, with a `Content-Type` matching the file and a `Content-Disposition: attachment` header carrying the original filename.
	//
	// Corresponds with GET /v1/agent/{id}/files/{file_id}/content (the `DownloadAgentFile` operationId).
	DownloadAgentFile(ctx context.Context, id string, fileId string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetComputerUsageAnalytics Usage Analytics
	//
	// Returns your organization's Perplexity usage analytics as a bucketed time series for a single dataset. Requires an organization analytics API key, generated by an org admin from Settings → Organization → Computer in the Perplexity web app. Only complete UTC grid buckets are returned: start_time snaps down to its bucket, and the in-progress bucket is never included. Datasets differ in what they count: credits for credit_usage, queries for query_volume, distinct active members for daily_active_users, and thread counts for the rest. Buckets of daily_active_users are not additive — a member active on several days is counted once per day, so summing them is not the window's active-member count.
	//
	// Corresponds with GET /v1/analytics/computer/usage (the `GetComputerUsageAnalytics` operationId).
	GetComputerUsageAnalytics(ctx context.Context, params *GetComputerUsageAnalyticsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListAsyncChatCompletionsAsyncChatCompletionsGet List Async Chat Completions
	//
	// Retrieve a list of all asynchronous chat completion requests for a given user.
	//
	// Corresponds with GET /v1/async/sonar (the `ListAsyncChatCompletionsAsyncChatCompletionsGet` operationId).
	ListAsyncChatCompletionsAsyncChatCompletionsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBody Create Async Chat Completion
	//
	// Submit an asynchronous chat completion request.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/async/sonar (the `CreateAsyncChatCompletionsAsyncChatCompletionsPost` operationId).
	CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateAsyncChatCompletionsAsyncChatCompletionsPost Create Async Chat Completion
	//
	// Submit an asynchronous chat completion request.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/async/sonar (the `CreateAsyncChatCompletionsAsyncChatCompletionsPost` operationId).
	CreateAsyncChatCompletionsAsyncChatCompletionsPost(ctx context.Context, body CreateAsyncChatCompletionsAsyncChatCompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet Get Async Chat Completion
	//
	// Retrieve the response for a given asynchronous chat completion request.
	//
	// Corresponds with GET /v1/async/sonar/{api_request} (the `GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet` operationId).
	GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet(ctx context.Context, apiRequest string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListBatches List batches
	//
	// Lists your organization's batches, newest first.
	//
	// Corresponds with GET /v1/batches (the `ListBatches` operationId).
	ListBatches(ctx context.Context, params *ListBatchesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateBatchWithBody Create a batch
	//
	// Creates a batch from an uploaded input file. The batch starts in
	// `validating`. Send an `Idempotency-Key` header to make retries safe: a
	// repeat with the same key returns the original batch.
	// `output_expires_after` is not supported and is rejected with a 400;
	// output and error files are kept 30 days.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/batches (the `CreateBatch` operationId).
	CreateBatchWithBody(ctx context.Context, params *CreateBatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateBatch Create a batch
	//
	// Creates a batch from an uploaded input file. The batch starts in
	// `validating`. Send an `Idempotency-Key` header to make retries safe: a
	// repeat with the same key returns the original batch.
	// `output_expires_after` is not supported and is rejected with a 400;
	// output and error files are kept 30 days.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/batches (the `CreateBatch` operationId).
	CreateBatch(ctx context.Context, params *CreateBatchParams, body CreateBatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetBatch Retrieve a batch
	//
	// Corresponds with GET /v1/batches/{batch_id} (the `GetBatch` operationId).
	GetBatch(ctx context.Context, batchId BatchId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CancelBatch Cancel a batch
	//
	// Moves the batch to `cancelling`; it becomes `cancelled` once running
	// items stop. Completed items stay in the output file and are billed.
	// Cancelling a cancelled or cancelling batch returns it unchanged.
	//
	// Corresponds with POST /v1/batches/{batch_id}/cancel (the `CancelBatch` operationId).
	CancelBatch(ctx context.Context, batchId BatchId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBody Create Contextualized Embeddings
	//
	// Generate contextualized embeddings for document chunks. Chunks from the same document share context awareness, improving retrieval quality for document-based applications.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/contextualizedembeddings (the `ContextualizedEmbeddingsV1ContextualizedembeddingsPost` operationId).
	ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ContextualizedEmbeddingsV1ContextualizedembeddingsPost Create Contextualized Embeddings
	//
	// Generate contextualized embeddings for document chunks. Chunks from the same document share context awareness, improving retrieval quality for document-based applications.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/contextualizedembeddings (the `ContextualizedEmbeddingsV1ContextualizedembeddingsPost` operationId).
	ContextualizedEmbeddingsV1ContextualizedembeddingsPost(ctx context.Context, body ContextualizedEmbeddingsV1ContextualizedembeddingsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DecisionsV1DecisionsPostWithBody Answer questions
	//
	// Evaluate one or more named questions against the content in `state`. Mix `noul`, `choice`, and `score` questions in one request; the response returns one answer per question under the same name, plus the model name and token usage. Set `model` to `pplx-decider-v1.2` or `pplx-decider-flash-v1.2`, or to the alias `pplx-decider-latest` or `pplx-decider-flash-latest`; a missing or unknown model returns `400`. Send the key as `Authorization: Bearer <key>`; an `x-api-key` header is not read and returns `401`.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/decisions (the `DecisionsV1DecisionsPost` operationId).
	DecisionsV1DecisionsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DecisionsV1DecisionsPost Answer questions
	//
	// Evaluate one or more named questions against the content in `state`. Mix `noul`, `choice`, and `score` questions in one request; the response returns one answer per question under the same name, plus the model name and token usage. Set `model` to `pplx-decider-v1.2` or `pplx-decider-flash-v1.2`, or to the alias `pplx-decider-latest` or `pplx-decider-flash-latest`; a missing or unknown model returns `400`. Send the key as `Authorization: Bearer <key>`; an `x-api-key` header is not read and returns `401`.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/decisions (the `DecisionsV1DecisionsPost` operationId).
	DecisionsV1DecisionsPost(ctx context.Context, body DecisionsV1DecisionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// EmbeddingsV1EmbeddingsPostWithBody Create Embeddings
	//
	// Generate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/embeddings (the `EmbeddingsV1EmbeddingsPost` operationId).
	EmbeddingsV1EmbeddingsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// EmbeddingsV1EmbeddingsPost Create Embeddings
	//
	// Generate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/embeddings (the `EmbeddingsV1EmbeddingsPost` operationId).
	EmbeddingsV1EmbeddingsPost(ctx context.Context, body EmbeddingsV1EmbeddingsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListFiles List files
	//
	// Lists your organization's files, both uploads and the output and error
	// files batches write. Deleted and expired files are not listed.
	//
	// Corresponds with GET /v1/files (the `ListFiles` operationId).
	ListFiles(ctx context.Context, params *ListFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateFileWithBody Upload a file
	//
	// Uploads a JSONL batch input file, up to 50,000 lines and 200 MB. Every
	// line is validated before the file is stored. Files expire after 30 days;
	// `expires_after` is not supported and is rejected with a 400.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/files (the `CreateFile` operationId).
	CreateFileWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteFile Delete a file
	//
	// Deletes a file. Batches already created from it are not affected.
	//
	// Corresponds with DELETE /v1/files/{file_id} (the `DeleteFile` operationId).
	DeleteFile(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFile Retrieve a file
	//
	// Corresponds with GET /v1/files/{file_id} (the `GetFile` operationId).
	GetFile(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFileContent Download file content
	//
	// Streams the raw bytes of an input, output, or error file.
	//
	// Corresponds with GET /v1/files/{file_id}/content (the `GetFileContent` operationId).
	GetFileContent(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListModels List Models
	//
	// List the models available for the Agent API. Returns model identifiers that can be used with the `POST /v1/agent` endpoint. The response follows the OpenAI List Models format for compatibility with third-party tools.
	//
	// Corresponds with GET /v1/models (the `ListModels` operationId).
	ListModels(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSkills List skills
	//
	// Lists the skills in your Project, newest first.
	//
	// Corresponds with GET /v1/skills (the `ListSkills` operationId).
	ListSkills(ctx context.Context, params *ListSkillsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateSkillWithBody Create a skill
	//
	// Creates a skill from a zip bundle. The bundle must contain a `SKILL.md`
	// that provides the skill name and description; those fields are read from
	// the bundle, not from the request.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/skills (the `CreateSkill` operationId).
	CreateSkillWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteSkill Delete a skill
	//
	// Deletes a skill. Pass the current revision as `expected_revision`; the
	// delete fails with `409` if the skill has a newer revision, so a delete
	// never races a concurrent update.
	//
	// Corresponds with DELETE /v1/skills/{skill_id} (the `DeleteSkill` operationId).
	DeleteSkill(ctx context.Context, skillId SkillId, params *DeleteSkillParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetSkill Get a skill
	//
	// Returns a skill. Without `revision`, returns the active revision.
	//
	// Corresponds with GET /v1/skills/{skill_id} (the `GetSkill` operationId).
	GetSkill(ctx context.Context, skillId SkillId, params *GetSkillParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateSkillWithBody Add a skill revision
	//
	// Uploads a new zip bundle as a new revision of an existing skill. Pass the
	// revision you expect to replace as the required `expected_revision`; the
	// request fails with `409` if the skill has already moved past it, so the
	// update cannot race a concurrent write. Name and description are re-read
	// from the new bundle.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with PUT /v1/skills/{skill_id} (the `UpdateSkill` operationId).
	UpdateSkillWithBody(ctx context.Context, skillId SkillId, params *UpdateSkillParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DownloadSkill Get a skill download URL
	//
	// Returns a short-lived URL to download the skill bundle as a zip. Without
	// `revision`, returns the active revision.
	//
	// Corresponds with GET /v1/skills/{skill_id}/download (the `DownloadSkill` operationId).
	DownloadSkill(ctx context.Context, skillId SkillId, params *DownloadSkillParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListSkillRevisions List skill revisions
	//
	// Lists the revisions of a skill, newest first.
	//
	// Corresponds with GET /v1/skills/{skill_id}/revisions (the `ListSkillRevisions` operationId).
	ListSkillRevisions(ctx context.Context, skillId SkillId, params *ListSkillRevisionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ChatCompletionsChatCompletionsPostWithBody Create Chat Completion
	//
	// Generate a chat completion response for the given conversation.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/sonar (the `ChatCompletionsChatCompletionsPost` operationId).
	ChatCompletionsChatCompletionsPostWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ChatCompletionsChatCompletionsPost Create Chat Completion
	//
	// Generate a chat completion response for the given conversation.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/sonar (the `ChatCompletionsChatCompletionsPost` operationId).
	ChatCompletionsChatCompletionsPost(ctx context.Context, body ChatCompletionsChatCompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetComputerUsageAnalyticsV2 Usage Analytics per Member
	//
	// Returns your organization's Perplexity usage broken down per member, as daily buckets. Each day lists one row per member with usage that day, keyed by email. credit_usage carries the same Model and Credit Source breakdown as v1; query_volume carries Feature, Project and Comet. Uses the same organization analytics API key as v1. Only complete UTC days are returned; the in-progress day is never included.
	//
	// Corresponds with GET /v2/analytics/computer/usage (the `GetComputerUsageAnalyticsV2` operationId).
	GetComputerUsageAnalyticsV2(ctx context.Context, params *GetComputerUsageAnalyticsV2Params, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CancelAgentResponseWithResponse

func (c *ClientWithResponses) CancelAgentResponseWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*CancelAgentResponseResponse, error)

CancelAgentResponseWithResponse Cancel Agent Response

Requests cancellation of response `{id}`. Acts on durable state, so it works for background runs that outlive the client connection. Cancellation is asynchronous: a `200` acknowledges the request (`status: cancelling`) and the run stops shortly after - poll `GET /v1/agent/{id}` for its terminal status. Cancelling a run that is already terminal returns `400`. Ownership is enforced server side; a cross-tenant or unknown id surfaces as `404`.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/agent/{id}/cancel (the `CancelAgentResponse` operationId).

func (*ClientWithResponses) CancelBatchWithResponse added in v0.2.0

func (c *ClientWithResponses) CancelBatchWithResponse(ctx context.Context, batchId BatchId, reqEditors ...RequestEditorFn) (*CancelBatchResponse, error)

CancelBatchWithResponse Cancel a batch

Moves the batch to `cancelling`; it becomes `cancelled` once running items stop. Completed items stay in the output file and are billed. Cancelling a cancelled or cancelling batch returns it unchanged.

Returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/batches/{batch_id}/cancel (the `CancelBatch` operationId).

func (*ClientWithResponses) ChatCompletionsChatCompletionsPostWithBodyWithResponse

func (c *ClientWithResponses) ChatCompletionsChatCompletionsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ChatCompletionsChatCompletionsPostResponse, error)

ChatCompletionsChatCompletionsPostWithBodyWithResponse Create Chat Completion

Generate a chat completion response for the given conversation.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/sonar (the `ChatCompletionsChatCompletionsPost` operationId).

func (*ClientWithResponses) ChatCompletionsChatCompletionsPostWithResponse

ChatCompletionsChatCompletionsPostWithResponse Create Chat Completion

Generate a chat completion response for the given conversation.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/sonar (the `ChatCompletionsChatCompletionsPost` operationId).

func (*ClientWithResponses) ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBodyWithResponse

func (c *ClientWithResponses) ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse, error)

ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBodyWithResponse Create Contextualized Embeddings

Generate contextualized embeddings for document chunks. Chunks from the same document share context awareness, improving retrieval quality for document-based applications.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/contextualizedembeddings (the `ContextualizedEmbeddingsV1ContextualizedembeddingsPost` operationId).

func (*ClientWithResponses) ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithResponse

ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithResponse Create Contextualized Embeddings

Generate contextualized embeddings for document chunks. Chunks from the same document share context awareness, improving retrieval quality for document-based applications.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/contextualizedembeddings (the `ContextualizedEmbeddingsV1ContextualizedembeddingsPost` operationId).

func (*ClientWithResponses) CreateAgentWithBodyWithResponse

func (c *ClientWithResponses) CreateAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAgentResponse, error)

CreateAgentWithBodyWithResponse Create Agent Response

Generate a response for the provided input with optional web search and reasoning.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/agent (the `CreateAgent` operationId).

func (*ClientWithResponses) CreateAgentWithResponse

func (c *ClientWithResponses) CreateAgentWithResponse(ctx context.Context, body CreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentResponse, error)

CreateAgentWithResponse Create Agent Response

Generate a response for the provided input with optional web search and reasoning.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/agent (the `CreateAgent` operationId).

func (*ClientWithResponses) CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBodyWithResponse

func (c *ClientWithResponses) CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse, error)

CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBodyWithResponse Create Async Chat Completion

Submit an asynchronous chat completion request.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/async/sonar (the `CreateAsyncChatCompletionsAsyncChatCompletionsPost` operationId).

func (*ClientWithResponses) CreateAsyncChatCompletionsAsyncChatCompletionsPostWithResponse

CreateAsyncChatCompletionsAsyncChatCompletionsPostWithResponse Create Async Chat Completion

Submit an asynchronous chat completion request.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/async/sonar (the `CreateAsyncChatCompletionsAsyncChatCompletionsPost` operationId).

func (*ClientWithResponses) CreateBatchWithBodyWithResponse added in v0.2.0

func (c *ClientWithResponses) CreateBatchWithBodyWithResponse(ctx context.Context, params *CreateBatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBatchResponse, error)

CreateBatchWithBodyWithResponse Create a batch

Creates a batch from an uploaded input file. The batch starts in `validating`. Send an `Idempotency-Key` header to make retries safe: a repeat with the same key returns the original batch. `output_expires_after` is not supported and is rejected with a 400; output and error files are kept 30 days.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/batches (the `CreateBatch` operationId).

func (*ClientWithResponses) CreateBatchWithResponse added in v0.2.0

func (c *ClientWithResponses) CreateBatchWithResponse(ctx context.Context, params *CreateBatchParams, body CreateBatchJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBatchResponse, error)

CreateBatchWithResponse Create a batch

Creates a batch from an uploaded input file. The batch starts in `validating`. Send an `Idempotency-Key` header to make retries safe: a repeat with the same key returns the original batch. `output_expires_after` is not supported and is rejected with a 400; output and error files are kept 30 days.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/batches (the `CreateBatch` operationId).

func (*ClientWithResponses) CreateFileWithBodyWithResponse added in v0.2.0

func (c *ClientWithResponses) CreateFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFileResponse, error)

CreateFileWithBodyWithResponse Upload a file

Uploads a JSONL batch input file, up to 50,000 lines and 200 MB. Every line is validated before the file is stored. Files expire after 30 days; `expires_after` is not supported and is rejected with a 400.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/files (the `CreateFile` operationId).

func (*ClientWithResponses) CreateSkillWithBodyWithResponse

func (c *ClientWithResponses) CreateSkillWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSkillResponse, error)

CreateSkillWithBodyWithResponse Create a skill

Creates a skill from a zip bundle. The bundle must contain a `SKILL.md` that provides the skill name and description; those fields are read from the bundle, not from the request.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/skills (the `CreateSkill` operationId).

func (*ClientWithResponses) DecisionsV1DecisionsPostWithBodyWithResponse

func (c *ClientWithResponses) DecisionsV1DecisionsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DecisionsV1DecisionsPostResponse, error)

DecisionsV1DecisionsPostWithBodyWithResponse Answer questions

Evaluate one or more named questions against the content in `state`. Mix `noul`, `choice`, and `score` questions in one request; the response returns one answer per question under the same name, plus the model name and token usage. Set `model` to `pplx-decider-v1.2` or `pplx-decider-flash-v1.2`, or to the alias `pplx-decider-latest` or `pplx-decider-flash-latest`; a missing or unknown model returns `400`. Send the key as `Authorization: Bearer <key>`; an `x-api-key` header is not read and returns `401`.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/decisions (the `DecisionsV1DecisionsPost` operationId).

func (*ClientWithResponses) DecisionsV1DecisionsPostWithResponse

func (c *ClientWithResponses) DecisionsV1DecisionsPostWithResponse(ctx context.Context, body DecisionsV1DecisionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*DecisionsV1DecisionsPostResponse, error)

DecisionsV1DecisionsPostWithResponse Answer questions

Evaluate one or more named questions against the content in `state`. Mix `noul`, `choice`, and `score` questions in one request; the response returns one answer per question under the same name, plus the model name and token usage. Set `model` to `pplx-decider-v1.2` or `pplx-decider-flash-v1.2`, or to the alias `pplx-decider-latest` or `pplx-decider-flash-latest`; a missing or unknown model returns `400`. Send the key as `Authorization: Bearer <key>`; an `x-api-key` header is not read and returns `401`.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/decisions (the `DecisionsV1DecisionsPost` operationId).

func (*ClientWithResponses) DeleteFileWithResponse added in v0.2.0

func (c *ClientWithResponses) DeleteFileWithResponse(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*DeleteFileResponse, error)

DeleteFileWithResponse Delete a file

Deletes a file. Batches already created from it are not affected.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /v1/files/{file_id} (the `DeleteFile` operationId).

func (*ClientWithResponses) DeleteSkillWithResponse

func (c *ClientWithResponses) DeleteSkillWithResponse(ctx context.Context, skillId SkillId, params *DeleteSkillParams, reqEditors ...RequestEditorFn) (*DeleteSkillResponse, error)

DeleteSkillWithResponse Delete a skill

Deletes a skill. Pass the current revision as `expected_revision`; the delete fails with `409` if the skill has a newer revision, so a delete never races a concurrent update.

Returns a wrapper object for the known response body format(s).

Corresponds with DELETE /v1/skills/{skill_id} (the `DeleteSkill` operationId).

func (*ClientWithResponses) DownloadAgentFileWithResponse

func (c *ClientWithResponses) DownloadAgentFileWithResponse(ctx context.Context, id string, fileId string, reqEditors ...RequestEditorFn) (*DownloadAgentFileResponse, error)

DownloadAgentFileWithResponse Download Agent Response File

Download the raw bytes of a file the response delivered with the `share_file` tool. The `file_id` comes from the file list endpoint and is distinct from the response `id`. The response streams raw bytes, not JSON, with a `Content-Type` matching the file and a `Content-Disposition: attachment` header carrying the original filename.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/agent/{id}/files/{file_id}/content (the `DownloadAgentFile` operationId).

func (*ClientWithResponses) DownloadSkillWithResponse

func (c *ClientWithResponses) DownloadSkillWithResponse(ctx context.Context, skillId SkillId, params *DownloadSkillParams, reqEditors ...RequestEditorFn) (*DownloadSkillResponse, error)

DownloadSkillWithResponse Get a skill download URL

Returns a short-lived URL to download the skill bundle as a zip. Without `revision`, returns the active revision.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/skills/{skill_id}/download (the `DownloadSkill` operationId).

func (*ClientWithResponses) EmbeddingsV1EmbeddingsPostWithBodyWithResponse

func (c *ClientWithResponses) EmbeddingsV1EmbeddingsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EmbeddingsV1EmbeddingsPostResponse, error)

EmbeddingsV1EmbeddingsPostWithBodyWithResponse Create Embeddings

Generate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/embeddings (the `EmbeddingsV1EmbeddingsPost` operationId).

func (*ClientWithResponses) EmbeddingsV1EmbeddingsPostWithResponse

func (c *ClientWithResponses) EmbeddingsV1EmbeddingsPostWithResponse(ctx context.Context, body EmbeddingsV1EmbeddingsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*EmbeddingsV1EmbeddingsPostResponse, error)

EmbeddingsV1EmbeddingsPostWithResponse Create Embeddings

Generate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /v1/embeddings (the `EmbeddingsV1EmbeddingsPost` operationId).

func (*ClientWithResponses) GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetWithResponse

func (c *ClientWithResponses) GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetWithResponse(ctx context.Context, apiRequest string, reqEditors ...RequestEditorFn) (*GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse, error)

GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetWithResponse Get Async Chat Completion

Retrieve the response for a given asynchronous chat completion request.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/async/sonar/{api_request} (the `GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet` operationId).

func (*ClientWithResponses) GetBatchWithResponse added in v0.2.0

func (c *ClientWithResponses) GetBatchWithResponse(ctx context.Context, batchId BatchId, reqEditors ...RequestEditorFn) (*GetBatchResponse, error)

GetBatchWithResponse Retrieve a batch

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/batches/{batch_id} (the `GetBatch` operationId).

func (*ClientWithResponses) GetComputerUsageAnalyticsV2WithResponse

func (c *ClientWithResponses) GetComputerUsageAnalyticsV2WithResponse(ctx context.Context, params *GetComputerUsageAnalyticsV2Params, reqEditors ...RequestEditorFn) (*GetComputerUsageAnalyticsV2Response, error)

GetComputerUsageAnalyticsV2WithResponse Usage Analytics per Member

Returns your organization's Perplexity usage broken down per member, as daily buckets. Each day lists one row per member with usage that day, keyed by email. credit_usage carries the same Model and Credit Source breakdown as v1; query_volume carries Feature, Project and Comet. Uses the same organization analytics API key as v1. Only complete UTC days are returned; the in-progress day is never included.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v2/analytics/computer/usage (the `GetComputerUsageAnalyticsV2` operationId).

func (*ClientWithResponses) GetComputerUsageAnalyticsWithResponse

func (c *ClientWithResponses) GetComputerUsageAnalyticsWithResponse(ctx context.Context, params *GetComputerUsageAnalyticsParams, reqEditors ...RequestEditorFn) (*GetComputerUsageAnalyticsResponse, error)

GetComputerUsageAnalyticsWithResponse Usage Analytics

Returns your organization's Perplexity usage analytics as a bucketed time series for a single dataset. Requires an organization analytics API key, generated by an org admin from Settings → Organization → Computer in the Perplexity web app. Only complete UTC grid buckets are returned: start_time snaps down to its bucket, and the in-progress bucket is never included. Datasets differ in what they count: credits for credit_usage, queries for query_volume, distinct active members for daily_active_users, and thread counts for the rest. Buckets of daily_active_users are not additive — a member active on several days is counted once per day, so summing them is not the window's active-member count.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/analytics/computer/usage (the `GetComputerUsageAnalytics` operationId).

func (*ClientWithResponses) GetFileContentWithResponse added in v0.2.0

func (c *ClientWithResponses) GetFileContentWithResponse(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*GetFileContentResponse, error)

GetFileContentWithResponse Download file content

Streams the raw bytes of an input, output, or error file.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/files/{file_id}/content (the `GetFileContent` operationId).

func (*ClientWithResponses) GetFileWithResponse added in v0.2.0

func (c *ClientWithResponses) GetFileWithResponse(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*GetFileResponse, error)

GetFileWithResponse Retrieve a file

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/files/{file_id} (the `GetFile` operationId).

func (*ClientWithResponses) GetSkillWithResponse

func (c *ClientWithResponses) GetSkillWithResponse(ctx context.Context, skillId SkillId, params *GetSkillParams, reqEditors ...RequestEditorFn) (*GetSkillResponse, error)

GetSkillWithResponse Get a skill

Returns a skill. Without `revision`, returns the active revision.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/skills/{skill_id} (the `GetSkill` operationId).

func (*ClientWithResponses) ListAgentFilesWithResponse

func (c *ClientWithResponses) ListAgentFilesWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ListAgentFilesResponse, error)

ListAgentFilesWithResponse List Agent Response Files

List the files a response produced in the sandbox and delivered with the `share_file` tool. Scoped to the authenticated account, which only ever sees its own files. File content is not returned inline; download it with the file content endpoint.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/agent/{id}/files (the `ListAgentFiles` operationId).

func (*ClientWithResponses) ListAsyncChatCompletionsAsyncChatCompletionsGetWithResponse

func (c *ClientWithResponses) ListAsyncChatCompletionsAsyncChatCompletionsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAsyncChatCompletionsAsyncChatCompletionsGetResponse, error)

ListAsyncChatCompletionsAsyncChatCompletionsGetWithResponse List Async Chat Completions

Retrieve a list of all asynchronous chat completion requests for a given user.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/async/sonar (the `ListAsyncChatCompletionsAsyncChatCompletionsGet` operationId).

func (*ClientWithResponses) ListBatchesWithResponse added in v0.2.0

func (c *ClientWithResponses) ListBatchesWithResponse(ctx context.Context, params *ListBatchesParams, reqEditors ...RequestEditorFn) (*ListBatchesResponse, error)

ListBatchesWithResponse List batches

Lists your organization's batches, newest first.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/batches (the `ListBatches` operationId).

func (*ClientWithResponses) ListFilesWithResponse added in v0.2.0

func (c *ClientWithResponses) ListFilesWithResponse(ctx context.Context, params *ListFilesParams, reqEditors ...RequestEditorFn) (*ListFilesResponse, error)

ListFilesWithResponse List files

Lists your organization's files, both uploads and the output and error files batches write. Deleted and expired files are not listed.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/files (the `ListFiles` operationId).

func (*ClientWithResponses) ListModelsWithResponse

func (c *ClientWithResponses) ListModelsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListModelsResponse2, error)

ListModelsWithResponse List Models

List the models available for the Agent API. Returns model identifiers that can be used with the `POST /v1/agent` endpoint. The response follows the OpenAI List Models format for compatibility with third-party tools.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/models (the `ListModels` operationId).

func (*ClientWithResponses) ListSkillRevisionsWithResponse

func (c *ClientWithResponses) ListSkillRevisionsWithResponse(ctx context.Context, skillId SkillId, params *ListSkillRevisionsParams, reqEditors ...RequestEditorFn) (*ListSkillRevisionsResponse, error)

ListSkillRevisionsWithResponse List skill revisions

Lists the revisions of a skill, newest first.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/skills/{skill_id}/revisions (the `ListSkillRevisions` operationId).

func (*ClientWithResponses) ListSkillsWithResponse

func (c *ClientWithResponses) ListSkillsWithResponse(ctx context.Context, params *ListSkillsParams, reqEditors ...RequestEditorFn) (*ListSkillsResponse, error)

ListSkillsWithResponse List skills

Lists the skills in your Project, newest first.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/skills (the `ListSkills` operationId).

func (*ClientWithResponses) RetrieveAgentWithResponse

func (c *ClientWithResponses) RetrieveAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RetrieveAgentResponse, error)

RetrieveAgentWithResponse Retrieve Agent Response

Retrieve a response created earlier. Returns a JSON snapshot of the response. Only responses created with `store` omitted or `true` can be retrieved; `store: false` responses return a 404.

Returns a wrapper object for the known response body format(s).

Corresponds with GET /v1/agent/{id} (the `RetrieveAgent` operationId).

func (*ClientWithResponses) SearchSearchPostWithBodyWithResponse

func (c *ClientWithResponses) SearchSearchPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchSearchPostResponse, error)

SearchSearchPostWithBodyWithResponse Search the Web

Search the web and retrieve relevant web page contents.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /search (the `SearchSearchPost` operationId).

func (*ClientWithResponses) SearchSearchPostWithResponse

func (c *ClientWithResponses) SearchSearchPostWithResponse(ctx context.Context, body SearchSearchPostJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchSearchPostResponse, error)

SearchSearchPostWithResponse Search the Web

Search the web and retrieve relevant web page contents.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /search (the `SearchSearchPost` operationId).

func (*ClientWithResponses) UpdateSkillWithBodyWithResponse

func (c *ClientWithResponses) UpdateSkillWithBodyWithResponse(ctx context.Context, skillId SkillId, params *UpdateSkillParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSkillResponse, error)

UpdateSkillWithBodyWithResponse Add a skill revision

Uploads a new zip bundle as a new revision of an existing skill. Pass the revision you expect to replace as the required `expected_revision`; the request fails with `409` if the skill has already moved past it, so the update cannot race a concurrent write. Name and description are re-read from the new bundle.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with PUT /v1/skills/{skill_id} (the `UpdateSkill` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// SearchSearchPostWithBodyWithResponse Search the Web
	//
	// Search the web and retrieve relevant web page contents.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /search (the `SearchSearchPost` operationId).
	SearchSearchPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchSearchPostResponse, error)

	// SearchSearchPostWithResponse Search the Web
	//
	// Search the web and retrieve relevant web page contents.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /search (the `SearchSearchPost` operationId).
	SearchSearchPostWithResponse(ctx context.Context, body SearchSearchPostJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchSearchPostResponse, error)

	// CreateAgentWithBodyWithResponse Create Agent Response
	//
	// Generate a response for the provided input with optional web search and reasoning.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/agent (the `CreateAgent` operationId).
	CreateAgentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAgentResponse, error)

	// CreateAgentWithResponse Create Agent Response
	//
	// Generate a response for the provided input with optional web search and reasoning.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/agent (the `CreateAgent` operationId).
	CreateAgentWithResponse(ctx context.Context, body CreateAgentJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAgentResponse, error)

	// RetrieveAgentWithResponse Retrieve Agent Response
	//
	// Retrieve a response created earlier. Returns a JSON snapshot of the response. Only responses created with `store` omitted or `true` can be retrieved; `store: false` responses return a 404.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/agent/{id} (the `RetrieveAgent` operationId).
	RetrieveAgentWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RetrieveAgentResponse, error)

	// CancelAgentResponseWithResponse Cancel Agent Response
	//
	// Requests cancellation of response `{id}`. Acts on durable state, so it works for background runs that outlive the client connection. Cancellation is asynchronous: a `200` acknowledges the request (`status: cancelling`) and the run stops shortly after - poll `GET /v1/agent/{id}` for its terminal status. Cancelling a run that is already terminal returns `400`. Ownership is enforced server side; a cross-tenant or unknown id surfaces as `404`.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/agent/{id}/cancel (the `CancelAgentResponse` operationId).
	CancelAgentResponseWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*CancelAgentResponseResponse, error)

	// ListAgentFilesWithResponse List Agent Response Files
	//
	// List the files a response produced in the sandbox and delivered with the `share_file` tool. Scoped to the authenticated account, which only ever sees its own files. File content is not returned inline; download it with the file content endpoint.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/agent/{id}/files (the `ListAgentFiles` operationId).
	ListAgentFilesWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*ListAgentFilesResponse, error)

	// DownloadAgentFileWithResponse Download Agent Response File
	//
	// Download the raw bytes of a file the response delivered with the `share_file` tool. The `file_id` comes from the file list endpoint and is distinct from the response `id`. The response streams raw bytes, not JSON, with a `Content-Type` matching the file and a `Content-Disposition: attachment` header carrying the original filename.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/agent/{id}/files/{file_id}/content (the `DownloadAgentFile` operationId).
	DownloadAgentFileWithResponse(ctx context.Context, id string, fileId string, reqEditors ...RequestEditorFn) (*DownloadAgentFileResponse, error)

	// GetComputerUsageAnalyticsWithResponse Usage Analytics
	//
	// Returns your organization's Perplexity usage analytics as a bucketed time series for a single dataset. Requires an organization analytics API key, generated by an org admin from Settings → Organization → Computer in the Perplexity web app. Only complete UTC grid buckets are returned: start_time snaps down to its bucket, and the in-progress bucket is never included. Datasets differ in what they count: credits for credit_usage, queries for query_volume, distinct active members for daily_active_users, and thread counts for the rest. Buckets of daily_active_users are not additive — a member active on several days is counted once per day, so summing them is not the window's active-member count.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/analytics/computer/usage (the `GetComputerUsageAnalytics` operationId).
	GetComputerUsageAnalyticsWithResponse(ctx context.Context, params *GetComputerUsageAnalyticsParams, reqEditors ...RequestEditorFn) (*GetComputerUsageAnalyticsResponse, error)

	// ListAsyncChatCompletionsAsyncChatCompletionsGetWithResponse List Async Chat Completions
	//
	// Retrieve a list of all asynchronous chat completion requests for a given user.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/async/sonar (the `ListAsyncChatCompletionsAsyncChatCompletionsGet` operationId).
	ListAsyncChatCompletionsAsyncChatCompletionsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAsyncChatCompletionsAsyncChatCompletionsGetResponse, error)

	// CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBodyWithResponse Create Async Chat Completion
	//
	// Submit an asynchronous chat completion request.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/async/sonar (the `CreateAsyncChatCompletionsAsyncChatCompletionsPost` operationId).
	CreateAsyncChatCompletionsAsyncChatCompletionsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse, error)

	// CreateAsyncChatCompletionsAsyncChatCompletionsPostWithResponse Create Async Chat Completion
	//
	// Submit an asynchronous chat completion request.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/async/sonar (the `CreateAsyncChatCompletionsAsyncChatCompletionsPost` operationId).
	CreateAsyncChatCompletionsAsyncChatCompletionsPostWithResponse(ctx context.Context, body CreateAsyncChatCompletionsAsyncChatCompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse, error)

	// GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetWithResponse Get Async Chat Completion
	//
	// Retrieve the response for a given asynchronous chat completion request.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/async/sonar/{api_request} (the `GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGet` operationId).
	GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetWithResponse(ctx context.Context, apiRequest string, reqEditors ...RequestEditorFn) (*GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse, error)

	// ListBatchesWithResponse List batches
	//
	// Lists your organization's batches, newest first.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/batches (the `ListBatches` operationId).
	ListBatchesWithResponse(ctx context.Context, params *ListBatchesParams, reqEditors ...RequestEditorFn) (*ListBatchesResponse, error)

	// CreateBatchWithBodyWithResponse Create a batch
	//
	// Creates a batch from an uploaded input file. The batch starts in
	// `validating`. Send an `Idempotency-Key` header to make retries safe: a
	// repeat with the same key returns the original batch.
	// `output_expires_after` is not supported and is rejected with a 400;
	// output and error files are kept 30 days.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/batches (the `CreateBatch` operationId).
	CreateBatchWithBodyWithResponse(ctx context.Context, params *CreateBatchParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateBatchResponse, error)

	// CreateBatchWithResponse Create a batch
	//
	// Creates a batch from an uploaded input file. The batch starts in
	// `validating`. Send an `Idempotency-Key` header to make retries safe: a
	// repeat with the same key returns the original batch.
	// `output_expires_after` is not supported and is rejected with a 400;
	// output and error files are kept 30 days.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/batches (the `CreateBatch` operationId).
	CreateBatchWithResponse(ctx context.Context, params *CreateBatchParams, body CreateBatchJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateBatchResponse, error)

	// GetBatchWithResponse Retrieve a batch
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/batches/{batch_id} (the `GetBatch` operationId).
	GetBatchWithResponse(ctx context.Context, batchId BatchId, reqEditors ...RequestEditorFn) (*GetBatchResponse, error)

	// CancelBatchWithResponse Cancel a batch
	//
	// Moves the batch to `cancelling`; it becomes `cancelled` once running
	// items stop. Completed items stay in the output file and are billed.
	// Cancelling a cancelled or cancelling batch returns it unchanged.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/batches/{batch_id}/cancel (the `CancelBatch` operationId).
	CancelBatchWithResponse(ctx context.Context, batchId BatchId, reqEditors ...RequestEditorFn) (*CancelBatchResponse, error)

	// ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBodyWithResponse Create Contextualized Embeddings
	//
	// Generate contextualized embeddings for document chunks. Chunks from the same document share context awareness, improving retrieval quality for document-based applications.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/contextualizedembeddings (the `ContextualizedEmbeddingsV1ContextualizedembeddingsPost` operationId).
	ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse, error)

	// ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithResponse Create Contextualized Embeddings
	//
	// Generate contextualized embeddings for document chunks. Chunks from the same document share context awareness, improving retrieval quality for document-based applications.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/contextualizedembeddings (the `ContextualizedEmbeddingsV1ContextualizedembeddingsPost` operationId).
	ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithResponse(ctx context.Context, body ContextualizedEmbeddingsV1ContextualizedembeddingsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse, error)

	// DecisionsV1DecisionsPostWithBodyWithResponse Answer questions
	//
	// Evaluate one or more named questions against the content in `state`. Mix `noul`, `choice`, and `score` questions in one request; the response returns one answer per question under the same name, plus the model name and token usage. Set `model` to `pplx-decider-v1.2` or `pplx-decider-flash-v1.2`, or to the alias `pplx-decider-latest` or `pplx-decider-flash-latest`; a missing or unknown model returns `400`. Send the key as `Authorization: Bearer <key>`; an `x-api-key` header is not read and returns `401`.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/decisions (the `DecisionsV1DecisionsPost` operationId).
	DecisionsV1DecisionsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DecisionsV1DecisionsPostResponse, error)

	// DecisionsV1DecisionsPostWithResponse Answer questions
	//
	// Evaluate one or more named questions against the content in `state`. Mix `noul`, `choice`, and `score` questions in one request; the response returns one answer per question under the same name, plus the model name and token usage. Set `model` to `pplx-decider-v1.2` or `pplx-decider-flash-v1.2`, or to the alias `pplx-decider-latest` or `pplx-decider-flash-latest`; a missing or unknown model returns `400`. Send the key as `Authorization: Bearer <key>`; an `x-api-key` header is not read and returns `401`.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/decisions (the `DecisionsV1DecisionsPost` operationId).
	DecisionsV1DecisionsPostWithResponse(ctx context.Context, body DecisionsV1DecisionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*DecisionsV1DecisionsPostResponse, error)

	// EmbeddingsV1EmbeddingsPostWithBodyWithResponse Create Embeddings
	//
	// Generate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/embeddings (the `EmbeddingsV1EmbeddingsPost` operationId).
	EmbeddingsV1EmbeddingsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EmbeddingsV1EmbeddingsPostResponse, error)

	// EmbeddingsV1EmbeddingsPostWithResponse Create Embeddings
	//
	// Generate embeddings for a list of texts. Use these embeddings for semantic search, clustering, and other machine learning applications.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/embeddings (the `EmbeddingsV1EmbeddingsPost` operationId).
	EmbeddingsV1EmbeddingsPostWithResponse(ctx context.Context, body EmbeddingsV1EmbeddingsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*EmbeddingsV1EmbeddingsPostResponse, error)

	// ListFilesWithResponse List files
	//
	// Lists your organization's files, both uploads and the output and error
	// files batches write. Deleted and expired files are not listed.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/files (the `ListFiles` operationId).
	ListFilesWithResponse(ctx context.Context, params *ListFilesParams, reqEditors ...RequestEditorFn) (*ListFilesResponse, error)

	// CreateFileWithBodyWithResponse Upload a file
	//
	// Uploads a JSONL batch input file, up to 50,000 lines and 200 MB. Every
	// line is validated before the file is stored. Files expire after 30 days;
	// `expires_after` is not supported and is rejected with a 400.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/files (the `CreateFile` operationId).
	CreateFileWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateFileResponse, error)

	// DeleteFileWithResponse Delete a file
	//
	// Deletes a file. Batches already created from it are not affected.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /v1/files/{file_id} (the `DeleteFile` operationId).
	DeleteFileWithResponse(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*DeleteFileResponse, error)

	// GetFileWithResponse Retrieve a file
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/files/{file_id} (the `GetFile` operationId).
	GetFileWithResponse(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*GetFileResponse, error)

	// GetFileContentWithResponse Download file content
	//
	// Streams the raw bytes of an input, output, or error file.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/files/{file_id}/content (the `GetFileContent` operationId).
	GetFileContentWithResponse(ctx context.Context, fileId BatchFileId, reqEditors ...RequestEditorFn) (*GetFileContentResponse, error)

	// ListModelsWithResponse List Models
	//
	// List the models available for the Agent API. Returns model identifiers that can be used with the `POST /v1/agent` endpoint. The response follows the OpenAI List Models format for compatibility with third-party tools.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/models (the `ListModels` operationId).
	ListModelsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListModelsResponse2, error)

	// ListSkillsWithResponse List skills
	//
	// Lists the skills in your Project, newest first.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/skills (the `ListSkills` operationId).
	ListSkillsWithResponse(ctx context.Context, params *ListSkillsParams, reqEditors ...RequestEditorFn) (*ListSkillsResponse, error)

	// CreateSkillWithBodyWithResponse Create a skill
	//
	// Creates a skill from a zip bundle. The bundle must contain a `SKILL.md`
	// that provides the skill name and description; those fields are read from
	// the bundle, not from the request.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/skills (the `CreateSkill` operationId).
	CreateSkillWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateSkillResponse, error)

	// DeleteSkillWithResponse Delete a skill
	//
	// Deletes a skill. Pass the current revision as `expected_revision`; the
	// delete fails with `409` if the skill has a newer revision, so a delete
	// never races a concurrent update.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with DELETE /v1/skills/{skill_id} (the `DeleteSkill` operationId).
	DeleteSkillWithResponse(ctx context.Context, skillId SkillId, params *DeleteSkillParams, reqEditors ...RequestEditorFn) (*DeleteSkillResponse, error)

	// GetSkillWithResponse Get a skill
	//
	// Returns a skill. Without `revision`, returns the active revision.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/skills/{skill_id} (the `GetSkill` operationId).
	GetSkillWithResponse(ctx context.Context, skillId SkillId, params *GetSkillParams, reqEditors ...RequestEditorFn) (*GetSkillResponse, error)

	// UpdateSkillWithBodyWithResponse Add a skill revision
	//
	// Uploads a new zip bundle as a new revision of an existing skill. Pass the
	// revision you expect to replace as the required `expected_revision`; the
	// request fails with `409` if the skill has already moved past it, so the
	// update cannot race a concurrent write. Name and description are re-read
	// from the new bundle.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with PUT /v1/skills/{skill_id} (the `UpdateSkill` operationId).
	UpdateSkillWithBodyWithResponse(ctx context.Context, skillId SkillId, params *UpdateSkillParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSkillResponse, error)

	// DownloadSkillWithResponse Get a skill download URL
	//
	// Returns a short-lived URL to download the skill bundle as a zip. Without
	// `revision`, returns the active revision.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/skills/{skill_id}/download (the `DownloadSkill` operationId).
	DownloadSkillWithResponse(ctx context.Context, skillId SkillId, params *DownloadSkillParams, reqEditors ...RequestEditorFn) (*DownloadSkillResponse, error)

	// ListSkillRevisionsWithResponse List skill revisions
	//
	// Lists the revisions of a skill, newest first.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/skills/{skill_id}/revisions (the `ListSkillRevisions` operationId).
	ListSkillRevisionsWithResponse(ctx context.Context, skillId SkillId, params *ListSkillRevisionsParams, reqEditors ...RequestEditorFn) (*ListSkillRevisionsResponse, error)

	// ChatCompletionsChatCompletionsPostWithBodyWithResponse Create Chat Completion
	//
	// Generate a chat completion response for the given conversation.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/sonar (the `ChatCompletionsChatCompletionsPost` operationId).
	ChatCompletionsChatCompletionsPostWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ChatCompletionsChatCompletionsPostResponse, error)

	// ChatCompletionsChatCompletionsPostWithResponse Create Chat Completion
	//
	// Generate a chat completion response for the given conversation.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /v1/sonar (the `ChatCompletionsChatCompletionsPost` operationId).
	ChatCompletionsChatCompletionsPostWithResponse(ctx context.Context, body ChatCompletionsChatCompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ChatCompletionsChatCompletionsPostResponse, error)

	// GetComputerUsageAnalyticsV2WithResponse Usage Analytics per Member
	//
	// Returns your organization's Perplexity usage broken down per member, as daily buckets. Each day lists one row per member with usage that day, keyed by email. credit_usage carries the same Model and Credit Source breakdown as v1; query_volume carries Feature, Project and Comet. Uses the same organization analytics API key as v1. Only complete UTC days are returned; the in-progress day is never included.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v2/analytics/computer/usage (the `GetComputerUsageAnalyticsV2` operationId).
	GetComputerUsageAnalyticsV2WithResponse(ctx context.Context, params *GetComputerUsageAnalyticsV2Params, reqEditors ...RequestEditorFn) (*GetComputerUsageAnalyticsV2Response, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CompletionResponse

type CompletionResponse struct {
	// Choices Array of completion choices
	Choices []Choice `json:"choices"`

	// Citations URLs of sources used to generate the response
	Citations *[]string `json:"citations,omitempty"`

	// Created Unix timestamp when the completion was created
	Created int `json:"created"`

	// Id Unique identifier for the completion
	Id string `json:"id"`

	// Images Array of images returned when return_images is true
	Images *[]ImageResult `json:"images,omitempty"`

	// Model Model used for generation
	Model string `json:"model"`

	// Object Object type identifier
	Object *string `json:"object,omitempty"`

	// RelatedQuestions Array of related questions returned when return_related_questions is true
	RelatedQuestions *[]string `json:"related_questions,omitempty"`

	// SearchResults Search results used for context in the response
	SearchResults *[]ApiPublicSearchResult `json:"search_results,omitempty"`
	Usage         *UsageInfo               `json:"usage,omitempty"`
}

CompletionResponse defines model for CompletionResponse.

type ComputerUsageBucket

type ComputerUsageBucket struct {
	// ByCategories Category breakdowns for this bucket, keyed by the labels declared in the response's top-level `categories` list. An empty list means the bucket has no data for that breakdown.
	ByCategories map[string][]ComputerUsageCategoryCount `json:"by_categories"`

	// Count Bucket total. For credit_usage this may exceed the sum of any single breakdown — usage without a category attribution counts toward the total but not the breakdown.
	Count int `json:"count"`

	// EndTime Bucket end in unix seconds (UTC), exclusive.
	EndTime int `json:"end_time"`

	// StartTime Bucket start in unix seconds (UTC), inclusive.
	StartTime int `json:"start_time"`
}

ComputerUsageBucket defines model for ComputerUsageBucket.

type ComputerUsageCategoryCount

type ComputerUsageCategoryCount struct {
	Category string `json:"category"`
	Count    int    `json:"count"`
}

ComputerUsageCategoryCount A bucket's count for one value of a category breakdown — e.g. a connector name for connectors, a duration band for task_durations, or paid/promo for credit_usage's Credit Source axis.

type ComputerUsageResponse

type ComputerUsageResponse struct {
	// Categories Category breakdown labels the requested dataset surfaces, in canonical render order. Each label is a key in every bucket's `by_categories`.
	Categories []string `json:"categories"`

	// Data Every bucket in the page's window, in chronological order. Buckets without data carry count 0 and an empty breakdown.
	Data []ComputerUsageBucket `json:"data"`

	// HasMore Whether more buckets exist beyond this page. False also when the window's remaining buckets are past the current data frontier.
	HasMore bool `json:"has_more"`

	// NextPage Cursor for the next page; pass as the page parameter with otherwise identical query parameters.
	NextPage *string `json:"next_page,omitempty"`
}

ComputerUsageResponse defines model for ComputerUsageResponse.

type ComputerUsageV2Bucket

type ComputerUsageV2Bucket struct {
	// EndTime Day end in unix seconds (UTC), exclusive.
	EndTime int `json:"end_time"`

	// Results One row per member with credit usage on this day.
	Results []ComputerUsageV2Result `json:"results"`

	// StartTime Day start in unix seconds (UTC), inclusive.
	StartTime int `json:"start_time"`
}

ComputerUsageV2Bucket defines model for ComputerUsageV2Bucket.

type ComputerUsageV2Response

type ComputerUsageV2Response struct {
	// Categories Category breakdown labels each member row surfaces, in canonical render order. Each label is a key in every row's `by_categories`.
	Categories []string `json:"categories"`

	// Data Daily buckets in chronological order, each with one row per member who used credits that day. Days with no attributable usage are omitted.
	Data []ComputerUsageV2Bucket `json:"data"`

	// HasMore Whether more member rows exist beyond this page.
	HasMore bool `json:"has_more"`

	// NextPage Cursor for the next page; pass as the page parameter with otherwise identical query parameters.
	NextPage *string `json:"next_page,omitempty"`
}

ComputerUsageV2Response defines model for ComputerUsageV2Response.

type ComputerUsageV2Result

type ComputerUsageV2Result struct {
	// ByCategories The member's day broken down by each label in the response's top-level `categories` list.
	ByCategories map[string][]ComputerUsageCategoryCount `json:"by_categories"`

	// Count The member's credit total for the day. May exceed the sum of any single breakdown — usage without a category attribution counts toward the total but not the breakdown.
	Count int `json:"count"`

	// UserEmail The member's email. Rows whose member can no longer be resolved to an email are omitted.
	UserEmail string `json:"user_email"`
}

ComputerUsageV2Result One member's credit usage for a single day.

type ConnectorTool

type ConnectorTool struct {
	// AllowedTools Optional exact-name allowlist. Omitted or empty admits every live tool.
	AllowedTools *[]string `json:"allowed_tools,omitempty"`

	// Id Opaque connector identifier.
	Id string `json:"id"`

	// RequireApproval Approval policy for this connector's MCP tool calls. Omitted, null, or `"never"` runs every call automatically; `"always"` gates every call; the object form filters by exact tool name and reported read-only classification.
	RequireApproval *RequireApproval `json:"require_approval,omitempty"`

	// ServerDescription Optional model-facing namespace description.
	ServerDescription *string `json:"server_description,omitempty"`

	// ServerLabel Unique per request, ^[a-zA-Z0-9_-]{1,64}$. Namespaces the connector's tools.
	ServerLabel string            `json:"server_label"`
	Type        ConnectorToolType `json:"type"`
}

ConnectorTool A saved managed or custom connector scoped to the authenticated Project.

type ConnectorToolType

type ConnectorToolType string

ConnectorToolType defines model for ConnectorTool.Type.

const (
	ConnectorToolTypeConnector ConnectorToolType = "connector"
)

Defines values for ConnectorToolType.

func (ConnectorToolType) Valid

func (e ConnectorToolType) Valid() bool

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

type ContentPart

type ContentPart struct {
	Annotations *[]Annotation `json:"annotations,omitempty"`
	Text        string        `json:"text"`

	// Type Type of a content part
	Type ContentPartType `json:"type"`
}

ContentPart defines model for ContentPart.

type ContentPartType

type ContentPartType string

ContentPartType Type of a content part

const (
	ContentPartTypeOutputText ContentPartType = "output_text"
)

Defines values for ContentPartType.

func (ContentPartType) Valid

func (e ContentPartType) Valid() bool

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

type ContextualizedEmbeddingObject

type ContextualizedEmbeddingObject struct {
	// Data List of embedding objects for chunks in this document
	Data *[]EmbeddingObject `json:"data,omitempty"`

	// Index The index of the document this chunk belongs to
	Index *int `json:"index,omitempty"`

	// Object The object type
	Object *string `json:"object,omitempty"`
}

ContextualizedEmbeddingObject A single contextualized embedding result

type ContextualizedEmbeddingsRequest

type ContextualizedEmbeddingsRequest struct {
	// Dimensions Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-context-v1-0.6b, 128-2560 for pplx-embed-context-v1-4b. Defaults to full dimensions (1024 or 2560).
	Dimensions *int `json:"dimensions,omitempty"`

	// EncodingFormat Output encoding format for embeddings. base64_int8 returns base64-encoded signed int8 values. base64_binary returns base64-encoded packed binary (1 bit per dimension).
	EncodingFormat *ContextualizedEmbeddingsRequestEncodingFormat `json:"encoding_format,omitempty"`

	// Input Nested array structure where each inner array contains chunks from a single document. Chunks within the same document are encoded with document-level context awareness. Maximum 512 documents. Total chunks across all documents must not exceed 16,000. Total tokens per document must not exceed 32K. All chunks in a single request must not exceed 120,000 tokens combined. Empty strings are not allowed.
	Input [][]string `json:"input"`

	// Model The contextualized embedding model to use
	Model ContextualizedEmbeddingsRequestModel `json:"model"`
}

ContextualizedEmbeddingsRequest Request body for creating contextualized embeddings

type ContextualizedEmbeddingsRequestEncodingFormat

type ContextualizedEmbeddingsRequestEncodingFormat string

ContextualizedEmbeddingsRequestEncodingFormat Output encoding format for embeddings. base64_int8 returns base64-encoded signed int8 values. base64_binary returns base64-encoded packed binary (1 bit per dimension).

const (
	ContextualizedEmbeddingsRequestEncodingFormatBase64Binary ContextualizedEmbeddingsRequestEncodingFormat = "base64_binary"
	ContextualizedEmbeddingsRequestEncodingFormatBase64Int8   ContextualizedEmbeddingsRequestEncodingFormat = "base64_int8"
)

Defines values for ContextualizedEmbeddingsRequestEncodingFormat.

func (ContextualizedEmbeddingsRequestEncodingFormat) Valid

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

type ContextualizedEmbeddingsRequestModel

type ContextualizedEmbeddingsRequestModel string

ContextualizedEmbeddingsRequestModel The contextualized embedding model to use

const (
	ContextualizedEmbeddingsRequestModelPplxEmbedContextV106b ContextualizedEmbeddingsRequestModel = "pplx-embed-context-v1-0.6b"
	ContextualizedEmbeddingsRequestModelPplxEmbedContextV14b  ContextualizedEmbeddingsRequestModel = "pplx-embed-context-v1-4b"
)

Defines values for ContextualizedEmbeddingsRequestModel.

func (ContextualizedEmbeddingsRequestModel) Valid

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

type ContextualizedEmbeddingsResponse

type ContextualizedEmbeddingsResponse struct {
	// Data List of contextualized embedding objects
	Data *[]ContextualizedEmbeddingObject `json:"data,omitempty"`

	// Model The model used to generate embeddings
	Model *string `json:"model,omitempty"`

	// Object The object type
	Object *string `json:"object,omitempty"`

	// Usage Token usage for the embeddings request
	Usage *EmbeddingsUsage `json:"usage,omitempty"`
}

ContextualizedEmbeddingsResponse Response body for contextualized embeddings request

type ContextualizedEmbeddingsV1ContextualizedembeddingsPostJSONRequestBody

type ContextualizedEmbeddingsV1ContextualizedembeddingsPostJSONRequestBody = ContextualizedEmbeddingsRequest

ContextualizedEmbeddingsV1ContextualizedembeddingsPostJSONRequestBody defines body for ContextualizedEmbeddingsV1ContextualizedembeddingsPost for application/json ContentType.

type ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse

type ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ContextualizedEmbeddingsResponse
	// JSON422 the response for an HTTP 422 `application/json` response
	JSON422 *HTTPValidationError
}

func ParseContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse

func ParseContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse(rsp *http.Response) (*ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse, error)

ParseContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse parses an HTTP response from a ContextualizedEmbeddingsV1ContextualizedembeddingsPostWithResponse call

func (ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse) GetBody

GetBody returns the raw response body bytes

func (ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse) GetJSON422

GetJSON422 returns the response for an HTTP 422 `application/json` response

func (ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse) Status

Status returns HTTPResponse.Status

func (ContextualizedEmbeddingsV1ContextualizedembeddingsPostResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type Cost

type Cost struct {
	// CitationTokensCost Cost for citation tokens in USD
	CitationTokensCost *float64 `json:"citation_tokens_cost,omitempty"`

	// InputTokensCost Cost for input tokens in USD
	InputTokensCost float64 `json:"input_tokens_cost"`

	// OutputTokensCost Cost for output tokens in USD
	OutputTokensCost float64 `json:"output_tokens_cost"`

	// ReasoningTokensCost Cost for reasoning tokens in USD
	ReasoningTokensCost *float64 `json:"reasoning_tokens_cost,omitempty"`

	// RequestCost Cost for web search requests in USD (includes pro search cost if applicable)
	RequestCost *float64 `json:"request_cost,omitempty"`

	// SearchQueriesCost Cost for search queries in USD
	SearchQueriesCost *float64 `json:"search_queries_cost,omitempty"`

	// TotalCost Total cost for the request in USD
	TotalCost float64 `json:"total_cost"`
}

Cost Cost breakdown for a chat completion request

type CreateAgentJSONRequestBody

type CreateAgentJSONRequestBody = ResponsesRequest

CreateAgentJSONRequestBody defines body for CreateAgent for application/json ContentType.

type CreateAgentResponse

type CreateAgentResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ResponsesResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *struct {
		// Error Error information returned when a request fails
		Error *ErrorInfo `json:"error,omitempty"`
	}
}

func ParseCreateAgentResponse

func ParseCreateAgentResponse(rsp *http.Response) (*CreateAgentResponse, error)

ParseCreateAgentResponse parses an HTTP response from a CreateAgentWithResponse call

func (CreateAgentResponse) ContentType

func (r CreateAgentResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateAgentResponse) GetBody

func (r CreateAgentResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateAgentResponse) GetJSON200

func (r CreateAgentResponse) GetJSON200() *ResponsesResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CreateAgentResponse) GetJSON400

func (r CreateAgentResponse) GetJSON400() *struct {
	// Error Error information returned when a request fails
	Error *ErrorInfo `json:"error,omitempty"`
}

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (CreateAgentResponse) Status

func (r CreateAgentResponse) Status() string

Status returns HTTPResponse.Status

func (CreateAgentResponse) StatusCode

func (r CreateAgentResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateAsyncChatCompletionsAsyncChatCompletionsPostJSONRequestBody

type CreateAsyncChatCompletionsAsyncChatCompletionsPostJSONRequestBody = AsyncApiChatCompletionsRequest

CreateAsyncChatCompletionsAsyncChatCompletionsPostJSONRequestBody defines body for CreateAsyncChatCompletionsAsyncChatCompletionsPost for application/json ContentType.

type CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse

type CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *AsyncApiChatCompletionsResponse
	// JSON422 the response for an HTTP 422 `application/json` response
	JSON422 *HTTPValidationError
}

func ParseCreateAsyncChatCompletionsAsyncChatCompletionsPostResponse

func ParseCreateAsyncChatCompletionsAsyncChatCompletionsPostResponse(rsp *http.Response) (*CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse, error)

ParseCreateAsyncChatCompletionsAsyncChatCompletionsPostResponse parses an HTTP response from a CreateAsyncChatCompletionsAsyncChatCompletionsPostWithResponse call

func (CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse) GetBody

GetBody returns the raw response body bytes

func (CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse) GetJSON422

GetJSON422 returns the response for an HTTP 422 `application/json` response

func (CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse) Status

Status returns HTTPResponse.Status

func (CreateAsyncChatCompletionsAsyncChatCompletionsPostResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type CreateBatchJSONRequestBody added in v0.2.0

type CreateBatchJSONRequestBody = CreateBatchRequest

CreateBatchJSONRequestBody defines body for CreateBatch for application/json ContentType.

type CreateBatchParams added in v0.2.0

type CreateBatchParams struct {
	// IdempotencyKey Unique key for this create; a repeat returns the original batch
	IdempotencyKey *BatchIdempotencyKey `json:"Idempotency-Key,omitempty"`
}

CreateBatchParams defines parameters for CreateBatch.

type CreateBatchRequest added in v0.2.0

type CreateBatchRequest struct {
	// CompletionWindow Target completion time; `24h` is the only value and the default
	CompletionWindow *CreateBatchRequestCompletionWindow `json:"completion_window,omitempty"`

	// Endpoint Endpoint every line in the input file targets
	Endpoint CreateBatchRequestEndpoint `json:"endpoint"`

	// InputFileId Id of a file uploaded with `purpose=batch`
	InputFileId string `json:"input_file_id"`

	// Metadata Up to 16 key value pairs; keys up to 64 characters, values up to 512
	Metadata *map[string]string `json:"metadata,omitempty"`
}

CreateBatchRequest defines model for CreateBatchRequest.

type CreateBatchRequestCompletionWindow added in v0.2.0

type CreateBatchRequestCompletionWindow string

CreateBatchRequestCompletionWindow Target completion time; `24h` is the only value and the default

const (
	CreateBatchRequestCompletionWindowN24h CreateBatchRequestCompletionWindow = "24h"
)

Defines values for CreateBatchRequestCompletionWindow.

func (CreateBatchRequestCompletionWindow) Valid added in v0.2.0

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

type CreateBatchRequestEndpoint added in v0.2.0

type CreateBatchRequestEndpoint string

CreateBatchRequestEndpoint Endpoint every line in the input file targets

const (
	CreateBatchRequestEndpointV1responses CreateBatchRequestEndpoint = "/v1/responses"
)

Defines values for CreateBatchRequestEndpoint.

func (CreateBatchRequestEndpoint) Valid added in v0.2.0

func (e CreateBatchRequestEndpoint) Valid() bool

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

type CreateBatchResponse added in v0.2.0

type CreateBatchResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Batch
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON402 the response for an HTTP 402 `application/json` response
	JSON402 *ApiError
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
	// JSON503 the response for an HTTP 503 `application/json` response
	JSON503 *ApiError
}

func ParseCreateBatchResponse added in v0.2.0

func ParseCreateBatchResponse(rsp *http.Response) (*CreateBatchResponse, error)

ParseCreateBatchResponse parses an HTTP response from a CreateBatchWithResponse call

func (CreateBatchResponse) ContentType added in v0.2.0

func (r CreateBatchResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateBatchResponse) GetBody added in v0.2.0

func (r CreateBatchResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateBatchResponse) GetJSON200 added in v0.2.0

func (r CreateBatchResponse) GetJSON200() *Batch

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CreateBatchResponse) GetJSON400 added in v0.2.0

func (r CreateBatchResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (CreateBatchResponse) GetJSON402 added in v0.2.0

func (r CreateBatchResponse) GetJSON402() *ApiError

GetJSON402 returns the response for an HTTP 402 `application/json` response

func (CreateBatchResponse) GetJSON403 added in v0.2.0

func (r CreateBatchResponse) GetJSON403() *ApiError

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (CreateBatchResponse) GetJSON429 added in v0.2.0

func (r CreateBatchResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (CreateBatchResponse) GetJSON503 added in v0.2.0

func (r CreateBatchResponse) GetJSON503() *ApiError

GetJSON503 returns the response for an HTTP 503 `application/json` response

func (CreateBatchResponse) Status added in v0.2.0

func (r CreateBatchResponse) Status() string

Status returns HTTPResponse.Status

func (CreateBatchResponse) StatusCode added in v0.2.0

func (r CreateBatchResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateFileMultipartBody added in v0.2.0

type CreateFileMultipartBody struct {
	// File The JSONL file
	File openapi_types.File `json:"file"`

	// Purpose Only `batch` is accepted
	Purpose CreateFileMultipartBodyPurpose `json:"purpose"`
}

CreateFileMultipartBody defines parameters for CreateFile.

type CreateFileMultipartBodyPurpose added in v0.2.0

type CreateFileMultipartBodyPurpose string

CreateFileMultipartBodyPurpose defines parameters for CreateFile.

const (
	CreateFileMultipartBodyPurposeBatch CreateFileMultipartBodyPurpose = "batch"
)

Defines values for CreateFileMultipartBodyPurpose.

func (CreateFileMultipartBodyPurpose) Valid added in v0.2.0

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

type CreateFileMultipartRequestBody added in v0.2.0

type CreateFileMultipartRequestBody CreateFileMultipartBody

CreateFileMultipartRequestBody defines body for CreateFile for multipart/form-data ContentType.

type CreateFileResponse added in v0.2.0

type CreateFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *BatchFile
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON403 the response for an HTTP 403 `application/json` response
	JSON403 *ApiError
	// JSON413 the response for an HTTP 413 `application/json` response
	JSON413 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
}

func ParseCreateFileResponse added in v0.2.0

func ParseCreateFileResponse(rsp *http.Response) (*CreateFileResponse, error)

ParseCreateFileResponse parses an HTTP response from a CreateFileWithResponse call

func (CreateFileResponse) ContentType added in v0.2.0

func (r CreateFileResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateFileResponse) GetBody added in v0.2.0

func (r CreateFileResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateFileResponse) GetJSON200 added in v0.2.0

func (r CreateFileResponse) GetJSON200() *BatchFile

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (CreateFileResponse) GetJSON400 added in v0.2.0

func (r CreateFileResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (CreateFileResponse) GetJSON403 added in v0.2.0

func (r CreateFileResponse) GetJSON403() *ApiError

GetJSON403 returns the response for an HTTP 403 `application/json` response

func (CreateFileResponse) GetJSON413 added in v0.2.0

func (r CreateFileResponse) GetJSON413() *ApiError

GetJSON413 returns the response for an HTTP 413 `application/json` response

func (CreateFileResponse) GetJSON429 added in v0.2.0

func (r CreateFileResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (CreateFileResponse) Status added in v0.2.0

func (r CreateFileResponse) Status() string

Status returns HTTPResponse.Status

func (CreateFileResponse) StatusCode added in v0.2.0

func (r CreateFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateSkillMultipartBody

type CreateSkillMultipartBody struct {
	// File The skill bundle, a zip archive containing `SKILL.md`
	File openapi_types.File `json:"file"`
}

CreateSkillMultipartBody defines parameters for CreateSkill.

type CreateSkillMultipartRequestBody

type CreateSkillMultipartRequestBody CreateSkillMultipartBody

CreateSkillMultipartRequestBody defines body for CreateSkill for multipart/form-data ContentType.

type CreateSkillResponse

type CreateSkillResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON201 the response for an HTTP 201 `application/json` response
	JSON201 *ManagedSkill
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON409 the response for an HTTP 409 `application/json` response
	JSON409 *ApiError
	// JSON413 the response for an HTTP 413 `application/json` response
	JSON413 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
	// JSON502 the response for an HTTP 502 `application/json` response
	JSON502 *ApiError
}

func ParseCreateSkillResponse

func ParseCreateSkillResponse(rsp *http.Response) (*CreateSkillResponse, error)

ParseCreateSkillResponse parses an HTTP response from a CreateSkillWithResponse call

func (CreateSkillResponse) ContentType

func (r CreateSkillResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (CreateSkillResponse) GetBody

func (r CreateSkillResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (CreateSkillResponse) GetJSON201

func (r CreateSkillResponse) GetJSON201() *ManagedSkill

GetJSON201 returns the response for an HTTP 201 `application/json` response

func (CreateSkillResponse) GetJSON400

func (r CreateSkillResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (CreateSkillResponse) GetJSON409

func (r CreateSkillResponse) GetJSON409() *ApiError

GetJSON409 returns the response for an HTTP 409 `application/json` response

func (CreateSkillResponse) GetJSON413

func (r CreateSkillResponse) GetJSON413() *ApiError

GetJSON413 returns the response for an HTTP 413 `application/json` response

func (CreateSkillResponse) GetJSON429

func (r CreateSkillResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (CreateSkillResponse) GetJSON502

func (r CreateSkillResponse) GetJSON502() *ApiError

GetJSON502 returns the response for an HTTP 502 `application/json` response

func (CreateSkillResponse) Status

func (r CreateSkillResponse) Status() string

Status returns HTTPResponse.Status

func (CreateSkillResponse) StatusCode

func (r CreateSkillResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Currency

type Currency string

Currency Currency code for cost values

const (
	CurrencyUSD Currency = "USD"
)

Defines values for Currency.

func (Currency) Valid

func (e Currency) Valid() bool

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

type CustomSkill

type CustomSkill struct {
	// Id Identifier of an organization-owned skill stored in Perplexity, in the form skill_<id>.
	Id   string          `json:"id"`
	Type CustomSkillType `json:"type"`

	// Version Revision to load, or "latest". Omitted means "latest".
	Version *string `json:"version,omitempty"`
}

CustomSkill defines model for CustomSkill.

type CustomSkillType

type CustomSkillType string

CustomSkillType defines model for CustomSkill.Type.

const (
	CustomSkillTypeCustom CustomSkillType = "custom"
)

Defines values for CustomSkillType.

func (CustomSkillType) Valid

func (e CustomSkillType) Valid() bool

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

type Date

type Date = string

Date Input: MM/DD/YYYY, Output: YYYY-MM-DD

type DateFilters

type DateFilters struct {
	// LastUpdatedAfterFilter Return results updated after this date (MM/DD/YYYY)
	LastUpdatedAfterFilter *Date `json:"last_updated_after_filter,omitempty"`

	// LastUpdatedBeforeFilter Return results updated before this date (MM/DD/YYYY)
	LastUpdatedBeforeFilter *Date `json:"last_updated_before_filter,omitempty"`

	// SearchAfterDateFilter Return results published after this date (MM/DD/YYYY)
	SearchAfterDateFilter *Date `json:"search_after_date_filter,omitempty"`

	// SearchBeforeDateFilter Return results published before this date (MM/DD/YYYY)
	SearchBeforeDateFilter *Date `json:"search_before_date_filter,omitempty"`

	// SearchRecencyFilter Filter by publication recency (hour/day/week/month/year)
	SearchRecencyFilter *SearchRecencyFilter `json:"search_recency_filter,omitempty"`
}

DateFilters defines model for DateFilters.

type DecisionsRequest

type DecisionsRequest struct {
	// Model The decision model: `pplx-decider-v1.2` (27B, $0.02 per million input tokens) or `pplx-decider-flash-v1.2` (4B, $0.01 per million input tokens). The aliases `pplx-decider-latest` and `perplexity/pplx-decider-latest` select `pplx-decider-v1.2`, and `pplx-decider-flash-latest` and `perplexity/pplx-decider-flash-latest` select `pplx-decider-flash-v1.2`; an alias can move to a newer model over time. `pplx-decider-v1.1-27b` and `pplx-decider-v1-27b` remain accepted and select `pplx-decider-v1.2`. A missing or unknown model returns `400`.
	Model string `json:"model"`

	// Questions Questions keyed by a non-empty name you choose. The response uses the same names. 1 to 128 questions.
	Questions map[string]Question `json:"questions"`

	// State The content every question in the request refers to: a string, an object, or an array. Images can appear anywhere in `state` as OpenAI-style `image_url` parts with base64 PNG, JPEG, or WebP data URLs and are read in place. Up to 8 images per question.
	State DecisionsRequest_State `json:"state"`
}

DecisionsRequest The content to evaluate and the named questions to ask about it. Unknown fields return `400`. The `state` plus any one question must stay under 256K input tokens; questions that do not fit together are answered in groups, and each group counts the `state` again. The body must stay under 32 MiB.

type DecisionsRequestState0

type DecisionsRequestState0 = string

DecisionsRequestState0 defines model for DecisionsRequest.State.0.

type DecisionsRequestState1

type DecisionsRequestState1 map[string]interface{}

DecisionsRequestState1 defines model for DecisionsRequest.State.1.

type DecisionsRequestState2

type DecisionsRequestState2 = []interface{}

DecisionsRequestState2 defines model for DecisionsRequest.State.2.

type DecisionsRequest_State

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

DecisionsRequest_State The content every question in the request refers to: a string, an object, or an array. Images can appear anywhere in `state` as OpenAI-style `image_url` parts with base64 PNG, JPEG, or WebP data URLs and are read in place. Up to 8 images per question.

func (DecisionsRequest_State) AsDecisionsRequestState0

func (t DecisionsRequest_State) AsDecisionsRequestState0() (DecisionsRequestState0, error)

AsDecisionsRequestState0 returns the union data inside the DecisionsRequest_State as a DecisionsRequestState0

func (DecisionsRequest_State) AsDecisionsRequestState1

func (t DecisionsRequest_State) AsDecisionsRequestState1() (DecisionsRequestState1, error)

AsDecisionsRequestState1 returns the union data inside the DecisionsRequest_State as a DecisionsRequestState1

func (DecisionsRequest_State) AsDecisionsRequestState2

func (t DecisionsRequest_State) AsDecisionsRequestState2() (DecisionsRequestState2, error)

AsDecisionsRequestState2 returns the union data inside the DecisionsRequest_State as a DecisionsRequestState2

func (*DecisionsRequest_State) FromDecisionsRequestState0

func (t *DecisionsRequest_State) FromDecisionsRequestState0(v DecisionsRequestState0) error

FromDecisionsRequestState0 overwrites any union data inside the DecisionsRequest_State as the provided DecisionsRequestState0

func (*DecisionsRequest_State) FromDecisionsRequestState1

func (t *DecisionsRequest_State) FromDecisionsRequestState1(v DecisionsRequestState1) error

FromDecisionsRequestState1 overwrites any union data inside the DecisionsRequest_State as the provided DecisionsRequestState1

func (*DecisionsRequest_State) FromDecisionsRequestState2

func (t *DecisionsRequest_State) FromDecisionsRequestState2(v DecisionsRequestState2) error

FromDecisionsRequestState2 overwrites any union data inside the DecisionsRequest_State as the provided DecisionsRequestState2

func (DecisionsRequest_State) MarshalJSON

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

func (*DecisionsRequest_State) MergeDecisionsRequestState0

func (t *DecisionsRequest_State) MergeDecisionsRequestState0(v DecisionsRequestState0) error

MergeDecisionsRequestState0 performs a merge with any union data inside the DecisionsRequest_State, using the provided DecisionsRequestState0

func (*DecisionsRequest_State) MergeDecisionsRequestState1

func (t *DecisionsRequest_State) MergeDecisionsRequestState1(v DecisionsRequestState1) error

MergeDecisionsRequestState1 performs a merge with any union data inside the DecisionsRequest_State, using the provided DecisionsRequestState1

func (*DecisionsRequest_State) MergeDecisionsRequestState2

func (t *DecisionsRequest_State) MergeDecisionsRequestState2(v DecisionsRequestState2) error

MergeDecisionsRequestState2 performs a merge with any union data inside the DecisionsRequest_State, using the provided DecisionsRequestState2

func (*DecisionsRequest_State) UnmarshalJSON

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

type DecisionsResponse

type DecisionsResponse struct {
	// Answers One answer per question, under the question's name.
	Answers map[string]Answer `json:"answers"`

	// Model The model name you sent, echoed back.
	Model string `json:"model"`

	// Usage Token counts for this request.
	Usage Usage `json:"usage"`
}

DecisionsResponse Answers keyed by question name, plus the model that answered and token usage.

type DecisionsV1DecisionsPostJSONRequestBody

type DecisionsV1DecisionsPostJSONRequestBody = DecisionsRequest

DecisionsV1DecisionsPostJSONRequestBody defines body for DecisionsV1DecisionsPost for application/json ContentType.

type DecisionsV1DecisionsPostResponse

type DecisionsV1DecisionsPostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *DecisionsResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *BadRequest
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *Unauthorized
	// JSON413 the response for an HTTP 413 `application/json` response
	JSON413 *PayloadTooLarge
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *TooManyRequests
	// Headers200 the parsed response headers for an HTTP 200 response
	Headers200 *DecisionsV1DecisionsPostResponse200Headers
	// Headers400 the parsed response headers for an HTTP 400 response
	Headers400 *DecisionsV1DecisionsPostResponse400Headers
	// Headers405 the parsed response headers for an HTTP 405 response
	Headers405 *DecisionsV1DecisionsPostResponse405Headers
	// Headers413 the parsed response headers for an HTTP 413 response
	Headers413 *DecisionsV1DecisionsPostResponse413Headers
	// Headers429 the parsed response headers for an HTTP 429 response
	Headers429 *DecisionsV1DecisionsPostResponse429Headers
}

func ParseDecisionsV1DecisionsPostResponse

func ParseDecisionsV1DecisionsPostResponse(rsp *http.Response) (*DecisionsV1DecisionsPostResponse, error)

ParseDecisionsV1DecisionsPostResponse parses an HTTP response from a DecisionsV1DecisionsPostWithResponse call

func (DecisionsV1DecisionsPostResponse) ContentType

func (r DecisionsV1DecisionsPostResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DecisionsV1DecisionsPostResponse) GetBody

func (r DecisionsV1DecisionsPostResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DecisionsV1DecisionsPostResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DecisionsV1DecisionsPostResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (DecisionsV1DecisionsPostResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (DecisionsV1DecisionsPostResponse) GetJSON413

GetJSON413 returns the response for an HTTP 413 `application/json` response

func (DecisionsV1DecisionsPostResponse) GetJSON429

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (DecisionsV1DecisionsPostResponse) Status

Status returns HTTPResponse.Status

func (DecisionsV1DecisionsPostResponse) StatusCode

func (r DecisionsV1DecisionsPostResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DecisionsV1DecisionsPostResponse200Headers

type DecisionsV1DecisionsPostResponse200Headers struct {
	XRatelimitLimit     *int
	XRatelimitRemaining *int
	XRatelimitReset     *int
	XRatelimitUsed      *int
	XRequestId          *openapi_types.UUID
}

DecisionsV1DecisionsPostResponse200Headers the declared response headers of an HTTP 200 response for DecisionsV1DecisionsPost

type DecisionsV1DecisionsPostResponse400Headers

type DecisionsV1DecisionsPostResponse400Headers struct {
	XRequestId *openapi_types.UUID
}

DecisionsV1DecisionsPostResponse400Headers the declared response headers of an HTTP 400 response for DecisionsV1DecisionsPost

type DecisionsV1DecisionsPostResponse405Headers

type DecisionsV1DecisionsPostResponse405Headers struct {
	Allow      *string
	XRequestId *openapi_types.UUID
}

DecisionsV1DecisionsPostResponse405Headers the declared response headers of an HTTP 405 response for DecisionsV1DecisionsPost

type DecisionsV1DecisionsPostResponse413Headers

type DecisionsV1DecisionsPostResponse413Headers struct {
	XRequestId *openapi_types.UUID
}

DecisionsV1DecisionsPostResponse413Headers the declared response headers of an HTTP 413 response for DecisionsV1DecisionsPost

type DecisionsV1DecisionsPostResponse429Headers

type DecisionsV1DecisionsPostResponse429Headers struct {
	RetryAfter *int
	XRequestId *openapi_types.UUID
}

DecisionsV1DecisionsPostResponse429Headers the declared response headers of an HTTP 429 response for DecisionsV1DecisionsPost

type DeleteFileResponse added in v0.2.0

type DeleteFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *BatchFileDeleted
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
}

func ParseDeleteFileResponse added in v0.2.0

func ParseDeleteFileResponse(rsp *http.Response) (*DeleteFileResponse, error)

ParseDeleteFileResponse parses an HTTP response from a DeleteFileWithResponse call

func (DeleteFileResponse) ContentType added in v0.2.0

func (r DeleteFileResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteFileResponse) GetBody added in v0.2.0

func (r DeleteFileResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteFileResponse) GetJSON200 added in v0.2.0

func (r DeleteFileResponse) GetJSON200() *BatchFileDeleted

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DeleteFileResponse) GetJSON404 added in v0.2.0

func (r DeleteFileResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DeleteFileResponse) Status added in v0.2.0

func (r DeleteFileResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteFileResponse) StatusCode added in v0.2.0

func (r DeleteFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteSkillParams

type DeleteSkillParams struct {
	// ExpectedRevision Opaque revision token the skill must currently be at. The write applies
	// only if it matches, so it cannot race a concurrent update.
	ExpectedRevision ExpectedRevisionRequired `form:"expected_revision" json:"expected_revision"`
}

DeleteSkillParams defines parameters for DeleteSkill.

type DeleteSkillResponse

type DeleteSkillResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
	// JSON409 the response for an HTTP 409 `application/json` response
	JSON409 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
	// JSON502 the response for an HTTP 502 `application/json` response
	JSON502 *ApiError
}

func ParseDeleteSkillResponse

func ParseDeleteSkillResponse(rsp *http.Response) (*DeleteSkillResponse, error)

ParseDeleteSkillResponse parses an HTTP response from a DeleteSkillWithResponse call

func (DeleteSkillResponse) ContentType

func (r DeleteSkillResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DeleteSkillResponse) GetBody

func (r DeleteSkillResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DeleteSkillResponse) GetJSON400

func (r DeleteSkillResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (DeleteSkillResponse) GetJSON404

func (r DeleteSkillResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DeleteSkillResponse) GetJSON409

func (r DeleteSkillResponse) GetJSON409() *ApiError

GetJSON409 returns the response for an HTTP 409 `application/json` response

func (DeleteSkillResponse) GetJSON429

func (r DeleteSkillResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (DeleteSkillResponse) GetJSON502

func (r DeleteSkillResponse) GetJSON502() *ApiError

GetJSON502 returns the response for an HTTP 502 `application/json` response

func (DeleteSkillResponse) Status

func (r DeleteSkillResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteSkillResponse) StatusCode

func (r DeleteSkillResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DownloadAgentFileResponse

type DownloadAgentFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *struct {
		// Error Error information returned when a request fails
		Error *ErrorInfo `json:"error,omitempty"`
	}
}

func ParseDownloadAgentFileResponse

func ParseDownloadAgentFileResponse(rsp *http.Response) (*DownloadAgentFileResponse, error)

ParseDownloadAgentFileResponse parses an HTTP response from a DownloadAgentFileWithResponse call

func (DownloadAgentFileResponse) ContentType

func (r DownloadAgentFileResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DownloadAgentFileResponse) GetBody

func (r DownloadAgentFileResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DownloadAgentFileResponse) GetJSON404

func (r DownloadAgentFileResponse) GetJSON404() *struct {
	// Error Error information returned when a request fails
	Error *ErrorInfo `json:"error,omitempty"`
}

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DownloadAgentFileResponse) Status

func (r DownloadAgentFileResponse) Status() string

Status returns HTTPResponse.Status

func (DownloadAgentFileResponse) StatusCode

func (r DownloadAgentFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DownloadSkillParams

type DownloadSkillParams struct {
	// Revision Opaque revision token; when omitted, the active revision is used
	Revision *Revision `form:"revision,omitempty" json:"revision,omitempty"`
}

DownloadSkillParams defines parameters for DownloadSkill.

type DownloadSkillResponse

type DownloadSkillResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *SkillDownload
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
	// JSON502 the response for an HTTP 502 `application/json` response
	JSON502 *ApiError
}

func ParseDownloadSkillResponse

func ParseDownloadSkillResponse(rsp *http.Response) (*DownloadSkillResponse, error)

ParseDownloadSkillResponse parses an HTTP response from a DownloadSkillWithResponse call

func (DownloadSkillResponse) ContentType

func (r DownloadSkillResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (DownloadSkillResponse) GetBody

func (r DownloadSkillResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (DownloadSkillResponse) GetJSON200

func (r DownloadSkillResponse) GetJSON200() *SkillDownload

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (DownloadSkillResponse) GetJSON400

func (r DownloadSkillResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (DownloadSkillResponse) GetJSON404

func (r DownloadSkillResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (DownloadSkillResponse) GetJSON429

func (r DownloadSkillResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (DownloadSkillResponse) GetJSON502

func (r DownloadSkillResponse) GetJSON502() *ApiError

GetJSON502 returns the response for an HTTP 502 `application/json` response

func (DownloadSkillResponse) Status

func (r DownloadSkillResponse) Status() string

Status returns HTTPResponse.Status

func (DownloadSkillResponse) StatusCode

func (r DownloadSkillResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type EmbeddingObject

type EmbeddingObject struct {
	// Embedding Base64-encoded embedding vector. For base64_int8: decode to signed int8 array (length = dimensions). For base64_binary: decode to packed bits (length = dimensions / 8 bytes).
	Embedding *string `json:"embedding,omitempty"`

	// Index The index of the input text this embedding corresponds to
	Index *int `json:"index,omitempty"`

	// Object The object type
	Object *string `json:"object,omitempty"`
}

EmbeddingObject A single embedding result

type EmbeddingsRequest

type EmbeddingsRequest struct {
	// Dimensions Number of dimensions for output embeddings (Matryoshka). Range: 128-1024 for pplx-embed-v1-0.6b, 128-2560 for pplx-embed-v1-4b. Defaults to full dimensions (1024 or 2560).
	Dimensions *int `json:"dimensions,omitempty"`

	// EncodingFormat Output encoding format for embeddings. base64_int8 returns base64-encoded signed int8 values. base64_binary returns base64-encoded packed binary (1 bit per dimension).
	EncodingFormat *EmbeddingsRequestEncodingFormat `json:"encoding_format,omitempty"`

	// Input Input text to embed, encoded as a string or array of strings. Maximum 512 texts per request. Each input must not exceed 32K tokens. All inputs in a single request must not exceed 120,000 tokens combined. Empty strings are not allowed.
	Input EmbeddingsRequest_Input `json:"input"`

	// Model The embedding model to use
	Model EmbeddingsRequestModel `json:"model"`
}

EmbeddingsRequest Request body for creating embeddings

type EmbeddingsRequestEncodingFormat

type EmbeddingsRequestEncodingFormat string

EmbeddingsRequestEncodingFormat Output encoding format for embeddings. base64_int8 returns base64-encoded signed int8 values. base64_binary returns base64-encoded packed binary (1 bit per dimension).

const (
	EmbeddingsRequestEncodingFormatBase64Binary EmbeddingsRequestEncodingFormat = "base64_binary"
	EmbeddingsRequestEncodingFormatBase64Int8   EmbeddingsRequestEncodingFormat = "base64_int8"
)

Defines values for EmbeddingsRequestEncodingFormat.

func (EmbeddingsRequestEncodingFormat) Valid

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

type EmbeddingsRequestInput0

type EmbeddingsRequestInput0 = string

EmbeddingsRequestInput0 defines model for EmbeddingsRequest.Input.0.

type EmbeddingsRequestInput1

type EmbeddingsRequestInput1 = []string

EmbeddingsRequestInput1 defines model for EmbeddingsRequest.Input.1.

type EmbeddingsRequestModel

type EmbeddingsRequestModel string

EmbeddingsRequestModel The embedding model to use

const (
	EmbeddingsRequestModelPplxEmbedV106b EmbeddingsRequestModel = "pplx-embed-v1-0.6b"
	EmbeddingsRequestModelPplxEmbedV14b  EmbeddingsRequestModel = "pplx-embed-v1-4b"
)

Defines values for EmbeddingsRequestModel.

func (EmbeddingsRequestModel) Valid

func (e EmbeddingsRequestModel) Valid() bool

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

type EmbeddingsRequest_Input

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

EmbeddingsRequest_Input Input text to embed, encoded as a string or array of strings. Maximum 512 texts per request. Each input must not exceed 32K tokens. All inputs in a single request must not exceed 120,000 tokens combined. Empty strings are not allowed.

func (EmbeddingsRequest_Input) AsEmbeddingsRequestInput0

func (t EmbeddingsRequest_Input) AsEmbeddingsRequestInput0() (EmbeddingsRequestInput0, error)

AsEmbeddingsRequestInput0 returns the union data inside the EmbeddingsRequest_Input as a EmbeddingsRequestInput0

func (EmbeddingsRequest_Input) AsEmbeddingsRequestInput1

func (t EmbeddingsRequest_Input) AsEmbeddingsRequestInput1() (EmbeddingsRequestInput1, error)

AsEmbeddingsRequestInput1 returns the union data inside the EmbeddingsRequest_Input as a EmbeddingsRequestInput1

func (*EmbeddingsRequest_Input) FromEmbeddingsRequestInput0

func (t *EmbeddingsRequest_Input) FromEmbeddingsRequestInput0(v EmbeddingsRequestInput0) error

FromEmbeddingsRequestInput0 overwrites any union data inside the EmbeddingsRequest_Input as the provided EmbeddingsRequestInput0

func (*EmbeddingsRequest_Input) FromEmbeddingsRequestInput1

func (t *EmbeddingsRequest_Input) FromEmbeddingsRequestInput1(v EmbeddingsRequestInput1) error

FromEmbeddingsRequestInput1 overwrites any union data inside the EmbeddingsRequest_Input as the provided EmbeddingsRequestInput1

func (EmbeddingsRequest_Input) MarshalJSON

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

func (*EmbeddingsRequest_Input) MergeEmbeddingsRequestInput0

func (t *EmbeddingsRequest_Input) MergeEmbeddingsRequestInput0(v EmbeddingsRequestInput0) error

MergeEmbeddingsRequestInput0 performs a merge with any union data inside the EmbeddingsRequest_Input, using the provided EmbeddingsRequestInput0

func (*EmbeddingsRequest_Input) MergeEmbeddingsRequestInput1

func (t *EmbeddingsRequest_Input) MergeEmbeddingsRequestInput1(v EmbeddingsRequestInput1) error

MergeEmbeddingsRequestInput1 performs a merge with any union data inside the EmbeddingsRequest_Input, using the provided EmbeddingsRequestInput1

func (*EmbeddingsRequest_Input) UnmarshalJSON

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

type EmbeddingsResponse

type EmbeddingsResponse struct {
	// Data List of embedding objects
	Data *[]EmbeddingObject `json:"data,omitempty"`

	// Model The model used to generate embeddings
	Model *string `json:"model,omitempty"`

	// Object The object type
	Object *string `json:"object,omitempty"`

	// Usage Token usage for the embeddings request
	Usage *EmbeddingsUsage `json:"usage,omitempty"`
}

EmbeddingsResponse Response body for embeddings request

type EmbeddingsUsage

type EmbeddingsUsage struct {
	// Cost Cost breakdown for the request
	Cost *struct {
		// Currency Currency of the cost values
		Currency *EmbeddingsUsageCostCurrency `json:"currency,omitempty"`

		// InputCost Cost for input tokens in USD
		InputCost *float64 `json:"input_cost,omitempty"`

		// TotalCost Total cost for the request in USD
		TotalCost *float64 `json:"total_cost,omitempty"`
	} `json:"cost,omitempty"`

	// PromptTokens Number of tokens in the input texts
	PromptTokens *int `json:"prompt_tokens,omitempty"`

	// TotalTokens Total number of tokens processed
	TotalTokens *int `json:"total_tokens,omitempty"`
}

EmbeddingsUsage Token usage for the embeddings request

type EmbeddingsUsageCostCurrency

type EmbeddingsUsageCostCurrency string

EmbeddingsUsageCostCurrency Currency of the cost values

const (
	EmbeddingsUsageCostCurrencyUSD EmbeddingsUsageCostCurrency = "USD"
)

Defines values for EmbeddingsUsageCostCurrency.

func (EmbeddingsUsageCostCurrency) Valid

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

type EmbeddingsV1EmbeddingsPostJSONRequestBody

type EmbeddingsV1EmbeddingsPostJSONRequestBody = EmbeddingsRequest

EmbeddingsV1EmbeddingsPostJSONRequestBody defines body for EmbeddingsV1EmbeddingsPost for application/json ContentType.

type EmbeddingsV1EmbeddingsPostResponse

type EmbeddingsV1EmbeddingsPostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *EmbeddingsResponse
	// JSON422 the response for an HTTP 422 `application/json` response
	JSON422 *HTTPValidationError
}

func ParseEmbeddingsV1EmbeddingsPostResponse

func ParseEmbeddingsV1EmbeddingsPostResponse(rsp *http.Response) (*EmbeddingsV1EmbeddingsPostResponse, error)

ParseEmbeddingsV1EmbeddingsPostResponse parses an HTTP response from a EmbeddingsV1EmbeddingsPostWithResponse call

func (EmbeddingsV1EmbeddingsPostResponse) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (EmbeddingsV1EmbeddingsPostResponse) GetBody

GetBody returns the raw response body bytes

func (EmbeddingsV1EmbeddingsPostResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (EmbeddingsV1EmbeddingsPostResponse) GetJSON422

GetJSON422 returns the response for an HTTP 422 `application/json` response

func (EmbeddingsV1EmbeddingsPostResponse) Status

Status returns HTTPResponse.Status

func (EmbeddingsV1EmbeddingsPostResponse) StatusCode

func (r EmbeddingsV1EmbeddingsPostResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Error

type Error struct {
	// Code A status code as a string or a number, or `null`. Do not branch on it; use the HTTP status.
	Code *Error_Code `json:"code,omitempty"`

	// Message What went wrong.
	Message string `json:"message"`

	// Param Present on some errors; `null` when present.
	Param *string `json:"param,omitempty"`

	// Type The error category, for example `invalid_request_error`, `invalid_request`, `invalid_api_key`, or `too_many_requests`.
	Type string `json:"type"`
}

Error Details of the error.

type ErrorCode0

type ErrorCode0 = string

ErrorCode0 defines model for Error.Code.0.

type ErrorCode1

type ErrorCode1 = int

ErrorCode1 defines model for Error.Code.1.

type ErrorInfo

type ErrorInfo struct {
	// Code Error code
	Code *string `json:"code,omitempty"`

	// Message Human-readable error message
	Message string `json:"message"`

	// Type Error type category
	Type *string `json:"type,omitempty"`
}

ErrorInfo Error information returned when a request fails

type ErrorResponse

type ErrorResponse struct {
	// Error Details of the error.
	Error Error `json:"error"`
}

ErrorResponse The body of an error response.

type Error_Code

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

Error_Code A status code as a string or a number, or `null`. Do not branch on it; use the HTTP status.

func (Error_Code) AsErrorCode0

func (t Error_Code) AsErrorCode0() (ErrorCode0, error)

AsErrorCode0 returns the union data inside the Error_Code as a ErrorCode0

func (Error_Code) AsErrorCode1

func (t Error_Code) AsErrorCode1() (ErrorCode1, error)

AsErrorCode1 returns the union data inside the Error_Code as a ErrorCode1

func (*Error_Code) FromErrorCode0

func (t *Error_Code) FromErrorCode0(v ErrorCode0) error

FromErrorCode0 overwrites any union data inside the Error_Code as the provided ErrorCode0

func (*Error_Code) FromErrorCode1

func (t *Error_Code) FromErrorCode1(v ErrorCode1) error

FromErrorCode1 overwrites any union data inside the Error_Code as the provided ErrorCode1

func (Error_Code) MarshalJSON

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

func (*Error_Code) MergeErrorCode0

func (t *Error_Code) MergeErrorCode0(v ErrorCode0) error

MergeErrorCode0 performs a merge with any union data inside the Error_Code, using the provided ErrorCode0

func (*Error_Code) MergeErrorCode1

func (t *Error_Code) MergeErrorCode1(v ErrorCode1) error

MergeErrorCode1 performs a merge with any union data inside the Error_Code, using the provided ErrorCode1

func (*Error_Code) UnmarshalJSON

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

type EventType

type EventType string

EventType SSE event type discriminator

const (
	EventTypeResponseCompleted                   EventType = "response.completed"
	EventTypeResponseCreated                     EventType = "response.created"
	EventTypeResponseFailed                      EventType = "response.failed"
	EventTypeResponseInProgress                  EventType = "response.in_progress"
	EventTypeResponseOutputItemAdded             EventType = "response.output_item.added"
	EventTypeResponseOutputItemDone              EventType = "response.output_item.done"
	EventTypeResponseOutputTextDelta             EventType = "response.output_text.delta"
	EventTypeResponseOutputTextDone              EventType = "response.output_text.done"
	EventTypeResponseReasoningFetchUrlQueries    EventType = "response.reasoning.fetch_url_queries"
	EventTypeResponseReasoningFetchUrlResults    EventType = "response.reasoning.fetch_url_results"
	EventTypeResponseReasoningImageSearchQueries EventType = "response.reasoning.image_search_queries"
	EventTypeResponseReasoningImageSearchResults EventType = "response.reasoning.image_search_results"
	EventTypeResponseReasoningSearchQueries      EventType = "response.reasoning.search_queries"
	EventTypeResponseReasoningSearchResults      EventType = "response.reasoning.search_results"
	EventTypeResponseReasoningStarted            EventType = "response.reasoning.started"
	EventTypeResponseReasoningStopped            EventType = "response.reasoning.stopped"
)

Defines values for EventType.

func (EventType) Valid

func (e EventType) Valid() bool

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

type ExpectedRevisionRequired

type ExpectedRevisionRequired = string

ExpectedRevisionRequired defines model for ExpectedRevisionRequired.

type FetchUrlQueriesEvent

type FetchUrlQueriesEvent struct {
	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64   `json:"sequence_number"`
	Thought        *string `json:"thought,omitempty"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
	Urls []string  `json:"urls"`
}

FetchUrlQueriesEvent URL fetch queries event (type: "response.reasoning.fetch_url_queries"). Contains URLs being fetched.

type FetchUrlResultsEvent

type FetchUrlResultsEvent struct {
	Contents []UrlContent `json:"contents"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64   `json:"sequence_number"`
	Thought        *string `json:"thought,omitempty"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

FetchUrlResultsEvent URL fetch results event (type: "response.reasoning.fetch_url_results"). Contains fetched URL contents.

type FetchUrlResultsOutputItem

type FetchUrlResultsOutputItem struct {
	Contents []UrlContent                  `json:"contents"`
	Type     FetchUrlResultsOutputItemType `json:"type"`
}

FetchUrlResultsOutputItem defines model for FetchUrlResultsOutputItem.

type FetchUrlResultsOutputItemType

type FetchUrlResultsOutputItemType string

FetchUrlResultsOutputItemType defines model for FetchUrlResultsOutputItem.Type.

const (
	FetchUrlResultsOutputItemTypeFetchUrlResults FetchUrlResultsOutputItemType = "fetch_url_results"
)

Defines values for FetchUrlResultsOutputItemType.

func (FetchUrlResultsOutputItemType) Valid

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

type FetchUrlTool

type FetchUrlTool struct {
	// MaxUrls Maximum number of URLs to fetch per tool call
	MaxUrls *int32           `json:"max_urls,omitempty"`
	Type    FetchUrlToolType `json:"type"`
}

FetchUrlTool defines model for FetchUrlTool.

type FetchUrlToolType

type FetchUrlToolType string

FetchUrlToolType defines model for FetchUrlTool.Type.

const (
	FetchUrlToolTypeFetchUrl FetchUrlToolType = "fetch_url"
)

Defines values for FetchUrlToolType.

func (FetchUrlToolType) Valid

func (e FetchUrlToolType) Valid() bool

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

type FinanceResult

type FinanceResult struct {
	// Category Finance category this result belongs to (for example, "quote").
	Category string `json:"category"`

	// Content Structured content for the result, typically a markdown-formatted table or snippet.
	Content string `json:"content"`

	// Sources Source URLs backing the structured content.
	Sources *[]string `json:"sources,omitempty"`

	// Tickers Ticker symbols this result pertains to.
	Tickers *[]string `json:"tickers,omitempty"`
}

FinanceResult A single structured finance result returned by the finance_search tool.

type FinanceResultsOutputItem

type FinanceResultsOutputItem struct {
	// Categories Finance categories the tool was asked to retrieve for this invocation (for example, "quote").
	Categories *[]string `json:"categories,omitempty"`

	// Results Structured finance results returned for the invocation.
	Results []FinanceResult `json:"results"`

	// Tickers Ticker symbols the tool was asked to retrieve for this invocation.
	Tickers *[]string                    `json:"tickers,omitempty"`
	Type    FinanceResultsOutputItemType `json:"type"`
}

FinanceResultsOutputItem Intermediate output item emitted when the finance_search tool runs. One item is emitted per tool invocation; the requested categories and tickers are echoed at the envelope level alongside the per-result entries.

type FinanceResultsOutputItemType

type FinanceResultsOutputItemType string

FinanceResultsOutputItemType defines model for FinanceResultsOutputItem.Type.

const (
	FinanceResultsOutputItemTypeFinanceResults FinanceResultsOutputItemType = "finance_results"
)

Defines values for FinanceResultsOutputItemType.

func (FinanceResultsOutputItemType) Valid

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

type FinanceSearchTool

type FinanceSearchTool struct {
	// Type Tool type identifier
	Type FinanceSearchToolType `json:"type"`
}

FinanceSearchTool Finance search tool configuration for the Agent API

type FinanceSearchToolType

type FinanceSearchToolType string

FinanceSearchToolType Tool type identifier

const (
	FinanceSearchToolTypeFinanceSearch FinanceSearchToolType = "finance_search"
)

Defines values for FinanceSearchToolType.

func (FinanceSearchToolType) Valid

func (e FinanceSearchToolType) Valid() bool

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

type FunctionCallInput

type FunctionCallInput struct {
	// Arguments Function arguments (JSON string)
	Arguments string `json:"arguments"`

	// CallId The call_id that correlates with function_call_output
	CallId string `json:"call_id"`

	// Name The function name
	Name string `json:"name"`

	// ThoughtSignature Base64-encoded signature for thinking models
	ThoughtSignature *string               `json:"thought_signature,omitempty"`
	Type             FunctionCallInputType `json:"type"`
}

FunctionCallInput defines model for FunctionCallInput.

type FunctionCallInputType

type FunctionCallInputType string

FunctionCallInputType defines model for FunctionCallInput.Type.

const (
	FunctionCallInputTypeFunctionCall FunctionCallInputType = "function_call"
)

Defines values for FunctionCallInputType.

func (FunctionCallInputType) Valid

func (e FunctionCallInputType) Valid() bool

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

type FunctionCallOutputImagePart

type FunctionCallOutputImagePart struct {
	// Detail Accepted for OpenAI replay compatibility; native tool-result forwarding ignores this hint.
	Detail *FunctionCallOutputImagePartDetail `json:"detail,omitempty"`

	// ImageUrl A fully qualified HTTP(S) URL or base64 image data URI.
	ImageUrl string                          `json:"image_url"`
	Type     FunctionCallOutputImagePartType `json:"type"`
}

FunctionCallOutputImagePart defines model for FunctionCallOutputImagePart.

type FunctionCallOutputImagePartDetail

type FunctionCallOutputImagePartDetail string

FunctionCallOutputImagePartDetail Accepted for OpenAI replay compatibility; native tool-result forwarding ignores this hint.

const (
	FunctionCallOutputImagePartDetailAuto FunctionCallOutputImagePartDetail = "auto"
	FunctionCallOutputImagePartDetailHigh FunctionCallOutputImagePartDetail = "high"
	FunctionCallOutputImagePartDetailLow  FunctionCallOutputImagePartDetail = "low"
)

Defines values for FunctionCallOutputImagePartDetail.

func (FunctionCallOutputImagePartDetail) Valid

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

type FunctionCallOutputImagePartType

type FunctionCallOutputImagePartType string

FunctionCallOutputImagePartType defines model for FunctionCallOutputImagePart.Type.

const (
	FunctionCallOutputImagePartTypeInputImage FunctionCallOutputImagePartType = "input_image"
)

Defines values for FunctionCallOutputImagePartType.

func (FunctionCallOutputImagePartType) Valid

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

type FunctionCallOutputInput

type FunctionCallOutputInput struct {
	// CallId The call_id from function_call output
	CallId string `json:"call_id"`

	// Id Replay metadata populated when this item was returned by the API.
	Id *string `json:"id,omitempty"`

	// Name Function name (required by some providers)
	Name *string `json:"name,omitempty"`

	// Output Function result as a JSON string or an array of input_text and input_image content parts.
	Output FunctionCallOutputInput_Output `json:"output"`

	// Status Replay metadata populated when this item was returned by the API.
	Status *FunctionCallOutputInputStatus `json:"status,omitempty"`

	// ThoughtSignature Base64-encoded signature from function_call
	ThoughtSignature *string                     `json:"thought_signature,omitempty"`
	Type             FunctionCallOutputInputType `json:"type"`
}

FunctionCallOutputInput defines model for FunctionCallOutputInput.

type FunctionCallOutputInputOutput0

type FunctionCallOutputInputOutput0 = string

FunctionCallOutputInputOutput0 defines model for FunctionCallOutputInput.Output.0.

type FunctionCallOutputInputOutput1

type FunctionCallOutputInputOutput1 = []FunctionCallOutputInput_Output_1_Item

FunctionCallOutputInputOutput1 defines model for FunctionCallOutputInput.Output.1.

type FunctionCallOutputInputStatus

type FunctionCallOutputInputStatus string

FunctionCallOutputInputStatus Replay metadata populated when this item was returned by the API.

const (
	FunctionCallOutputInputStatusCompleted  FunctionCallOutputInputStatus = "completed"
	FunctionCallOutputInputStatusInProgress FunctionCallOutputInputStatus = "in_progress"
	FunctionCallOutputInputStatusIncomplete FunctionCallOutputInputStatus = "incomplete"
)

Defines values for FunctionCallOutputInputStatus.

func (FunctionCallOutputInputStatus) Valid

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

type FunctionCallOutputInputType

type FunctionCallOutputInputType string

FunctionCallOutputInputType defines model for FunctionCallOutputInput.Type.

const (
	FunctionCallOutputInputTypeFunctionCallOutput FunctionCallOutputInputType = "function_call_output"
)

Defines values for FunctionCallOutputInputType.

func (FunctionCallOutputInputType) Valid

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

type FunctionCallOutputInput_Output

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

FunctionCallOutputInput_Output Function result as a JSON string or an array of input_text and input_image content parts.

func (FunctionCallOutputInput_Output) AsFunctionCallOutputInputOutput0

func (t FunctionCallOutputInput_Output) AsFunctionCallOutputInputOutput0() (FunctionCallOutputInputOutput0, error)

AsFunctionCallOutputInputOutput0 returns the union data inside the FunctionCallOutputInput_Output as a FunctionCallOutputInputOutput0

func (FunctionCallOutputInput_Output) AsFunctionCallOutputInputOutput1

func (t FunctionCallOutputInput_Output) AsFunctionCallOutputInputOutput1() (FunctionCallOutputInputOutput1, error)

AsFunctionCallOutputInputOutput1 returns the union data inside the FunctionCallOutputInput_Output as a FunctionCallOutputInputOutput1

func (*FunctionCallOutputInput_Output) FromFunctionCallOutputInputOutput0

func (t *FunctionCallOutputInput_Output) FromFunctionCallOutputInputOutput0(v FunctionCallOutputInputOutput0) error

FromFunctionCallOutputInputOutput0 overwrites any union data inside the FunctionCallOutputInput_Output as the provided FunctionCallOutputInputOutput0

func (*FunctionCallOutputInput_Output) FromFunctionCallOutputInputOutput1

func (t *FunctionCallOutputInput_Output) FromFunctionCallOutputInputOutput1(v FunctionCallOutputInputOutput1) error

FromFunctionCallOutputInputOutput1 overwrites any union data inside the FunctionCallOutputInput_Output as the provided FunctionCallOutputInputOutput1

func (FunctionCallOutputInput_Output) MarshalJSON

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

func (*FunctionCallOutputInput_Output) MergeFunctionCallOutputInputOutput0

func (t *FunctionCallOutputInput_Output) MergeFunctionCallOutputInputOutput0(v FunctionCallOutputInputOutput0) error

MergeFunctionCallOutputInputOutput0 performs a merge with any union data inside the FunctionCallOutputInput_Output, using the provided FunctionCallOutputInputOutput0

func (*FunctionCallOutputInput_Output) MergeFunctionCallOutputInputOutput1

func (t *FunctionCallOutputInput_Output) MergeFunctionCallOutputInputOutput1(v FunctionCallOutputInputOutput1) error

MergeFunctionCallOutputInputOutput1 performs a merge with any union data inside the FunctionCallOutputInput_Output, using the provided FunctionCallOutputInputOutput1

func (*FunctionCallOutputInput_Output) UnmarshalJSON

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

type FunctionCallOutputInput_Output_1_Item

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

FunctionCallOutputInput_Output_1_Item defines model for FunctionCallOutputInput.Output.1.Item.

func (FunctionCallOutputInput_Output_1_Item) AsFunctionCallOutputImagePart

func (t FunctionCallOutputInput_Output_1_Item) AsFunctionCallOutputImagePart() (FunctionCallOutputImagePart, error)

AsFunctionCallOutputImagePart returns the union data inside the FunctionCallOutputInput_Output_1_Item as a FunctionCallOutputImagePart

func (FunctionCallOutputInput_Output_1_Item) AsFunctionCallOutputTextPart

func (t FunctionCallOutputInput_Output_1_Item) AsFunctionCallOutputTextPart() (FunctionCallOutputTextPart, error)

AsFunctionCallOutputTextPart returns the union data inside the FunctionCallOutputInput_Output_1_Item as a FunctionCallOutputTextPart

func (FunctionCallOutputInput_Output_1_Item) Discriminator

func (t FunctionCallOutputInput_Output_1_Item) Discriminator() (string, error)

func (*FunctionCallOutputInput_Output_1_Item) FromFunctionCallOutputImagePart

func (t *FunctionCallOutputInput_Output_1_Item) FromFunctionCallOutputImagePart(v FunctionCallOutputImagePart) error

FromFunctionCallOutputImagePart overwrites any union data inside the FunctionCallOutputInput_Output_1_Item as the provided FunctionCallOutputImagePart

func (*FunctionCallOutputInput_Output_1_Item) FromFunctionCallOutputTextPart

func (t *FunctionCallOutputInput_Output_1_Item) FromFunctionCallOutputTextPart(v FunctionCallOutputTextPart) error

FromFunctionCallOutputTextPart overwrites any union data inside the FunctionCallOutputInput_Output_1_Item as the provided FunctionCallOutputTextPart

func (FunctionCallOutputInput_Output_1_Item) MarshalJSON

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

func (*FunctionCallOutputInput_Output_1_Item) MergeFunctionCallOutputImagePart

func (t *FunctionCallOutputInput_Output_1_Item) MergeFunctionCallOutputImagePart(v FunctionCallOutputImagePart) error

MergeFunctionCallOutputImagePart performs a merge with any union data inside the FunctionCallOutputInput_Output_1_Item, using the provided FunctionCallOutputImagePart

func (*FunctionCallOutputInput_Output_1_Item) MergeFunctionCallOutputTextPart

func (t *FunctionCallOutputInput_Output_1_Item) MergeFunctionCallOutputTextPart(v FunctionCallOutputTextPart) error

MergeFunctionCallOutputTextPart performs a merge with any union data inside the FunctionCallOutputInput_Output_1_Item, using the provided FunctionCallOutputTextPart

func (*FunctionCallOutputInput_Output_1_Item) UnmarshalJSON

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

func (FunctionCallOutputInput_Output_1_Item) ValueByDiscriminator

func (t FunctionCallOutputInput_Output_1_Item) ValueByDiscriminator() (interface{}, error)

type FunctionCallOutputItem

type FunctionCallOutputItem struct {
	// Arguments JSON string of arguments
	Arguments string `json:"arguments"`

	// CallId Correlates with function_call_output input
	CallId string `json:"call_id"`
	Id     string `json:"id"`
	Name   string `json:"name"`

	// Status Status of a response or output item
	Status Status `json:"status"`

	// ThoughtSignature Base64-encoded opaque signature for thinking models
	ThoughtSignature *string                    `json:"thought_signature,omitempty"`
	Type             FunctionCallOutputItemType `json:"type"`
}

FunctionCallOutputItem defines model for FunctionCallOutputItem.

type FunctionCallOutputItemType

type FunctionCallOutputItemType string

FunctionCallOutputItemType defines model for FunctionCallOutputItem.Type.

const (
	FunctionCallOutputItemTypeFunctionCall FunctionCallOutputItemType = "function_call"
)

Defines values for FunctionCallOutputItemType.

func (FunctionCallOutputItemType) Valid

func (e FunctionCallOutputItemType) Valid() bool

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

type FunctionCallOutputTextPart

type FunctionCallOutputTextPart struct {
	Text string                         `json:"text"`
	Type FunctionCallOutputTextPartType `json:"type"`
}

FunctionCallOutputTextPart defines model for FunctionCallOutputTextPart.

type FunctionCallOutputTextPartType

type FunctionCallOutputTextPartType string

FunctionCallOutputTextPartType defines model for FunctionCallOutputTextPart.Type.

const (
	FunctionCallOutputTextPartTypeInputText FunctionCallOutputTextPartType = "input_text"
)

Defines values for FunctionCallOutputTextPartType.

func (FunctionCallOutputTextPartType) Valid

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

type FunctionTool

type FunctionTool struct {
	// Description A description of what the function does
	Description *string `json:"description,omitempty"`

	// Name The name of the function
	Name string `json:"name"`

	// Parameters JSON Schema defining the function's parameters
	Parameters *map[string]interface{} `json:"parameters,omitempty"`

	// Strict Whether to enable strict schema validation
	Strict *bool            `json:"strict,omitempty"`
	Type   FunctionToolType `json:"type"`
}

FunctionTool defines model for FunctionTool.

type FunctionToolType

type FunctionToolType string

FunctionToolType defines model for FunctionTool.Type.

const (
	FunctionToolTypeFunction FunctionToolType = "function"
)

Defines values for FunctionToolType.

func (FunctionToolType) Valid

func (e FunctionToolType) Valid() bool

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

type GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse

type GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *AsyncApiChatCompletionsResponse
	// JSON422 the response for an HTTP 422 `application/json` response
	JSON422 *HTTPValidationError
}

func ParseGetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse

func ParseGetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse(rsp *http.Response) (*GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse, error)

ParseGetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse parses an HTTP response from a GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetWithResponse call

func (GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse) GetBody

GetBody returns the raw response body bytes

func (GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse) GetJSON422

GetJSON422 returns the response for an HTTP 422 `application/json` response

func (GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse) Status

Status returns HTTPResponse.Status

func (GetAsyncChatCompletionResponseAsyncChatCompletionsApiRequestGetResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetBatchResponse added in v0.2.0

type GetBatchResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Batch
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
}

func ParseGetBatchResponse added in v0.2.0

func ParseGetBatchResponse(rsp *http.Response) (*GetBatchResponse, error)

ParseGetBatchResponse parses an HTTP response from a GetBatchWithResponse call

func (GetBatchResponse) ContentType added in v0.2.0

func (r GetBatchResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetBatchResponse) GetBody added in v0.2.0

func (r GetBatchResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetBatchResponse) GetJSON200 added in v0.2.0

func (r GetBatchResponse) GetJSON200() *Batch

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetBatchResponse) GetJSON404 added in v0.2.0

func (r GetBatchResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetBatchResponse) GetJSON429 added in v0.2.0

func (r GetBatchResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (GetBatchResponse) Status added in v0.2.0

func (r GetBatchResponse) Status() string

Status returns HTTPResponse.Status

func (GetBatchResponse) StatusCode added in v0.2.0

func (r GetBatchResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetComputerUsageAnalyticsParams

type GetComputerUsageAnalyticsParams struct {
	// Dataset The dataset to query. query_volume and daily_active_users are daily organization-level datasets: they reject bucket_width=1h and user_email.
	Dataset GetComputerUsageAnalyticsParamsDataset `form:"dataset" json:"dataset"`

	// StartTime Window start in unix seconds (UTC), inclusive. Snapped down to the bucket grid, so the first bucket can include usage from before this time.
	StartTime int `form:"start_time" json:"start_time"`

	// EndTime Window end in unix seconds (UTC), exclusive. Defaults to now; future values are capped at now. The window may span at most 90 days.
	EndTime *int `form:"end_time,omitempty" json:"end_time,omitempty"`

	// BucketWidth Bucket size. Buckets align to the UTC grid. Not accepted as 1h for query_volume or daily_active_users, which are stored at day grain.
	BucketWidth *GetComputerUsageAnalyticsParamsBucketWidth `form:"bucket_width,omitempty" json:"bucket_width,omitempty"`

	// Limit Buckets per page. 1d: default 7, max 31. 1h: default 24, max 168.
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Page Opaque pagination cursor from a previous response's next_page. Valid only with the same query parameters it was issued for.
	Page *string `form:"page,omitempty" json:"page,omitempty"`

	// UserEmail Restrict results to a single member of your organization. Emails that don't match a current member return a generic 400. Not available for query_volume or daily_active_users, which are aggregated per organization; use the v2 endpoint for per-member query volume.
	UserEmail *openapi_types.Email `form:"user_email,omitempty" json:"user_email,omitempty"`
}

GetComputerUsageAnalyticsParams defines parameters for GetComputerUsageAnalytics.

type GetComputerUsageAnalyticsParamsBucketWidth

type GetComputerUsageAnalyticsParamsBucketWidth string

GetComputerUsageAnalyticsParamsBucketWidth defines parameters for GetComputerUsageAnalytics.

const (
	GetComputerUsageAnalyticsParamsBucketWidthN1d GetComputerUsageAnalyticsParamsBucketWidth = "1d"
	GetComputerUsageAnalyticsParamsBucketWidthN1h GetComputerUsageAnalyticsParamsBucketWidth = "1h"
)

Defines values for GetComputerUsageAnalyticsParamsBucketWidth.

func (GetComputerUsageAnalyticsParamsBucketWidth) Valid

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

type GetComputerUsageAnalyticsParamsDataset

type GetComputerUsageAnalyticsParamsDataset string

GetComputerUsageAnalyticsParamsDataset defines parameters for GetComputerUsageAnalytics.

const (
	GetComputerUsageAnalyticsParamsDatasetArtifacts        GetComputerUsageAnalyticsParamsDataset = "artifacts"
	GetComputerUsageAnalyticsParamsDatasetConnectors       GetComputerUsageAnalyticsParamsDataset = "connectors"
	GetComputerUsageAnalyticsParamsDatasetCreditUsage      GetComputerUsageAnalyticsParamsDataset = "credit_usage"
	GetComputerUsageAnalyticsParamsDatasetDailyActiveUsers GetComputerUsageAnalyticsParamsDataset = "daily_active_users"
	GetComputerUsageAnalyticsParamsDatasetQueryVolume      GetComputerUsageAnalyticsParamsDataset = "query_volume"
	GetComputerUsageAnalyticsParamsDatasetSkills           GetComputerUsageAnalyticsParamsDataset = "skills"
	GetComputerUsageAnalyticsParamsDatasetSpaces           GetComputerUsageAnalyticsParamsDataset = "spaces"
	GetComputerUsageAnalyticsParamsDatasetTaskDurations    GetComputerUsageAnalyticsParamsDataset = "task_durations"
	GetComputerUsageAnalyticsParamsDatasetWorkflows        GetComputerUsageAnalyticsParamsDataset = "workflows"
)

Defines values for GetComputerUsageAnalyticsParamsDataset.

func (GetComputerUsageAnalyticsParamsDataset) Valid

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

type GetComputerUsageAnalyticsResponse

type GetComputerUsageAnalyticsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ComputerUsageResponse
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *AnalyticsErrorResponse
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *AnalyticsErrorResponse
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *AnalyticsErrorResponse
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *AnalyticsErrorResponse
}

func ParseGetComputerUsageAnalyticsResponse

func ParseGetComputerUsageAnalyticsResponse(rsp *http.Response) (*GetComputerUsageAnalyticsResponse, error)

ParseGetComputerUsageAnalyticsResponse parses an HTTP response from a GetComputerUsageAnalyticsWithResponse call

func (GetComputerUsageAnalyticsResponse) ContentType

func (r GetComputerUsageAnalyticsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetComputerUsageAnalyticsResponse) GetBody

GetBody returns the raw response body bytes

func (GetComputerUsageAnalyticsResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetComputerUsageAnalyticsResponse) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetComputerUsageAnalyticsResponse) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetComputerUsageAnalyticsResponse) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetComputerUsageAnalyticsResponse) GetJSON429

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (GetComputerUsageAnalyticsResponse) Status

Status returns HTTPResponse.Status

func (GetComputerUsageAnalyticsResponse) StatusCode

func (r GetComputerUsageAnalyticsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetComputerUsageAnalyticsV2Params

type GetComputerUsageAnalyticsV2Params struct {
	// Dataset The dataset to query. query_volume at this grain carries Feature, Project and Comet breakdowns, but not Model or Model Family.
	Dataset GetComputerUsageAnalyticsV2ParamsDataset `form:"dataset" json:"dataset"`

	// GroupBy The dimension to group each day's usage by. user_email is currently the only supported value.
	GroupBy GetComputerUsageAnalyticsV2ParamsGroupBy `form:"group_by" json:"group_by"`

	// StartTime Window start in unix seconds (UTC), inclusive. Snapped down to the day grid, so the first day can include usage from before this time.
	StartTime int `form:"start_time" json:"start_time"`

	// EndTime Window end in unix seconds (UTC), exclusive. Defaults to now; future values are capped at now. The window may span at most 90 days.
	EndTime *int `form:"end_time,omitempty" json:"end_time,omitempty"`

	// Limit Member rows per page. Default 50, max 100. A page can span multiple days.
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// Page Opaque pagination cursor from a previous response's next_page. Valid only with the same query parameters it was issued for.
	Page *string `form:"page,omitempty" json:"page,omitempty"`
}

GetComputerUsageAnalyticsV2Params defines parameters for GetComputerUsageAnalyticsV2.

type GetComputerUsageAnalyticsV2ParamsDataset

type GetComputerUsageAnalyticsV2ParamsDataset string

GetComputerUsageAnalyticsV2ParamsDataset defines parameters for GetComputerUsageAnalyticsV2.

const (
	GetComputerUsageAnalyticsV2ParamsDatasetCreditUsage GetComputerUsageAnalyticsV2ParamsDataset = "credit_usage"
	GetComputerUsageAnalyticsV2ParamsDatasetQueryVolume GetComputerUsageAnalyticsV2ParamsDataset = "query_volume"
)

Defines values for GetComputerUsageAnalyticsV2ParamsDataset.

func (GetComputerUsageAnalyticsV2ParamsDataset) Valid

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

type GetComputerUsageAnalyticsV2ParamsGroupBy

type GetComputerUsageAnalyticsV2ParamsGroupBy string

GetComputerUsageAnalyticsV2ParamsGroupBy defines parameters for GetComputerUsageAnalyticsV2.

const (
	GetComputerUsageAnalyticsV2ParamsGroupByUserEmail GetComputerUsageAnalyticsV2ParamsGroupBy = "user_email"
)

Defines values for GetComputerUsageAnalyticsV2ParamsGroupBy.

func (GetComputerUsageAnalyticsV2ParamsGroupBy) Valid

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

type GetComputerUsageAnalyticsV2Response

type GetComputerUsageAnalyticsV2Response struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ComputerUsageV2Response
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *AnalyticsErrorResponse
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *AnalyticsErrorResponse
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *AnalyticsErrorResponse
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *AnalyticsErrorResponse
}

func ParseGetComputerUsageAnalyticsV2Response

func ParseGetComputerUsageAnalyticsV2Response(rsp *http.Response) (*GetComputerUsageAnalyticsV2Response, error)

ParseGetComputerUsageAnalyticsV2Response parses an HTTP response from a GetComputerUsageAnalyticsV2WithResponse call

func (GetComputerUsageAnalyticsV2Response) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetComputerUsageAnalyticsV2Response) GetBody

GetBody returns the raw response body bytes

func (GetComputerUsageAnalyticsV2Response) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetComputerUsageAnalyticsV2Response) GetJSON400

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetComputerUsageAnalyticsV2Response) GetJSON401

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetComputerUsageAnalyticsV2Response) GetJSON404

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetComputerUsageAnalyticsV2Response) GetJSON429

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (GetComputerUsageAnalyticsV2Response) Status

Status returns HTTPResponse.Status

func (GetComputerUsageAnalyticsV2Response) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetFileContentResponse added in v0.2.0

type GetFileContentResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
}

func ParseGetFileContentResponse added in v0.2.0

func ParseGetFileContentResponse(rsp *http.Response) (*GetFileContentResponse, error)

ParseGetFileContentResponse parses an HTTP response from a GetFileContentWithResponse call

func (GetFileContentResponse) ContentType added in v0.2.0

func (r GetFileContentResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetFileContentResponse) GetBody added in v0.2.0

func (r GetFileContentResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetFileContentResponse) GetJSON404 added in v0.2.0

func (r GetFileContentResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetFileContentResponse) Status added in v0.2.0

func (r GetFileContentResponse) Status() string

Status returns HTTPResponse.Status

func (GetFileContentResponse) StatusCode added in v0.2.0

func (r GetFileContentResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFileResponse added in v0.2.0

type GetFileResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *BatchFile
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
}

func ParseGetFileResponse added in v0.2.0

func ParseGetFileResponse(rsp *http.Response) (*GetFileResponse, error)

ParseGetFileResponse parses an HTTP response from a GetFileWithResponse call

func (GetFileResponse) ContentType added in v0.2.0

func (r GetFileResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetFileResponse) GetBody added in v0.2.0

func (r GetFileResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetFileResponse) GetJSON200 added in v0.2.0

func (r GetFileResponse) GetJSON200() *BatchFile

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetFileResponse) GetJSON404 added in v0.2.0

func (r GetFileResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetFileResponse) Status added in v0.2.0

func (r GetFileResponse) Status() string

Status returns HTTPResponse.Status

func (GetFileResponse) StatusCode added in v0.2.0

func (r GetFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetSkillParams

type GetSkillParams struct {
	// Revision Opaque revision token; when omitted, the active revision is used
	Revision *Revision `form:"revision,omitempty" json:"revision,omitempty"`
}

GetSkillParams defines parameters for GetSkill.

type GetSkillResponse

type GetSkillResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ManagedSkill
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
	// JSON502 the response for an HTTP 502 `application/json` response
	JSON502 *ApiError
}

func ParseGetSkillResponse

func ParseGetSkillResponse(rsp *http.Response) (*GetSkillResponse, error)

ParseGetSkillResponse parses an HTTP response from a GetSkillWithResponse call

func (GetSkillResponse) ContentType

func (r GetSkillResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetSkillResponse) GetBody

func (r GetSkillResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetSkillResponse) GetJSON200

func (r GetSkillResponse) GetJSON200() *ManagedSkill

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetSkillResponse) GetJSON400

func (r GetSkillResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetSkillResponse) GetJSON404

func (r GetSkillResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetSkillResponse) GetJSON429

func (r GetSkillResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (GetSkillResponse) GetJSON502

func (r GetSkillResponse) GetJSON502() *ApiError

GetJSON502 returns the response for an HTTP 502 `application/json` response

func (GetSkillResponse) Status

func (r GetSkillResponse) Status() string

Status returns HTTPResponse.Status

func (GetSkillResponse) StatusCode

func (r GetSkillResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HTTPValidationError

type HTTPValidationError struct {
	Detail *[]ValidationError `json:"detail,omitempty"`
}

HTTPValidationError defines model for HTTPValidationError.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ImageResult

type ImageResult struct {
	// Height Height of the image in pixels
	Height int64 `json:"height"`

	// ImageUrl URL of the image
	ImageUrl string `json:"image_url"`

	// OriginUrl Original URL where the image was found
	OriginUrl string `json:"origin_url"`

	// Title Title or description of the image
	Title *string `json:"title,omitempty"`

	// Width Width of the image in pixels
	Width int64 `json:"width"`
}

ImageResult A single image search result

type ImageSearchFilters

type ImageSearchFilters struct {
	DomainFilter *[]string                         `json:"domain_filter,omitempty"`
	FormatFilter *[]ImageSearchFiltersFormatFilter `json:"format_filter,omitempty"`
	SafeSearch   *bool                             `json:"safe_search,omitempty"`
}

ImageSearchFilters defines model for ImageSearchFilters.

type ImageSearchFiltersFormatFilter

type ImageSearchFiltersFormatFilter string

ImageSearchFiltersFormatFilter defines model for ImageSearchFilters.FormatFilter.

const (
	ImageSearchFiltersFormatFilterBmp  ImageSearchFiltersFormatFilter = "bmp"
	ImageSearchFiltersFormatFilterGif  ImageSearchFiltersFormatFilter = "gif"
	ImageSearchFiltersFormatFilterJpeg ImageSearchFiltersFormatFilter = "jpeg"
	ImageSearchFiltersFormatFilterPng  ImageSearchFiltersFormatFilter = "png"
	ImageSearchFiltersFormatFilterSvg  ImageSearchFiltersFormatFilter = "svg"
	ImageSearchFiltersFormatFilterWebp ImageSearchFiltersFormatFilter = "webp"
)

Defines values for ImageSearchFiltersFormatFilter.

func (ImageSearchFiltersFormatFilter) Valid

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

type ImageSearchQueriesEvent

type ImageSearchQueriesEvent struct {
	CallId         string   `json:"call_id"`
	Queries        []string `json:"queries"`
	SequenceNumber int64    `json:"sequence_number"`
	Thought        *string  `json:"thought,omitempty"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

ImageSearchQueriesEvent defines model for ImageSearchQueriesEvent.

type ImageSearchResultsEvent

type ImageSearchResultsEvent struct {
	CallId         string        `json:"call_id"`
	Results        []ImageResult `json:"results"`
	SequenceNumber int64         `json:"sequence_number"`
	Thought        *string       `json:"thought,omitempty"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`

	// Usage Token usage and cost information for a Responses API request
	Usage *ResponsesUsage `json:"usage,omitempty"`
}

ImageSearchResultsEvent defines model for ImageSearchResultsEvent.

type ImageSearchResultsOutputItem

type ImageSearchResultsOutputItem struct {
	// Error Present when image search failed. The value is image_search_failed.
	Error   *string                          `json:"error,omitempty"`
	Queries *[]string                        `json:"queries,omitempty"`
	Results []ImageResult                    `json:"results"`
	Type    ImageSearchResultsOutputItemType `json:"type"`
}

ImageSearchResultsOutputItem defines model for ImageSearchResultsOutputItem.

type ImageSearchResultsOutputItemType

type ImageSearchResultsOutputItemType string

ImageSearchResultsOutputItemType defines model for ImageSearchResultsOutputItem.Type.

const (
	ImageSearchResultsOutputItemTypeImageSearchResults ImageSearchResultsOutputItemType = "image_search_results"
)

Defines values for ImageSearchResultsOutputItemType.

func (ImageSearchResultsOutputItemType) Valid

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

type ImageSearchTool

type ImageSearchTool struct {
	Filters    *ImageSearchFilters `json:"filters,omitempty"`
	MaxResults *int32              `json:"max_results,omitempty"`
	Type       ImageSearchToolType `json:"type"`
}

ImageSearchTool defines model for ImageSearchTool.

type ImageSearchToolType

type ImageSearchToolType string

ImageSearchToolType defines model for ImageSearchTool.Type.

const (
	ImageSearchToolTypeImageSearch ImageSearchToolType = "image_search"
)

Defines values for ImageSearchToolType.

func (ImageSearchToolType) Valid

func (e ImageSearchToolType) Valid() bool

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

type InlineSkill

type InlineSkill struct {
	// Description Short discovery description, limited to 1,024 UTF-8 bytes.
	Description string `json:"description"`

	// Instructions Instructions returned by load_skill, limited to 65,536 UTF-8 bytes per skill and 262,144 bytes across the request.
	Instructions string `json:"instructions"`

	// Name Request-scoped lowercase ASCII name separated by single hyphens.
	Name string          `json:"name"`
	Type InlineSkillType `json:"type"`
}

InlineSkill defines model for InlineSkill.

type InlineSkillType

type InlineSkillType string

InlineSkillType defines model for InlineSkill.Type.

const (
	InlineSkillTypeInline InlineSkillType = "inline"
)

Defines values for InlineSkillType.

func (InlineSkillType) Valid

func (e InlineSkillType) Valid() bool

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

type Input

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

Input Input content - either a string or array of input items

func (Input) AsInput0

func (t Input) AsInput0() (Input0, error)

AsInput0 returns the union data inside the Input as a Input0

func (Input) AsInput1

func (t Input) AsInput1() (Input1, error)

AsInput1 returns the union data inside the Input as a Input1

func (*Input) FromInput0

func (t *Input) FromInput0(v Input0) error

FromInput0 overwrites any union data inside the Input as the provided Input0

func (*Input) FromInput1

func (t *Input) FromInput1(v Input1) error

FromInput1 overwrites any union data inside the Input as the provided Input1

func (Input) MarshalJSON

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

func (*Input) MergeInput0

func (t *Input) MergeInput0(v Input0) error

MergeInput0 performs a merge with any union data inside the Input, using the provided Input0

func (*Input) MergeInput1

func (t *Input) MergeInput1(v Input1) error

MergeInput1 performs a merge with any union data inside the Input, using the provided Input1

func (*Input) UnmarshalJSON

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

type Input0

type Input0 = string

Input0 defines model for Input.0.

type Input1

type Input1 = []InputItem

Input1 defines model for Input.1.

type InputContent

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

InputContent Message content - either a string or array of content parts

func (InputContent) AsInputContent0

func (t InputContent) AsInputContent0() (InputContent0, error)

AsInputContent0 returns the union data inside the InputContent as a InputContent0

func (InputContent) AsInputContent1

func (t InputContent) AsInputContent1() (InputContent1, error)

AsInputContent1 returns the union data inside the InputContent as a InputContent1

func (*InputContent) FromInputContent0

func (t *InputContent) FromInputContent0(v InputContent0) error

FromInputContent0 overwrites any union data inside the InputContent as the provided InputContent0

func (*InputContent) FromInputContent1

func (t *InputContent) FromInputContent1(v InputContent1) error

FromInputContent1 overwrites any union data inside the InputContent as the provided InputContent1

func (InputContent) MarshalJSON

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

func (*InputContent) MergeInputContent0

func (t *InputContent) MergeInputContent0(v InputContent0) error

MergeInputContent0 performs a merge with any union data inside the InputContent, using the provided InputContent0

func (*InputContent) MergeInputContent1

func (t *InputContent) MergeInputContent1(v InputContent1) error

MergeInputContent1 performs a merge with any union data inside the InputContent, using the provided InputContent1

func (*InputContent) UnmarshalJSON

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

type InputContent0

type InputContent0 = string

InputContent0 defines model for InputContent.0.

type InputContent1

type InputContent1 = []InputContentPart

InputContent1 defines model for InputContent.1.

type InputContentPart

type InputContentPart struct {
	// FileData For input_file, standard base64 or a base64 data URI. Exactly one of file_data and file_url is required. Native Agent input allows at most 30 document parts and 50 MiB combined decoded inline bytes, including inherited documents. Provider limits also apply. Browser tools are unavailable with document inputs or document continuations.
	FileData *string `json:"file_data,omitempty"`

	// FileUrl For input_file, public HTTPS URL fetched by the provider. Exactly one of file_data and file_url is required. Defaults to PDF unless filename supplies another supported extension; the remote content must match. No file_id support. Browser tools are unavailable with document inputs or document continuations.
	FileUrl *string `json:"file_url,omitempty"`

	// Filename Optional input_file basename, at most 255 UTF-8 bytes. Its extension must match the document type.
	Filename *string              `json:"filename,omitempty"`
	ImageUrl *string              `json:"image_url,omitempty"`
	Text     *string              `json:"text,omitempty"`
	Type     InputContentPartType `json:"type"`
}

InputContentPart defines model for InputContentPart.

type InputContentPartType

type InputContentPartType string

InputContentPartType defines model for InputContentPart.Type.

const (
	InputContentPartTypeInputFile  InputContentPartType = "input_file"
	InputContentPartTypeInputImage InputContentPartType = "input_image"
	InputContentPartTypeInputText  InputContentPartType = "input_text"
)

Defines values for InputContentPartType.

func (InputContentPartType) Valid

func (e InputContentPartType) Valid() bool

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

type InputItem

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

InputItem defines model for InputItem.

func (InputItem) AsFunctionCallInput

func (t InputItem) AsFunctionCallInput() (FunctionCallInput, error)

AsFunctionCallInput returns the union data inside the InputItem as a FunctionCallInput

func (InputItem) AsFunctionCallOutputInput

func (t InputItem) AsFunctionCallOutputInput() (FunctionCallOutputInput, error)

AsFunctionCallOutputInput returns the union data inside the InputItem as a FunctionCallOutputInput

func (InputItem) AsInputMessage

func (t InputItem) AsInputMessage() (InputMessage, error)

AsInputMessage returns the union data inside the InputItem as a InputMessage

func (InputItem) AsMcpApprovalRequestInput

func (t InputItem) AsMcpApprovalRequestInput() (McpApprovalRequestInput, error)

AsMcpApprovalRequestInput returns the union data inside the InputItem as a McpApprovalRequestInput

func (InputItem) AsMcpApprovalResponseInput

func (t InputItem) AsMcpApprovalResponseInput() (McpApprovalResponseInput, error)

AsMcpApprovalResponseInput returns the union data inside the InputItem as a McpApprovalResponseInput

func (InputItem) AsMcpCallInput

func (t InputItem) AsMcpCallInput() (McpCallInput, error)

AsMcpCallInput returns the union data inside the InputItem as a McpCallInput

func (InputItem) AsMcpListToolsInput

func (t InputItem) AsMcpListToolsInput() (McpListToolsInput, error)

AsMcpListToolsInput returns the union data inside the InputItem as a McpListToolsInput

func (InputItem) Discriminator

func (t InputItem) Discriminator() (string, error)

func (*InputItem) FromFunctionCallInput

func (t *InputItem) FromFunctionCallInput(v FunctionCallInput) error

FromFunctionCallInput overwrites any union data inside the InputItem as the provided FunctionCallInput

func (*InputItem) FromFunctionCallOutputInput

func (t *InputItem) FromFunctionCallOutputInput(v FunctionCallOutputInput) error

FromFunctionCallOutputInput overwrites any union data inside the InputItem as the provided FunctionCallOutputInput

func (*InputItem) FromInputMessage

func (t *InputItem) FromInputMessage(v InputMessage) error

FromInputMessage overwrites any union data inside the InputItem as the provided InputMessage

func (*InputItem) FromMcpApprovalRequestInput

func (t *InputItem) FromMcpApprovalRequestInput(v McpApprovalRequestInput) error

FromMcpApprovalRequestInput overwrites any union data inside the InputItem as the provided McpApprovalRequestInput

func (*InputItem) FromMcpApprovalResponseInput

func (t *InputItem) FromMcpApprovalResponseInput(v McpApprovalResponseInput) error

FromMcpApprovalResponseInput overwrites any union data inside the InputItem as the provided McpApprovalResponseInput

func (*InputItem) FromMcpCallInput

func (t *InputItem) FromMcpCallInput(v McpCallInput) error

FromMcpCallInput overwrites any union data inside the InputItem as the provided McpCallInput

func (*InputItem) FromMcpListToolsInput

func (t *InputItem) FromMcpListToolsInput(v McpListToolsInput) error

FromMcpListToolsInput overwrites any union data inside the InputItem as the provided McpListToolsInput

func (InputItem) MarshalJSON

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

func (*InputItem) MergeFunctionCallInput

func (t *InputItem) MergeFunctionCallInput(v FunctionCallInput) error

MergeFunctionCallInput performs a merge with any union data inside the InputItem, using the provided FunctionCallInput

func (*InputItem) MergeFunctionCallOutputInput

func (t *InputItem) MergeFunctionCallOutputInput(v FunctionCallOutputInput) error

MergeFunctionCallOutputInput performs a merge with any union data inside the InputItem, using the provided FunctionCallOutputInput

func (*InputItem) MergeInputMessage

func (t *InputItem) MergeInputMessage(v InputMessage) error

MergeInputMessage performs a merge with any union data inside the InputItem, using the provided InputMessage

func (*InputItem) MergeMcpApprovalRequestInput

func (t *InputItem) MergeMcpApprovalRequestInput(v McpApprovalRequestInput) error

MergeMcpApprovalRequestInput performs a merge with any union data inside the InputItem, using the provided McpApprovalRequestInput

func (*InputItem) MergeMcpApprovalResponseInput

func (t *InputItem) MergeMcpApprovalResponseInput(v McpApprovalResponseInput) error

MergeMcpApprovalResponseInput performs a merge with any union data inside the InputItem, using the provided McpApprovalResponseInput

func (*InputItem) MergeMcpCallInput

func (t *InputItem) MergeMcpCallInput(v McpCallInput) error

MergeMcpCallInput performs a merge with any union data inside the InputItem, using the provided McpCallInput

func (*InputItem) MergeMcpListToolsInput

func (t *InputItem) MergeMcpListToolsInput(v McpListToolsInput) error

MergeMcpListToolsInput performs a merge with any union data inside the InputItem, using the provided McpListToolsInput

func (*InputItem) UnmarshalJSON

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

func (InputItem) ValueByDiscriminator

func (t InputItem) ValueByDiscriminator() (interface{}, error)

type InputMessage

type InputMessage struct {
	// Content Message content - either a string or array of content parts
	Content InputContent     `json:"content"`
	Role    InputMessageRole `json:"role"`
	Type    InputMessageType `json:"type"`
}

InputMessage defines model for InputMessage.

type InputMessageRole

type InputMessageRole string

InputMessageRole defines model for InputMessage.Role.

const (
	InputMessageRoleAssistant InputMessageRole = "assistant"
	InputMessageRoleDeveloper InputMessageRole = "developer"
	InputMessageRoleSystem    InputMessageRole = "system"
	InputMessageRoleUser      InputMessageRole = "user"
)

Defines values for InputMessageRole.

func (InputMessageRole) Valid

func (e InputMessageRole) Valid() bool

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

type InputMessageType

type InputMessageType string

InputMessageType defines model for InputMessage.Type.

const (
	InputMessageTypeMessage InputMessageType = "message"
)

Defines values for InputMessageType.

func (InputMessageType) Valid

func (e InputMessageType) Valid() bool

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

type InputTokensDetails

type InputTokensDetails struct {
	CacheCreationInputTokens *int64 `json:"cache_creation_input_tokens,omitempty"`
	CacheReadInputTokens     *int64 `json:"cache_read_input_tokens,omitempty"`
	CachedTokens             int64  `json:"cached_tokens"`
}

InputTokensDetails defines model for InputTokensDetails.

type JSONSchema

type JSONSchema struct {
	Description *string                `json:"description,omitempty"`
	Name        *string                `json:"name,omitempty"`
	Schema      map[string]interface{} `json:"schema"`
	Strict      *bool                  `json:"strict,omitempty"`
}

JSONSchema defines model for JSONSchema.

type JSONSchemaFormat

type JSONSchemaFormat struct {
	// Description Optional description of the schema
	Description *string `json:"description,omitempty"`

	// Name Name of the schema (1-64 alphanumeric chars)
	Name string `json:"name"`

	// Schema The JSON schema object
	Schema map[string]interface{} `json:"schema"`

	// Strict Whether to enforce strict schema validation
	Strict *bool `json:"strict,omitempty"`
}

JSONSchemaFormat Defines a JSON schema for structured output validation

type Limit

type Limit = int

Limit defines model for Limit.

type ListAgentFilesResponse

type ListAgentFilesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ResponseFileList
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *struct {
		// Error Error information returned when a request fails
		Error *ErrorInfo `json:"error,omitempty"`
	}
}

func ParseListAgentFilesResponse

func ParseListAgentFilesResponse(rsp *http.Response) (*ListAgentFilesResponse, error)

ParseListAgentFilesResponse parses an HTTP response from a ListAgentFilesWithResponse call

func (ListAgentFilesResponse) ContentType

func (r ListAgentFilesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListAgentFilesResponse) GetBody

func (r ListAgentFilesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListAgentFilesResponse) GetJSON200

func (r ListAgentFilesResponse) GetJSON200() *ResponseFileList

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListAgentFilesResponse) GetJSON404

func (r ListAgentFilesResponse) GetJSON404() *struct {
	// Error Error information returned when a request fails
	Error *ErrorInfo `json:"error,omitempty"`
}

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListAgentFilesResponse) Status

func (r ListAgentFilesResponse) Status() string

Status returns HTTPResponse.Status

func (ListAgentFilesResponse) StatusCode

func (r ListAgentFilesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListAsyncApiChatCompletionsResponse

type ListAsyncApiChatCompletionsResponse struct {
	NextToken *string                                  `json:"next_token,omitempty"`
	Requests  []AsyncApiChatCompletionsResponseSummary `json:"requests"`
}

ListAsyncApiChatCompletionsResponse defines model for ListAsyncApiChatCompletionsResponse.

type ListAsyncChatCompletionsAsyncChatCompletionsGetResponse

type ListAsyncChatCompletionsAsyncChatCompletionsGetResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ListAsyncApiChatCompletionsResponse
	// JSON422 the response for an HTTP 422 `application/json` response
	JSON422 *HTTPValidationError
}

func ParseListAsyncChatCompletionsAsyncChatCompletionsGetResponse

func ParseListAsyncChatCompletionsAsyncChatCompletionsGetResponse(rsp *http.Response) (*ListAsyncChatCompletionsAsyncChatCompletionsGetResponse, error)

ParseListAsyncChatCompletionsAsyncChatCompletionsGetResponse parses an HTTP response from a ListAsyncChatCompletionsAsyncChatCompletionsGetWithResponse call

func (ListAsyncChatCompletionsAsyncChatCompletionsGetResponse) ContentType

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListAsyncChatCompletionsAsyncChatCompletionsGetResponse) GetBody

GetBody returns the raw response body bytes

func (ListAsyncChatCompletionsAsyncChatCompletionsGetResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListAsyncChatCompletionsAsyncChatCompletionsGetResponse) GetJSON422

GetJSON422 returns the response for an HTTP 422 `application/json` response

func (ListAsyncChatCompletionsAsyncChatCompletionsGetResponse) Status

Status returns HTTPResponse.Status

func (ListAsyncChatCompletionsAsyncChatCompletionsGetResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type ListBatchesParams added in v0.2.0

type ListBatchesParams struct {
	// Limit Maximum number of batches to return
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// After Batch id to start after, the `last_id` of the previous page
	After *string `form:"after,omitempty" json:"after,omitempty"`
}

ListBatchesParams defines parameters for ListBatches.

type ListBatchesResponse added in v0.2.0

type ListBatchesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *BatchList
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
}

func ParseListBatchesResponse added in v0.2.0

func ParseListBatchesResponse(rsp *http.Response) (*ListBatchesResponse, error)

ParseListBatchesResponse parses an HTTP response from a ListBatchesWithResponse call

func (ListBatchesResponse) ContentType added in v0.2.0

func (r ListBatchesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListBatchesResponse) GetBody added in v0.2.0

func (r ListBatchesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListBatchesResponse) GetJSON200 added in v0.2.0

func (r ListBatchesResponse) GetJSON200() *BatchList

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListBatchesResponse) GetJSON400 added in v0.2.0

func (r ListBatchesResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListBatchesResponse) GetJSON429 added in v0.2.0

func (r ListBatchesResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (ListBatchesResponse) Status added in v0.2.0

func (r ListBatchesResponse) Status() string

Status returns HTTPResponse.Status

func (ListBatchesResponse) StatusCode added in v0.2.0

func (r ListBatchesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListFilesParams added in v0.2.0

type ListFilesParams struct {
	// Limit Maximum number of files to return
	Limit *int `form:"limit,omitempty" json:"limit,omitempty"`

	// After File id to start after, the `last_id` of the previous page
	After *string `form:"after,omitempty" json:"after,omitempty"`

	// Order Sort order, `desc` for newest first
	Order *ListFilesParamsOrder `form:"order,omitempty" json:"order,omitempty"`

	// Purpose Only list files with this purpose, `batch` for uploads or `batch_output` for output and error files
	Purpose *ListFilesParamsPurpose `form:"purpose,omitempty" json:"purpose,omitempty"`
}

ListFilesParams defines parameters for ListFiles.

type ListFilesParamsOrder added in v0.2.0

type ListFilesParamsOrder string

ListFilesParamsOrder defines parameters for ListFiles.

const (
	ListFilesParamsOrderAsc  ListFilesParamsOrder = "asc"
	ListFilesParamsOrderDesc ListFilesParamsOrder = "desc"
)

Defines values for ListFilesParamsOrder.

func (ListFilesParamsOrder) Valid added in v0.2.0

func (e ListFilesParamsOrder) Valid() bool

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

type ListFilesParamsPurpose added in v0.2.0

type ListFilesParamsPurpose string

ListFilesParamsPurpose defines parameters for ListFiles.

const (
	ListFilesParamsPurposeBatch       ListFilesParamsPurpose = "batch"
	ListFilesParamsPurposeBatchOutput ListFilesParamsPurpose = "batch_output"
)

Defines values for ListFilesParamsPurpose.

func (ListFilesParamsPurpose) Valid added in v0.2.0

func (e ListFilesParamsPurpose) Valid() bool

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

type ListFilesResponse added in v0.2.0

type ListFilesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *BatchFileList
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
}

func ParseListFilesResponse added in v0.2.0

func ParseListFilesResponse(rsp *http.Response) (*ListFilesResponse, error)

ParseListFilesResponse parses an HTTP response from a ListFilesWithResponse call

func (ListFilesResponse) ContentType added in v0.2.0

func (r ListFilesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListFilesResponse) GetBody added in v0.2.0

func (r ListFilesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListFilesResponse) GetJSON200 added in v0.2.0

func (r ListFilesResponse) GetJSON200() *BatchFileList

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListFilesResponse) GetJSON400 added in v0.2.0

func (r ListFilesResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListFilesResponse) GetJSON429 added in v0.2.0

func (r ListFilesResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (ListFilesResponse) Status added in v0.2.0

func (r ListFilesResponse) Status() string

Status returns HTTPResponse.Status

func (ListFilesResponse) StatusCode added in v0.2.0

func (r ListFilesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListModelsResponse

type ListModelsResponse struct {
	// Data A list of model objects.
	Data []Model `json:"data"`

	// Object The object type, which is always `list`.
	Object ListModelsResponseObject `json:"object"`
}

ListModelsResponse Response from the List Models endpoint. Contains a list of available models.

type ListModelsResponse2

type ListModelsResponse2 struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ListModelsResponse
}

func ParseListModelsResponse2

func ParseListModelsResponse2(rsp *http.Response) (*ListModelsResponse2, error)

ParseListModelsResponse2 parses an HTTP response from a ListModelsWithResponse call

func (ListModelsResponse2) ContentType

func (r ListModelsResponse2) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListModelsResponse2) GetBody

func (r ListModelsResponse2) GetBody() []byte

GetBody returns the raw response body bytes

func (ListModelsResponse2) GetJSON200

func (r ListModelsResponse2) GetJSON200() *ListModelsResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListModelsResponse2) Status

func (r ListModelsResponse2) Status() string

Status returns HTTPResponse.Status

func (ListModelsResponse2) StatusCode

func (r ListModelsResponse2) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListModelsResponseObject

type ListModelsResponseObject string

ListModelsResponseObject The object type, which is always `list`.

const (
	ListModelsResponseObjectList ListModelsResponseObject = "list"
)

Defines values for ListModelsResponseObject.

func (ListModelsResponseObject) Valid

func (e ListModelsResponseObject) Valid() bool

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

type ListSkillRevisionsParams

type ListSkillRevisionsParams struct {
	// Limit Maximum items to return, 1 to 200; defaults to 50
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// PageToken Opaque token from a previous response's `next_page_token`
	PageToken *PageToken `form:"page_token,omitempty" json:"page_token,omitempty"`
}

ListSkillRevisionsParams defines parameters for ListSkillRevisions.

type ListSkillRevisionsResponse

type ListSkillRevisionsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *SkillRevisionList
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
	// JSON502 the response for an HTTP 502 `application/json` response
	JSON502 *ApiError
}

func ParseListSkillRevisionsResponse

func ParseListSkillRevisionsResponse(rsp *http.Response) (*ListSkillRevisionsResponse, error)

ParseListSkillRevisionsResponse parses an HTTP response from a ListSkillRevisionsWithResponse call

func (ListSkillRevisionsResponse) ContentType

func (r ListSkillRevisionsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSkillRevisionsResponse) GetBody

func (r ListSkillRevisionsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSkillRevisionsResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSkillRevisionsResponse) GetJSON400

func (r ListSkillRevisionsResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSkillRevisionsResponse) GetJSON404

func (r ListSkillRevisionsResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (ListSkillRevisionsResponse) GetJSON429

func (r ListSkillRevisionsResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (ListSkillRevisionsResponse) GetJSON502

func (r ListSkillRevisionsResponse) GetJSON502() *ApiError

GetJSON502 returns the response for an HTTP 502 `application/json` response

func (ListSkillRevisionsResponse) Status

Status returns HTTPResponse.Status

func (ListSkillRevisionsResponse) StatusCode

func (r ListSkillRevisionsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSkillsParams

type ListSkillsParams struct {
	// Limit Maximum items to return, 1 to 200; defaults to 50
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// PageToken Opaque token from a previous response's `next_page_token`
	PageToken *PageToken `form:"page_token,omitempty" json:"page_token,omitempty"`
}

ListSkillsParams defines parameters for ListSkills.

type ListSkillsResponse

type ListSkillsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *SkillList
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
	// JSON502 the response for an HTTP 502 `application/json` response
	JSON502 *ApiError
}

func ParseListSkillsResponse

func ParseListSkillsResponse(rsp *http.Response) (*ListSkillsResponse, error)

ParseListSkillsResponse parses an HTTP response from a ListSkillsWithResponse call

func (ListSkillsResponse) ContentType

func (r ListSkillsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListSkillsResponse) GetBody

func (r ListSkillsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListSkillsResponse) GetJSON200

func (r ListSkillsResponse) GetJSON200() *SkillList

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListSkillsResponse) GetJSON400

func (r ListSkillsResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (ListSkillsResponse) GetJSON429

func (r ListSkillsResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (ListSkillsResponse) GetJSON502

func (r ListSkillsResponse) GetJSON502() *ApiError

GetJSON502 returns the response for an HTTP 502 `application/json` response

func (ListSkillsResponse) Status

func (r ListSkillsResponse) Status() string

Status returns HTTPResponse.Status

func (ListSkillsResponse) StatusCode

func (r ListSkillsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ManagedSkill

type ManagedSkill struct {
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// Description Skill description, read from the bundle's `SKILL.md`
	Description *string `json:"description,omitempty"`

	// LatestRevision Opaque token of the skill's current latest revision; pass as expected_revision to update or delete
	LatestRevision *string `json:"latest_revision,omitempty"`

	// Name Skill name, read from the bundle's `SKILL.md`
	Name *string `json:"name,omitempty"`

	// Revision Opaque token of the revision returned in this response; the latest revision, or the specific one requested via `revision`
	Revision *string `json:"revision,omitempty"`

	// SkillId Skill identifier
	SkillId   string     `json:"skill_id"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

ManagedSkill defines model for ManagedSkill.

type McpApprovalRequestInput

type McpApprovalRequestInput struct {
	// Arguments JSON-encoded arguments the model proposed.
	Arguments string `json:"arguments"`

	// ConnectorId Present only when the request came from a connector.
	ConnectorId *string `json:"connector_id,omitempty"`
	Id          string  `json:"id"`
	Name        string  `json:"name"`
	ServerLabel string  `json:"server_label"`

	// ThoughtSignature Base64-encoded signature for thinking models.
	ThoughtSignature *string                     `json:"thought_signature,omitempty"`
	Type             McpApprovalRequestInputType `json:"type"`
}

McpApprovalRequestInput A prior `mcp_approval_request` output item resent as manual history. Resend `thought_signature` unchanged when it is present.

type McpApprovalRequestInputType

type McpApprovalRequestInputType string

McpApprovalRequestInputType defines model for McpApprovalRequestInput.Type.

const (
	McpApprovalRequestInputTypeMcpApprovalRequest McpApprovalRequestInputType = "mcp_approval_request"
)

Defines values for McpApprovalRequestInputType.

func (McpApprovalRequestInputType) Valid

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

type McpApprovalRequestOutputItem

type McpApprovalRequestOutputItem struct {
	// Arguments JSON-encoded arguments the model proposed.
	Arguments string `json:"arguments"`

	// ConnectorId Present only when the item originated from a connector.
	ConnectorId *string `json:"connector_id,omitempty"`

	// Id Opaque approval request ID. Return it as `approval_request_id` when submitting a decision.
	Id          string `json:"id"`
	Name        string `json:"name"`
	ServerLabel string `json:"server_label"`

	// ThoughtSignature Base64-encoded signature for thinking models. Resend it unchanged in manual history.
	ThoughtSignature *string                          `json:"thought_signature,omitempty"`
	Type             McpApprovalRequestOutputItemType `json:"type"`
}

McpApprovalRequestOutputItem One MCP or connector tool call waiting for the application to approve or deny it. The call has not run. Answer with an `mcp_approval_response` input item in the next request.

type McpApprovalRequestOutputItemType

type McpApprovalRequestOutputItemType string

McpApprovalRequestOutputItemType defines model for McpApprovalRequestOutputItem.Type.

const (
	McpApprovalRequestOutputItemTypeMcpApprovalRequest McpApprovalRequestOutputItemType = "mcp_approval_request"
)

Defines values for McpApprovalRequestOutputItemType.

func (McpApprovalRequestOutputItemType) Valid

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

type McpApprovalResponseInput

type McpApprovalResponseInput struct {
	// ApprovalRequestId The `id` of the `mcp_approval_request` being answered.
	ApprovalRequestId string `json:"approval_request_id"`

	// Approve When true, run the recorded call. When false, skip it and tell the model the user denied the action.
	Approve bool `json:"approve"`

	// Id Optional client item ID. It is ignored for correlation; use `approval_request_id` instead.
	Id *string `json:"id,omitempty"`

	// Reason Optional text returned to the model with a denial. A string is rejected when `approve` is true; null is accepted.
	Reason *string                      `json:"reason,omitempty"`
	Type   McpApprovalResponseInputType `json:"type"`
}

McpApprovalResponseInput The application's decision for one pending `mcp_approval_request`. Every pending request in the selected history needs exactly one decision before any approved call runs.

type McpApprovalResponseInputType

type McpApprovalResponseInputType string

McpApprovalResponseInputType defines model for McpApprovalResponseInput.Type.

const (
	McpApprovalResponseInputTypeMcpApprovalResponse McpApprovalResponseInputType = "mcp_approval_response"
)

Defines values for McpApprovalResponseInputType.

func (McpApprovalResponseInputType) Valid

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

type McpCallInput

type McpCallInput struct {
	// ApprovalRequestId The approval request this call resolved, or null for an automatic call.
	ApprovalRequestId *string          `json:"approval_request_id,omitempty"`
	Arguments         string           `json:"arguments"`
	ConnectorId       *string          `json:"connector_id,omitempty"`
	Error             *string          `json:"error,omitempty"`
	Id                string           `json:"id"`
	Name              string           `json:"name"`
	Output            *string          `json:"output,omitempty"`
	ServerLabel       string           `json:"server_label"`
	Type              McpCallInputType `json:"type"`
}

McpCallInput A prior `mcp_call` output item resent as manual history. It records history and does not trigger execution.

type McpCallInputType

type McpCallInputType string

McpCallInputType defines model for McpCallInput.Type.

const (
	McpCallInputTypeMcpCall McpCallInputType = "mcp_call"
)

Defines values for McpCallInputType.

func (McpCallInputType) Valid

func (e McpCallInputType) Valid() bool

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

type McpCallOutputItem

type McpCallOutputItem struct {
	// ApprovalRequestId The `mcp_approval_request` ID this call resolved; null when the call ran automatically.
	ApprovalRequestId *string `json:"approval_request_id,omitempty"`

	// Arguments JSON-encoded arguments the model passed.
	Arguments string `json:"arguments"`

	// ConnectorId Present only when the item originated from a managed connector.
	ConnectorId *string `json:"connector_id,omitempty"`

	// Error The failure string when the call failed (also returned to the model in-band); null on success, matching OpenAI's mcp_call.
	Error *string `json:"error,omitempty"`
	Id    string  `json:"id"`
	Name  string  `json:"name"`

	// Output Tool output text; empty when the call failed.
	Output      *string               `json:"output,omitempty"`
	ServerLabel string                `json:"server_label"`
	Type        McpCallOutputItemType `json:"type"`
}

McpCallOutputItem One tool call executed against an external MCP server, modeled on OpenAI's mcp_call item.

type McpCallOutputItemType

type McpCallOutputItemType string

McpCallOutputItemType defines model for McpCallOutputItem.Type.

const (
	McpCallOutputItemTypeMcpCall McpCallOutputItemType = "mcp_call"
)

Defines values for McpCallOutputItemType.

func (McpCallOutputItemType) Valid

func (e McpCallOutputItemType) Valid() bool

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

type McpListToolsInput

type McpListToolsInput struct {
	Error       *string               `json:"error,omitempty"`
	Id          *string               `json:"id,omitempty"`
	ServerLabel *string               `json:"server_label,omitempty"`
	Tools       *[]McpToolDef         `json:"tools,omitempty"`
	Type        McpListToolsInputType `json:"type"`
}

McpListToolsInput A prior `mcp_list_tools` output item resent as history. The API accepts and drops it because tool discovery runs again.

type McpListToolsInputType

type McpListToolsInputType string

McpListToolsInputType defines model for McpListToolsInput.Type.

const (
	McpListToolsInputTypeMcpListTools McpListToolsInputType = "mcp_list_tools"
)

Defines values for McpListToolsInputType.

func (McpListToolsInputType) Valid

func (e McpListToolsInputType) Valid() bool

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

type McpListToolsOutputItem

type McpListToolsOutputItem struct {
	// ConnectorId Present only when the item originated from a managed connector.
	ConnectorId *string `json:"connector_id,omitempty"`

	// Error Present only when the server's tools could not be listed. Absent on success.
	Error       *string                    `json:"error,omitempty"`
	Id          string                     `json:"id"`
	ServerLabel string                     `json:"server_label"`
	Tools       []McpToolDef               `json:"tools"`
	Type        McpListToolsOutputItemType `json:"type"`
}

McpListToolsOutputItem Tools discovered on one external MCP server when the request starts. Matches OpenAI's mcp_list_tools item.

type McpListToolsOutputItemType

type McpListToolsOutputItemType string

McpListToolsOutputItemType defines model for McpListToolsOutputItem.Type.

const (
	McpListToolsOutputItemTypeMcpListTools McpListToolsOutputItemType = "mcp_list_tools"
)

Defines values for McpListToolsOutputItemType.

func (McpListToolsOutputItemType) Valid

func (e McpListToolsOutputItemType) Valid() bool

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

type McpTool

type McpTool struct {
	// AllowedTools Optional allowlist of tool names. Empty exposes all discovered tools.
	AllowedTools *[]string `json:"allowed_tools,omitempty"`

	// Authorization An access token passed to the remote MCP server for authentication. Provide the raw token value. Never logged or echoed.
	Authorization *string `json:"authorization,omitempty"`

	// DeferLoading When true, keeps discovered tool definitions out of the initial model context and lets the model load relevant schemas as needed. Defaults to false.
	DeferLoading *bool `json:"defer_loading,omitempty"`

	// Headers Extra request headers.
	Headers *map[string]string `json:"headers,omitempty"`

	// RequireApproval Approval policy for this server's tool calls. Omitted, null, or `"never"` runs every call automatically; `"always"` gates every call; the object form filters by exact tool name and reported read-only classification.
	RequireApproval *RequireApproval `json:"require_approval,omitempty"`

	// ServerLabel Unique per request, ^[a-zA-Z0-9_-]{1,64}$. Namespaces the server's tools.
	ServerLabel string `json:"server_label"`

	// ServerUrl HTTPS URL of the remote MCP server. Must be a Streamable HTTP MCP endpoint; the legacy SSE transport is not supported.
	ServerUrl string      `json:"server_url"`
	Type      McpToolType `json:"type"`
}

McpTool Connects a user-supplied remote MCP server. Agent API discovers the server's tools when the request starts and calls them like native tools. `defer_loading: true` keeps discovered definitions out of the initial model context and lets the model search, inspect, and call them as needed. The `require_approval` contract pauses gated calls for an application decision.

type McpToolDef

type McpToolDef struct {
	// Annotations Tool annotations. `read_only` is untrusted catalog metadata used by approval filters, not a side-effect guarantee.
	Annotations *McpToolDef_Annotations `json:"annotations,omitempty"`
	Description *string                 `json:"description,omitempty"`

	// InputSchema The server's JSON Schema for the tool, passed through unmodified.
	InputSchema map[string]interface{} `json:"input_schema"`
	Name        string                 `json:"name"`
}

McpToolDef One tool discovered on a remote MCP server.

type McpToolDef_Annotations

type McpToolDef_Annotations struct {
	ReadOnly             *bool                  `json:"read_only,omitempty"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

McpToolDef_Annotations Tool annotations. `read_only` is untrusted catalog metadata used by approval filters, not a side-effect guarantee.

func (McpToolDef_Annotations) Get

func (a McpToolDef_Annotations) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for McpToolDef_Annotations. Returns the specified element and whether it was found

func (McpToolDef_Annotations) MarshalJSON

func (a McpToolDef_Annotations) MarshalJSON() ([]byte, error)

Override default JSON handling for McpToolDef_Annotations to handle AdditionalProperties

func (*McpToolDef_Annotations) Set

func (a *McpToolDef_Annotations) Set(fieldName string, value interface{})

Setter for additional properties for McpToolDef_Annotations

func (*McpToolDef_Annotations) UnmarshalJSON

func (a *McpToolDef_Annotations) UnmarshalJSON(b []byte) error

Override default JSON handling for McpToolDef_Annotations to handle AdditionalProperties

type McpToolType

type McpToolType string

McpToolType defines model for McpTool.Type.

const (
	McpToolTypeMcp McpToolType = "mcp"
)

Defines values for McpToolType.

func (McpToolType) Valid

func (e McpToolType) Valid() bool

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

type MessageOutputItem

type MessageOutputItem struct {
	Content []ContentPart `json:"content"`
	Id      string        `json:"id"`

	// Role Role in a message
	Role RoleType `json:"role"`

	// Status Status of a response or output item
	Status Status                `json:"status"`
	Type   MessageOutputItemType `json:"type"`
}

MessageOutputItem defines model for MessageOutputItem.

type MessageOutputItemType

type MessageOutputItemType string

MessageOutputItemType defines model for MessageOutputItem.Type.

const (
	MessageOutputItemTypeMessage MessageOutputItemType = "message"
)

Defines values for MessageOutputItemType.

func (MessageOutputItemType) Valid

func (e MessageOutputItemType) Valid() bool

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

type Model

type Model struct {
	// Created The Unix timestamp (in seconds) when the model was created.
	Created int `json:"created"`

	// Id The model identifier in `provider/model-name` format. Use this value as the `model` parameter in Agent API requests.
	Id string `json:"id"`

	// Object The object type, which is always `model`.
	Object ModelObject `json:"object"`

	// OwnedBy The provider that owns the model (e.g. `openai`, `anthropic`, `google`, `perplexity`, `xai`, `z-ai`, `moonshotai`, `nvidia`).
	OwnedBy string `json:"owned_by"`
}

Model Represents a model available through the Agent API.

type ModelObject

type ModelObject string

ModelObject The object type, which is always `model`.

const (
	ModelObjectModel ModelObject = "model"
)

Defines values for ModelObject.

func (ModelObject) Valid

func (e ModelObject) Valid() bool

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

type NamespaceTool

type NamespaceTool struct {
	Description string             `json:"description"`
	Name        string             `json:"name"`
	Tools       []NamespaceToolDef `json:"tools"`
	Type        NamespaceToolType  `json:"type"`
}

NamespaceTool A response-only namespace containing complete external tool definitions.

type NamespaceToolDef

type NamespaceToolDef struct {
	Description *string `json:"description,omitempty"`
	Name        string  `json:"name"`

	// Parameters The server's JSON Schema for the tool, passed through unmodified.
	Parameters *map[string]interface{} `json:"parameters,omitempty"`
	Type       NamespaceToolDefType    `json:"type"`
}

NamespaceToolDef One function definition discovered by hosted external-tool search.

type NamespaceToolDefType

type NamespaceToolDefType string

NamespaceToolDefType defines model for NamespaceToolDef.Type.

const (
	NamespaceToolDefTypeFunction NamespaceToolDefType = "function"
)

Defines values for NamespaceToolDefType.

func (NamespaceToolDefType) Valid

func (e NamespaceToolDefType) Valid() bool

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

type NamespaceToolType

type NamespaceToolType string

NamespaceToolType defines model for NamespaceTool.Type.

const (
	NamespaceToolTypeNamespace NamespaceToolType = "namespace"
)

Defines values for NamespaceToolType.

func (NamespaceToolType) Valid

func (e NamespaceToolType) Valid() bool

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

type NoulAnswer

type NoulAnswer struct {
	// Noul Probability of yes or true, from 0 to 1. Values near 0.5 mean the model is unsure.
	Noul float64 `json:"noul"`

	// Type Always `noul`.
	Type NoulAnswerType `json:"type"`
}

NoulAnswer Answer to a `noul` question: the probability that the answer is yes or the statement is true.

type NoulAnswerType

type NoulAnswerType string

NoulAnswerType Always `noul`.

const (
	NoulAnswerTypeNoul NoulAnswerType = "noul"
)

Defines values for NoulAnswerType.

func (NoulAnswerType) Valid

func (e NoulAnswerType) Valid() bool

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

type NoulCriteria

type NoulCriteria struct {
	// False What a no answer means for this question.
	False *NoulCriteria_False `json:"false,omitempty"`

	// True What a yes answer means for this question.
	True *NoulCriteria_True `json:"true,omitempty"`
}

NoulCriteria Optional definitions of what counts as yes and what counts as no.

type NoulCriteriaFalse0

type NoulCriteriaFalse0 = string

NoulCriteriaFalse0 defines model for NoulCriteria.False.0.

type NoulCriteriaFalse1

type NoulCriteriaFalse1 map[string]interface{}

NoulCriteriaFalse1 defines model for NoulCriteria.False.1.

type NoulCriteriaFalse2

type NoulCriteriaFalse2 = []interface{}

NoulCriteriaFalse2 defines model for NoulCriteria.False.2.

type NoulCriteriaTrue0

type NoulCriteriaTrue0 = string

NoulCriteriaTrue0 defines model for NoulCriteria.True.0.

type NoulCriteriaTrue1

type NoulCriteriaTrue1 map[string]interface{}

NoulCriteriaTrue1 defines model for NoulCriteria.True.1.

type NoulCriteriaTrue2

type NoulCriteriaTrue2 = []interface{}

NoulCriteriaTrue2 defines model for NoulCriteria.True.2.

type NoulCriteria_False

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

NoulCriteria_False What a no answer means for this question.

func (NoulCriteria_False) AsNoulCriteriaFalse0

func (t NoulCriteria_False) AsNoulCriteriaFalse0() (NoulCriteriaFalse0, error)

AsNoulCriteriaFalse0 returns the union data inside the NoulCriteria_False as a NoulCriteriaFalse0

func (NoulCriteria_False) AsNoulCriteriaFalse1

func (t NoulCriteria_False) AsNoulCriteriaFalse1() (NoulCriteriaFalse1, error)

AsNoulCriteriaFalse1 returns the union data inside the NoulCriteria_False as a NoulCriteriaFalse1

func (NoulCriteria_False) AsNoulCriteriaFalse2

func (t NoulCriteria_False) AsNoulCriteriaFalse2() (NoulCriteriaFalse2, error)

AsNoulCriteriaFalse2 returns the union data inside the NoulCriteria_False as a NoulCriteriaFalse2

func (*NoulCriteria_False) FromNoulCriteriaFalse0

func (t *NoulCriteria_False) FromNoulCriteriaFalse0(v NoulCriteriaFalse0) error

FromNoulCriteriaFalse0 overwrites any union data inside the NoulCriteria_False as the provided NoulCriteriaFalse0

func (*NoulCriteria_False) FromNoulCriteriaFalse1

func (t *NoulCriteria_False) FromNoulCriteriaFalse1(v NoulCriteriaFalse1) error

FromNoulCriteriaFalse1 overwrites any union data inside the NoulCriteria_False as the provided NoulCriteriaFalse1

func (*NoulCriteria_False) FromNoulCriteriaFalse2

func (t *NoulCriteria_False) FromNoulCriteriaFalse2(v NoulCriteriaFalse2) error

FromNoulCriteriaFalse2 overwrites any union data inside the NoulCriteria_False as the provided NoulCriteriaFalse2

func (NoulCriteria_False) MarshalJSON

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

func (*NoulCriteria_False) MergeNoulCriteriaFalse0

func (t *NoulCriteria_False) MergeNoulCriteriaFalse0(v NoulCriteriaFalse0) error

MergeNoulCriteriaFalse0 performs a merge with any union data inside the NoulCriteria_False, using the provided NoulCriteriaFalse0

func (*NoulCriteria_False) MergeNoulCriteriaFalse1

func (t *NoulCriteria_False) MergeNoulCriteriaFalse1(v NoulCriteriaFalse1) error

MergeNoulCriteriaFalse1 performs a merge with any union data inside the NoulCriteria_False, using the provided NoulCriteriaFalse1

func (*NoulCriteria_False) MergeNoulCriteriaFalse2

func (t *NoulCriteria_False) MergeNoulCriteriaFalse2(v NoulCriteriaFalse2) error

MergeNoulCriteriaFalse2 performs a merge with any union data inside the NoulCriteria_False, using the provided NoulCriteriaFalse2

func (*NoulCriteria_False) UnmarshalJSON

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

type NoulCriteria_True

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

NoulCriteria_True What a yes answer means for this question.

func (NoulCriteria_True) AsNoulCriteriaTrue0

func (t NoulCriteria_True) AsNoulCriteriaTrue0() (NoulCriteriaTrue0, error)

AsNoulCriteriaTrue0 returns the union data inside the NoulCriteria_True as a NoulCriteriaTrue0

func (NoulCriteria_True) AsNoulCriteriaTrue1

func (t NoulCriteria_True) AsNoulCriteriaTrue1() (NoulCriteriaTrue1, error)

AsNoulCriteriaTrue1 returns the union data inside the NoulCriteria_True as a NoulCriteriaTrue1

func (NoulCriteria_True) AsNoulCriteriaTrue2

func (t NoulCriteria_True) AsNoulCriteriaTrue2() (NoulCriteriaTrue2, error)

AsNoulCriteriaTrue2 returns the union data inside the NoulCriteria_True as a NoulCriteriaTrue2

func (*NoulCriteria_True) FromNoulCriteriaTrue0

func (t *NoulCriteria_True) FromNoulCriteriaTrue0(v NoulCriteriaTrue0) error

FromNoulCriteriaTrue0 overwrites any union data inside the NoulCriteria_True as the provided NoulCriteriaTrue0

func (*NoulCriteria_True) FromNoulCriteriaTrue1

func (t *NoulCriteria_True) FromNoulCriteriaTrue1(v NoulCriteriaTrue1) error

FromNoulCriteriaTrue1 overwrites any union data inside the NoulCriteria_True as the provided NoulCriteriaTrue1

func (*NoulCriteria_True) FromNoulCriteriaTrue2

func (t *NoulCriteria_True) FromNoulCriteriaTrue2(v NoulCriteriaTrue2) error

FromNoulCriteriaTrue2 overwrites any union data inside the NoulCriteria_True as the provided NoulCriteriaTrue2

func (NoulCriteria_True) MarshalJSON

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

func (*NoulCriteria_True) MergeNoulCriteriaTrue0

func (t *NoulCriteria_True) MergeNoulCriteriaTrue0(v NoulCriteriaTrue0) error

MergeNoulCriteriaTrue0 performs a merge with any union data inside the NoulCriteria_True, using the provided NoulCriteriaTrue0

func (*NoulCriteria_True) MergeNoulCriteriaTrue1

func (t *NoulCriteria_True) MergeNoulCriteriaTrue1(v NoulCriteriaTrue1) error

MergeNoulCriteriaTrue1 performs a merge with any union data inside the NoulCriteria_True, using the provided NoulCriteriaTrue1

func (*NoulCriteria_True) MergeNoulCriteriaTrue2

func (t *NoulCriteria_True) MergeNoulCriteriaTrue2(v NoulCriteriaTrue2) error

MergeNoulCriteriaTrue2 performs a merge with any union data inside the NoulCriteria_True, using the provided NoulCriteriaTrue2

func (*NoulCriteria_True) UnmarshalJSON

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

type NoulQuestion

type NoulQuestion struct {
	// Criteria Optional definitions of yes and no. Required unless `instructions` is set.
	Criteria *NoulCriteria `json:"criteria,omitempty"`

	// Instructions The question to answer or the statement to check. Required unless `criteria` is set.
	Instructions *NoulQuestion_Instructions `json:"instructions,omitempty"`

	// Type Always `noul`.
	Type NoulQuestionType `json:"type"`
}

NoulQuestion A yes/no question, or a statement to check, answered with the probability of yes or true.

type NoulQuestionInstructions0

type NoulQuestionInstructions0 = string

NoulQuestionInstructions0 defines model for NoulQuestion.Instructions.0.

type NoulQuestionInstructions1

type NoulQuestionInstructions1 map[string]interface{}

NoulQuestionInstructions1 defines model for NoulQuestion.Instructions.1.

type NoulQuestionInstructions2

type NoulQuestionInstructions2 = []interface{}

NoulQuestionInstructions2 defines model for NoulQuestion.Instructions.2.

type NoulQuestionType

type NoulQuestionType string

NoulQuestionType Always `noul`.

const (
	NoulQuestionTypeNoul NoulQuestionType = "noul"
)

Defines values for NoulQuestionType.

func (NoulQuestionType) Valid

func (e NoulQuestionType) Valid() bool

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

type NoulQuestion_Instructions

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

NoulQuestion_Instructions The question to answer or the statement to check. Required unless `criteria` is set.

func (NoulQuestion_Instructions) AsNoulQuestionInstructions0

func (t NoulQuestion_Instructions) AsNoulQuestionInstructions0() (NoulQuestionInstructions0, error)

AsNoulQuestionInstructions0 returns the union data inside the NoulQuestion_Instructions as a NoulQuestionInstructions0

func (NoulQuestion_Instructions) AsNoulQuestionInstructions1

func (t NoulQuestion_Instructions) AsNoulQuestionInstructions1() (NoulQuestionInstructions1, error)

AsNoulQuestionInstructions1 returns the union data inside the NoulQuestion_Instructions as a NoulQuestionInstructions1

func (NoulQuestion_Instructions) AsNoulQuestionInstructions2

func (t NoulQuestion_Instructions) AsNoulQuestionInstructions2() (NoulQuestionInstructions2, error)

AsNoulQuestionInstructions2 returns the union data inside the NoulQuestion_Instructions as a NoulQuestionInstructions2

func (*NoulQuestion_Instructions) FromNoulQuestionInstructions0

func (t *NoulQuestion_Instructions) FromNoulQuestionInstructions0(v NoulQuestionInstructions0) error

FromNoulQuestionInstructions0 overwrites any union data inside the NoulQuestion_Instructions as the provided NoulQuestionInstructions0

func (*NoulQuestion_Instructions) FromNoulQuestionInstructions1

func (t *NoulQuestion_Instructions) FromNoulQuestionInstructions1(v NoulQuestionInstructions1) error

FromNoulQuestionInstructions1 overwrites any union data inside the NoulQuestion_Instructions as the provided NoulQuestionInstructions1

func (*NoulQuestion_Instructions) FromNoulQuestionInstructions2

func (t *NoulQuestion_Instructions) FromNoulQuestionInstructions2(v NoulQuestionInstructions2) error

FromNoulQuestionInstructions2 overwrites any union data inside the NoulQuestion_Instructions as the provided NoulQuestionInstructions2

func (NoulQuestion_Instructions) MarshalJSON

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

func (*NoulQuestion_Instructions) MergeNoulQuestionInstructions0

func (t *NoulQuestion_Instructions) MergeNoulQuestionInstructions0(v NoulQuestionInstructions0) error

MergeNoulQuestionInstructions0 performs a merge with any union data inside the NoulQuestion_Instructions, using the provided NoulQuestionInstructions0

func (*NoulQuestion_Instructions) MergeNoulQuestionInstructions1

func (t *NoulQuestion_Instructions) MergeNoulQuestionInstructions1(v NoulQuestionInstructions1) error

MergeNoulQuestionInstructions1 performs a merge with any union data inside the NoulQuestion_Instructions, using the provided NoulQuestionInstructions1

func (*NoulQuestion_Instructions) MergeNoulQuestionInstructions2

func (t *NoulQuestion_Instructions) MergeNoulQuestionInstructions2(v NoulQuestionInstructions2) error

MergeNoulQuestionInstructions2 performs a merge with any union data inside the NoulQuestion_Instructions, using the provided NoulQuestionInstructions2

func (*NoulQuestion_Instructions) UnmarshalJSON

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

type OutputItem

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

OutputItem defines model for OutputItem.

func (OutputItem) AsFetchUrlResultsOutputItem

func (t OutputItem) AsFetchUrlResultsOutputItem() (FetchUrlResultsOutputItem, error)

AsFetchUrlResultsOutputItem returns the union data inside the OutputItem as a FetchUrlResultsOutputItem

func (OutputItem) AsFinanceResultsOutputItem

func (t OutputItem) AsFinanceResultsOutputItem() (FinanceResultsOutputItem, error)

AsFinanceResultsOutputItem returns the union data inside the OutputItem as a FinanceResultsOutputItem

func (OutputItem) AsFunctionCallOutputItem

func (t OutputItem) AsFunctionCallOutputItem() (FunctionCallOutputItem, error)

AsFunctionCallOutputItem returns the union data inside the OutputItem as a FunctionCallOutputItem

func (OutputItem) AsImageSearchResultsOutputItem

func (t OutputItem) AsImageSearchResultsOutputItem() (ImageSearchResultsOutputItem, error)

AsImageSearchResultsOutputItem returns the union data inside the OutputItem as a ImageSearchResultsOutputItem

func (OutputItem) AsMcpApprovalRequestOutputItem

func (t OutputItem) AsMcpApprovalRequestOutputItem() (McpApprovalRequestOutputItem, error)

AsMcpApprovalRequestOutputItem returns the union data inside the OutputItem as a McpApprovalRequestOutputItem

func (OutputItem) AsMcpCallOutputItem

func (t OutputItem) AsMcpCallOutputItem() (McpCallOutputItem, error)

AsMcpCallOutputItem returns the union data inside the OutputItem as a McpCallOutputItem

func (OutputItem) AsMcpListToolsOutputItem

func (t OutputItem) AsMcpListToolsOutputItem() (McpListToolsOutputItem, error)

AsMcpListToolsOutputItem returns the union data inside the OutputItem as a McpListToolsOutputItem

func (OutputItem) AsMessageOutputItem

func (t OutputItem) AsMessageOutputItem() (MessageOutputItem, error)

AsMessageOutputItem returns the union data inside the OutputItem as a MessageOutputItem

func (OutputItem) AsPeopleSearchResultsOutputItem

func (t OutputItem) AsPeopleSearchResultsOutputItem() (PeopleSearchResultsOutputItem, error)

AsPeopleSearchResultsOutputItem returns the union data inside the OutputItem as a PeopleSearchResultsOutputItem

func (OutputItem) AsSandboxResultsOutputItem

func (t OutputItem) AsSandboxResultsOutputItem() (SandboxResultsOutputItem, error)

AsSandboxResultsOutputItem returns the union data inside the OutputItem as a SandboxResultsOutputItem

func (OutputItem) AsSearchResultsOutputItem

func (t OutputItem) AsSearchResultsOutputItem() (SearchResultsOutputItem, error)

AsSearchResultsOutputItem returns the union data inside the OutputItem as a SearchResultsOutputItem

func (OutputItem) AsToolSearchOutputItem

func (t OutputItem) AsToolSearchOutputItem() (ToolSearchOutputItem, error)

AsToolSearchOutputItem returns the union data inside the OutputItem as a ToolSearchOutputItem

func (OutputItem) Discriminator

func (t OutputItem) Discriminator() (string, error)

func (*OutputItem) FromFetchUrlResultsOutputItem

func (t *OutputItem) FromFetchUrlResultsOutputItem(v FetchUrlResultsOutputItem) error

FromFetchUrlResultsOutputItem overwrites any union data inside the OutputItem as the provided FetchUrlResultsOutputItem

func (*OutputItem) FromFinanceResultsOutputItem

func (t *OutputItem) FromFinanceResultsOutputItem(v FinanceResultsOutputItem) error

FromFinanceResultsOutputItem overwrites any union data inside the OutputItem as the provided FinanceResultsOutputItem

func (*OutputItem) FromFunctionCallOutputItem

func (t *OutputItem) FromFunctionCallOutputItem(v FunctionCallOutputItem) error

FromFunctionCallOutputItem overwrites any union data inside the OutputItem as the provided FunctionCallOutputItem

func (*OutputItem) FromImageSearchResultsOutputItem

func (t *OutputItem) FromImageSearchResultsOutputItem(v ImageSearchResultsOutputItem) error

FromImageSearchResultsOutputItem overwrites any union data inside the OutputItem as the provided ImageSearchResultsOutputItem

func (*OutputItem) FromMcpApprovalRequestOutputItem

func (t *OutputItem) FromMcpApprovalRequestOutputItem(v McpApprovalRequestOutputItem) error

FromMcpApprovalRequestOutputItem overwrites any union data inside the OutputItem as the provided McpApprovalRequestOutputItem

func (*OutputItem) FromMcpCallOutputItem

func (t *OutputItem) FromMcpCallOutputItem(v McpCallOutputItem) error

FromMcpCallOutputItem overwrites any union data inside the OutputItem as the provided McpCallOutputItem

func (*OutputItem) FromMcpListToolsOutputItem

func (t *OutputItem) FromMcpListToolsOutputItem(v McpListToolsOutputItem) error

FromMcpListToolsOutputItem overwrites any union data inside the OutputItem as the provided McpListToolsOutputItem

func (*OutputItem) FromMessageOutputItem

func (t *OutputItem) FromMessageOutputItem(v MessageOutputItem) error

FromMessageOutputItem overwrites any union data inside the OutputItem as the provided MessageOutputItem

func (*OutputItem) FromPeopleSearchResultsOutputItem

func (t *OutputItem) FromPeopleSearchResultsOutputItem(v PeopleSearchResultsOutputItem) error

FromPeopleSearchResultsOutputItem overwrites any union data inside the OutputItem as the provided PeopleSearchResultsOutputItem

func (*OutputItem) FromSandboxResultsOutputItem

func (t *OutputItem) FromSandboxResultsOutputItem(v SandboxResultsOutputItem) error

FromSandboxResultsOutputItem overwrites any union data inside the OutputItem as the provided SandboxResultsOutputItem

func (*OutputItem) FromSearchResultsOutputItem

func (t *OutputItem) FromSearchResultsOutputItem(v SearchResultsOutputItem) error

FromSearchResultsOutputItem overwrites any union data inside the OutputItem as the provided SearchResultsOutputItem

func (*OutputItem) FromToolSearchOutputItem

func (t *OutputItem) FromToolSearchOutputItem(v ToolSearchOutputItem) error

FromToolSearchOutputItem overwrites any union data inside the OutputItem as the provided ToolSearchOutputItem

func (OutputItem) MarshalJSON

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

func (*OutputItem) MergeFetchUrlResultsOutputItem

func (t *OutputItem) MergeFetchUrlResultsOutputItem(v FetchUrlResultsOutputItem) error

MergeFetchUrlResultsOutputItem performs a merge with any union data inside the OutputItem, using the provided FetchUrlResultsOutputItem

func (*OutputItem) MergeFinanceResultsOutputItem

func (t *OutputItem) MergeFinanceResultsOutputItem(v FinanceResultsOutputItem) error

MergeFinanceResultsOutputItem performs a merge with any union data inside the OutputItem, using the provided FinanceResultsOutputItem

func (*OutputItem) MergeFunctionCallOutputItem

func (t *OutputItem) MergeFunctionCallOutputItem(v FunctionCallOutputItem) error

MergeFunctionCallOutputItem performs a merge with any union data inside the OutputItem, using the provided FunctionCallOutputItem

func (*OutputItem) MergeImageSearchResultsOutputItem

func (t *OutputItem) MergeImageSearchResultsOutputItem(v ImageSearchResultsOutputItem) error

MergeImageSearchResultsOutputItem performs a merge with any union data inside the OutputItem, using the provided ImageSearchResultsOutputItem

func (*OutputItem) MergeMcpApprovalRequestOutputItem

func (t *OutputItem) MergeMcpApprovalRequestOutputItem(v McpApprovalRequestOutputItem) error

MergeMcpApprovalRequestOutputItem performs a merge with any union data inside the OutputItem, using the provided McpApprovalRequestOutputItem

func (*OutputItem) MergeMcpCallOutputItem

func (t *OutputItem) MergeMcpCallOutputItem(v McpCallOutputItem) error

MergeMcpCallOutputItem performs a merge with any union data inside the OutputItem, using the provided McpCallOutputItem

func (*OutputItem) MergeMcpListToolsOutputItem

func (t *OutputItem) MergeMcpListToolsOutputItem(v McpListToolsOutputItem) error

MergeMcpListToolsOutputItem performs a merge with any union data inside the OutputItem, using the provided McpListToolsOutputItem

func (*OutputItem) MergeMessageOutputItem

func (t *OutputItem) MergeMessageOutputItem(v MessageOutputItem) error

MergeMessageOutputItem performs a merge with any union data inside the OutputItem, using the provided MessageOutputItem

func (*OutputItem) MergePeopleSearchResultsOutputItem

func (t *OutputItem) MergePeopleSearchResultsOutputItem(v PeopleSearchResultsOutputItem) error

MergePeopleSearchResultsOutputItem performs a merge with any union data inside the OutputItem, using the provided PeopleSearchResultsOutputItem

func (*OutputItem) MergeSandboxResultsOutputItem

func (t *OutputItem) MergeSandboxResultsOutputItem(v SandboxResultsOutputItem) error

MergeSandboxResultsOutputItem performs a merge with any union data inside the OutputItem, using the provided SandboxResultsOutputItem

func (*OutputItem) MergeSearchResultsOutputItem

func (t *OutputItem) MergeSearchResultsOutputItem(v SearchResultsOutputItem) error

MergeSearchResultsOutputItem performs a merge with any union data inside the OutputItem, using the provided SearchResultsOutputItem

func (*OutputItem) MergeToolSearchOutputItem

func (t *OutputItem) MergeToolSearchOutputItem(v ToolSearchOutputItem) error

MergeToolSearchOutputItem performs a merge with any union data inside the OutputItem, using the provided ToolSearchOutputItem

func (*OutputItem) UnmarshalJSON

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

func (OutputItem) ValueByDiscriminator

func (t OutputItem) ValueByDiscriminator() (interface{}, error)

type OutputItemAddedEvent

type OutputItemAddedEvent struct {
	Item        OutputItem `json:"item"`
	OutputIndex int64      `json:"output_index"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64 `json:"sequence_number"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

OutputItemAddedEvent Output item added event (type: "response.output_item.added"). Emitted when a new output item (message or tool call) starts.

type OutputItemDoneEvent

type OutputItemDoneEvent struct {
	Item        OutputItem `json:"item"`
	OutputIndex int64      `json:"output_index"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64 `json:"sequence_number"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

OutputItemDoneEvent Output item done event (type: "response.output_item.done"). Emitted when an output item (message or tool call) completes.

type OutputTokensDetails

type OutputTokensDetails struct {
	ReasoningTokens int64 `json:"reasoning_tokens"`
}

OutputTokensDetails defines model for OutputTokensDetails.

type PageToken

type PageToken = string

PageToken defines model for PageToken.

type PayloadTooLarge

type PayloadTooLarge = ErrorResponse

PayloadTooLarge The body of an error response.

type PeopleSearchResultsOutputItem

type PeopleSearchResultsOutputItem struct {
	// Queries Search queries the agent generated for this people_search invocation.
	Queries *[]string `json:"queries,omitempty"`

	// Results Per-person result entries. Shape matches SearchResult (id, url, title, snippet, source, last_updated).
	Results []SearchResult                    `json:"results"`
	Type    PeopleSearchResultsOutputItemType `json:"type"`
}

PeopleSearchResultsOutputItem Intermediate output item emitted when the people_search tool runs. Mirrors the shape of search_results: the agent's generated queries plus a list of per-person result entries.

type PeopleSearchResultsOutputItemType

type PeopleSearchResultsOutputItemType string

PeopleSearchResultsOutputItemType defines model for PeopleSearchResultsOutputItem.Type.

const (
	PeopleSearchResultsOutputItemTypePeopleSearchResults PeopleSearchResultsOutputItemType = "people_search_results"
)

Defines values for PeopleSearchResultsOutputItemType.

func (PeopleSearchResultsOutputItemType) Valid

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

type PeopleSearchTool

type PeopleSearchTool struct {
	// Type Tool type identifier
	Type PeopleSearchToolType `json:"type"`
}

PeopleSearchTool People search tool configuration for the Agent API

type PeopleSearchToolType

type PeopleSearchToolType string

PeopleSearchToolType Tool type identifier

const (
	PeopleSearchToolTypePeopleSearch PeopleSearchToolType = "people_search"
)

Defines values for PeopleSearchToolType.

func (PeopleSearchToolType) Valid

func (e PeopleSearchToolType) Valid() bool

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

type ProfileReference

type ProfileReference struct {
	Id   string               `json:"id"`
	Type ProfileReferenceType `json:"type"`

	// Version Version to bind to, or "latest". Omitted means "latest".
	Version *string `json:"version,omitempty"`
}

ProfileReference defines model for ProfileReference.

type ProfileReferenceType

type ProfileReferenceType string

ProfileReferenceType defines model for ProfileReference.Type.

const (
	ProfileReferenceTypeCustom ProfileReferenceType = "custom"
)

Defines values for ProfileReferenceType.

func (ProfileReferenceType) Valid

func (e ProfileReferenceType) Valid() bool

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

type Question

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

Question A named question about `state`. Discriminated by `type`.

func (Question) AsChoiceQuestion

func (t Question) AsChoiceQuestion() (ChoiceQuestion, error)

AsChoiceQuestion returns the union data inside the Question as a ChoiceQuestion

func (Question) AsNoulQuestion

func (t Question) AsNoulQuestion() (NoulQuestion, error)

AsNoulQuestion returns the union data inside the Question as a NoulQuestion

func (Question) AsScoreQuestion

func (t Question) AsScoreQuestion() (ScoreQuestion, error)

AsScoreQuestion returns the union data inside the Question as a ScoreQuestion

func (Question) Discriminator

func (t Question) Discriminator() (string, error)

func (*Question) FromChoiceQuestion

func (t *Question) FromChoiceQuestion(v ChoiceQuestion) error

FromChoiceQuestion overwrites any union data inside the Question as the provided ChoiceQuestion

func (*Question) FromNoulQuestion

func (t *Question) FromNoulQuestion(v NoulQuestion) error

FromNoulQuestion overwrites any union data inside the Question as the provided NoulQuestion

func (*Question) FromScoreQuestion

func (t *Question) FromScoreQuestion(v ScoreQuestion) error

FromScoreQuestion overwrites any union data inside the Question as the provided ScoreQuestion

func (Question) MarshalJSON

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

func (*Question) MergeChoiceQuestion

func (t *Question) MergeChoiceQuestion(v ChoiceQuestion) error

MergeChoiceQuestion performs a merge with any union data inside the Question, using the provided ChoiceQuestion

func (*Question) MergeNoulQuestion

func (t *Question) MergeNoulQuestion(v NoulQuestion) error

MergeNoulQuestion performs a merge with any union data inside the Question, using the provided NoulQuestion

func (*Question) MergeScoreQuestion

func (t *Question) MergeScoreQuestion(v ScoreQuestion) error

MergeScoreQuestion performs a merge with any union data inside the Question, using the provided ScoreQuestion

func (*Question) UnmarshalJSON

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

func (Question) ValueByDiscriminator

func (t Question) ValueByDiscriminator() (interface{}, error)

type ReasoningConfig

type ReasoningConfig struct {
	// Effort How much effort the model should spend on reasoning
	Effort *ReasoningConfigEffort `json:"effort,omitempty"`
}

ReasoningConfig defines model for ReasoningConfig.

type ReasoningConfigEffort

type ReasoningConfigEffort string

ReasoningConfigEffort How much effort the model should spend on reasoning

const (
	ReasoningConfigEffortHigh    ReasoningConfigEffort = "high"
	ReasoningConfigEffortLow     ReasoningConfigEffort = "low"
	ReasoningConfigEffortMax     ReasoningConfigEffort = "max"
	ReasoningConfigEffortMedium  ReasoningConfigEffort = "medium"
	ReasoningConfigEffortMinimal ReasoningConfigEffort = "minimal"
	ReasoningConfigEffortXhigh   ReasoningConfigEffort = "xhigh"
)

Defines values for ReasoningConfigEffort.

func (ReasoningConfigEffort) Valid

func (e ReasoningConfigEffort) Valid() bool

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

type ReasoningStartedEvent

type ReasoningStartedEvent struct {
	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64   `json:"sequence_number"`
	Thought        *string `json:"thought,omitempty"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

ReasoningStartedEvent Reasoning started event (type: "response.reasoning.started"). Signals the model has started reasoning/searching.

type ReasoningStoppedEvent

type ReasoningStoppedEvent struct {
	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64   `json:"sequence_number"`
	Thought        *string `json:"thought,omitempty"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

ReasoningStoppedEvent Reasoning stopped event (type: "response.reasoning.stopped"). Signals the model has finished reasoning/searching.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RequireApproval

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

RequireApproval Approval policy for an MCP server or connector. A call matching `always` requires approval; otherwise a call matching `never` runs automatically; otherwise approval is required. Omitted or null behaves like `"never"`.

func (RequireApproval) AsApprovalFilters

func (t RequireApproval) AsApprovalFilters() (ApprovalFilters, error)

AsApprovalFilters returns the union data inside the RequireApproval as a ApprovalFilters

func (RequireApproval) AsRequireApproval0

func (t RequireApproval) AsRequireApproval0() (RequireApproval0, error)

AsRequireApproval0 returns the union data inside the RequireApproval as a RequireApproval0

func (*RequireApproval) FromApprovalFilters

func (t *RequireApproval) FromApprovalFilters(v ApprovalFilters) error

FromApprovalFilters overwrites any union data inside the RequireApproval as the provided ApprovalFilters

func (*RequireApproval) FromRequireApproval0

func (t *RequireApproval) FromRequireApproval0(v RequireApproval0) error

FromRequireApproval0 overwrites any union data inside the RequireApproval as the provided RequireApproval0

func (RequireApproval) MarshalJSON

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

func (*RequireApproval) MergeApprovalFilters

func (t *RequireApproval) MergeApprovalFilters(v ApprovalFilters) error

MergeApprovalFilters performs a merge with any union data inside the RequireApproval, using the provided ApprovalFilters

func (*RequireApproval) MergeRequireApproval0

func (t *RequireApproval) MergeRequireApproval0(v RequireApproval0) error

MergeRequireApproval0 performs a merge with any union data inside the RequireApproval, using the provided RequireApproval0

func (*RequireApproval) UnmarshalJSON

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

type RequireApproval0

type RequireApproval0 string

RequireApproval0 defines model for RequireApproval.0.

const (
	RequireApproval0Always RequireApproval0 = "always"
	RequireApproval0Never  RequireApproval0 = "never"
)

Defines values for RequireApproval0.

func (RequireApproval0) Valid

func (e RequireApproval0) Valid() bool

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

type ResponseCompletedEvent

type ResponseCompletedEvent struct {
	// Response Non-streaming response returned when stream is false
	Response *ResponsesResponse `json:"response,omitempty"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64 `json:"sequence_number"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

ResponseCompletedEvent Response event Contains the full or partial response object.

type ResponseCreatedEvent

type ResponseCreatedEvent struct {
	// Response Non-streaming response returned when stream is false
	Response *ResponsesResponse `json:"response,omitempty"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64 `json:"sequence_number"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

ResponseCreatedEvent Response created event (type: "response.created"). Contains the initial response object.

type ResponseFailedEvent

type ResponseFailedEvent struct {
	// Error Error information returned when a request fails
	Error ErrorInfo `json:"error"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64 `json:"sequence_number"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

ResponseFailedEvent Response failed event (type: "response.failed"). Contains error details when streaming fails.

type ResponseFile

type ResponseFile struct {
	// Bytes File size in bytes.
	Bytes int64 `json:"bytes"`

	// CreatedAt Unix timestamp when the file was created.
	CreatedAt int64 `json:"created_at"`

	// Filename Name the sandbox gave the file.
	Filename string `json:"filename"`

	// Id File identifier, used to download the file; distinct from the response id.
	Id string `json:"id"`

	// Object Always `file`.
	Object string `json:"object"`
}

ResponseFile One file shared from a response's sandbox via `share_file`.

type ResponseFileList

type ResponseFileList struct {
	Data []ResponseFile `json:"data"`

	// Object Always `list`.
	Object string `json:"object"`
}

ResponseFileList defines model for ResponseFileList.

type ResponseFormat

type ResponseFormat struct {
	// JsonSchema Defines a JSON schema for structured output validation
	JsonSchema *JSONSchemaFormat `json:"json_schema,omitempty"`

	// Type The type of response format
	Type ResponseFormatType `json:"type"`
}

ResponseFormat Specifies the desired output format for the model response

type ResponseFormatJSONSchema

type ResponseFormatJSONSchema struct {
	JsonSchema JSONSchema `json:"json_schema"`

	// Type Must be `json_schema`.
	Type ResponseFormatJSONSchemaType `json:"type"`
}

ResponseFormatJSONSchema Constrains the model output to match the provided JSON schema.

type ResponseFormatJSONSchemaType

type ResponseFormatJSONSchemaType string

ResponseFormatJSONSchemaType Must be `json_schema`.

const (
	ResponseFormatJSONSchemaTypeJsonSchema ResponseFormatJSONSchemaType = "json_schema"
)

Defines values for ResponseFormatJSONSchemaType.

func (ResponseFormatJSONSchemaType) Valid

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

type ResponseFormatText

type ResponseFormatText struct {
	// Type Must be `text`.
	Type ResponseFormatTextType `json:"type"`
}

ResponseFormatText defines model for ResponseFormatText.

type ResponseFormatTextType

type ResponseFormatTextType string

ResponseFormatTextType Must be `text`.

const (
	ResponseFormatTextTypeText ResponseFormatTextType = "text"
)

Defines values for ResponseFormatTextType.

func (ResponseFormatTextType) Valid

func (e ResponseFormatTextType) Valid() bool

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

type ResponseFormatType

type ResponseFormatType string

ResponseFormatType The type of response format

const (
	ResponseFormatTypeJsonSchema ResponseFormatType = "json_schema"
)

Defines values for ResponseFormatType.

func (ResponseFormatType) Valid

func (e ResponseFormatType) Valid() bool

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

type ResponseInProgressEvent

type ResponseInProgressEvent struct {
	// Response Non-streaming response returned when stream is false
	Response *ResponsesResponse `json:"response,omitempty"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64 `json:"sequence_number"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

ResponseInProgressEvent Response in progress event (type: "response.in_progress"). Emitted when response processing has started.

type ResponseStreamEvent

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

ResponseStreamEvent SSE stream event. Discriminate by the `type` field: - `response.created`: Initial response object - `response.in_progress`: Response processing started - `response.completed`: Final response with output - `response.failed`: Error occurred - `response.output_item.added`: New output item started - `response.output_item.done`: Output item completed - `response.output_text.delta`: Streaming text delta - `response.output_text.done`: Final text content - `response.reasoning.started`: Reasoning phase started - `response.reasoning.search_queries`: Search queries issued - `response.reasoning.search_results`: Search results received - `response.reasoning.image_search_queries`: Image queries issued - `response.reasoning.image_search_results`: Image results received - `response.reasoning.fetch_url_queries`: URL fetch queries issued - `response.reasoning.fetch_url_results`: URL fetch results received - `response.reasoning.stopped`: Reasoning phase complete

func (ResponseStreamEvent) AsFetchUrlQueriesEvent

func (t ResponseStreamEvent) AsFetchUrlQueriesEvent() (FetchUrlQueriesEvent, error)

AsFetchUrlQueriesEvent returns the union data inside the ResponseStreamEvent as a FetchUrlQueriesEvent

func (ResponseStreamEvent) AsFetchUrlResultsEvent

func (t ResponseStreamEvent) AsFetchUrlResultsEvent() (FetchUrlResultsEvent, error)

AsFetchUrlResultsEvent returns the union data inside the ResponseStreamEvent as a FetchUrlResultsEvent

func (ResponseStreamEvent) AsImageSearchQueriesEvent

func (t ResponseStreamEvent) AsImageSearchQueriesEvent() (ImageSearchQueriesEvent, error)

AsImageSearchQueriesEvent returns the union data inside the ResponseStreamEvent as a ImageSearchQueriesEvent

func (ResponseStreamEvent) AsImageSearchResultsEvent

func (t ResponseStreamEvent) AsImageSearchResultsEvent() (ImageSearchResultsEvent, error)

AsImageSearchResultsEvent returns the union data inside the ResponseStreamEvent as a ImageSearchResultsEvent

func (ResponseStreamEvent) AsOutputItemAddedEvent

func (t ResponseStreamEvent) AsOutputItemAddedEvent() (OutputItemAddedEvent, error)

AsOutputItemAddedEvent returns the union data inside the ResponseStreamEvent as a OutputItemAddedEvent

func (ResponseStreamEvent) AsOutputItemDoneEvent

func (t ResponseStreamEvent) AsOutputItemDoneEvent() (OutputItemDoneEvent, error)

AsOutputItemDoneEvent returns the union data inside the ResponseStreamEvent as a OutputItemDoneEvent

func (ResponseStreamEvent) AsReasoningStartedEvent

func (t ResponseStreamEvent) AsReasoningStartedEvent() (ReasoningStartedEvent, error)

AsReasoningStartedEvent returns the union data inside the ResponseStreamEvent as a ReasoningStartedEvent

func (ResponseStreamEvent) AsReasoningStoppedEvent

func (t ResponseStreamEvent) AsReasoningStoppedEvent() (ReasoningStoppedEvent, error)

AsReasoningStoppedEvent returns the union data inside the ResponseStreamEvent as a ReasoningStoppedEvent

func (ResponseStreamEvent) AsResponseCompletedEvent

func (t ResponseStreamEvent) AsResponseCompletedEvent() (ResponseCompletedEvent, error)

AsResponseCompletedEvent returns the union data inside the ResponseStreamEvent as a ResponseCompletedEvent

func (ResponseStreamEvent) AsResponseCreatedEvent

func (t ResponseStreamEvent) AsResponseCreatedEvent() (ResponseCreatedEvent, error)

AsResponseCreatedEvent returns the union data inside the ResponseStreamEvent as a ResponseCreatedEvent

func (ResponseStreamEvent) AsResponseFailedEvent

func (t ResponseStreamEvent) AsResponseFailedEvent() (ResponseFailedEvent, error)

AsResponseFailedEvent returns the union data inside the ResponseStreamEvent as a ResponseFailedEvent

func (ResponseStreamEvent) AsResponseInProgressEvent

func (t ResponseStreamEvent) AsResponseInProgressEvent() (ResponseInProgressEvent, error)

AsResponseInProgressEvent returns the union data inside the ResponseStreamEvent as a ResponseInProgressEvent

func (ResponseStreamEvent) AsSearchQueriesEvent

func (t ResponseStreamEvent) AsSearchQueriesEvent() (SearchQueriesEvent, error)

AsSearchQueriesEvent returns the union data inside the ResponseStreamEvent as a SearchQueriesEvent

func (ResponseStreamEvent) AsSearchResultsEvent

func (t ResponseStreamEvent) AsSearchResultsEvent() (SearchResultsEvent, error)

AsSearchResultsEvent returns the union data inside the ResponseStreamEvent as a SearchResultsEvent

func (ResponseStreamEvent) AsTextDeltaEvent

func (t ResponseStreamEvent) AsTextDeltaEvent() (TextDeltaEvent, error)

AsTextDeltaEvent returns the union data inside the ResponseStreamEvent as a TextDeltaEvent

func (ResponseStreamEvent) AsTextDoneEvent

func (t ResponseStreamEvent) AsTextDoneEvent() (TextDoneEvent, error)

AsTextDoneEvent returns the union data inside the ResponseStreamEvent as a TextDoneEvent

func (ResponseStreamEvent) Discriminator

func (t ResponseStreamEvent) Discriminator() (string, error)

func (*ResponseStreamEvent) FromFetchUrlQueriesEvent

func (t *ResponseStreamEvent) FromFetchUrlQueriesEvent(v FetchUrlQueriesEvent) error

FromFetchUrlQueriesEvent overwrites any union data inside the ResponseStreamEvent as the provided FetchUrlQueriesEvent

func (*ResponseStreamEvent) FromFetchUrlResultsEvent

func (t *ResponseStreamEvent) FromFetchUrlResultsEvent(v FetchUrlResultsEvent) error

FromFetchUrlResultsEvent overwrites any union data inside the ResponseStreamEvent as the provided FetchUrlResultsEvent

func (*ResponseStreamEvent) FromImageSearchQueriesEvent

func (t *ResponseStreamEvent) FromImageSearchQueriesEvent(v ImageSearchQueriesEvent) error

FromImageSearchQueriesEvent overwrites any union data inside the ResponseStreamEvent as the provided ImageSearchQueriesEvent

func (*ResponseStreamEvent) FromImageSearchResultsEvent

func (t *ResponseStreamEvent) FromImageSearchResultsEvent(v ImageSearchResultsEvent) error

FromImageSearchResultsEvent overwrites any union data inside the ResponseStreamEvent as the provided ImageSearchResultsEvent

func (*ResponseStreamEvent) FromOutputItemAddedEvent

func (t *ResponseStreamEvent) FromOutputItemAddedEvent(v OutputItemAddedEvent) error

FromOutputItemAddedEvent overwrites any union data inside the ResponseStreamEvent as the provided OutputItemAddedEvent

func (*ResponseStreamEvent) FromOutputItemDoneEvent

func (t *ResponseStreamEvent) FromOutputItemDoneEvent(v OutputItemDoneEvent) error

FromOutputItemDoneEvent overwrites any union data inside the ResponseStreamEvent as the provided OutputItemDoneEvent

func (*ResponseStreamEvent) FromReasoningStartedEvent

func (t *ResponseStreamEvent) FromReasoningStartedEvent(v ReasoningStartedEvent) error

FromReasoningStartedEvent overwrites any union data inside the ResponseStreamEvent as the provided ReasoningStartedEvent

func (*ResponseStreamEvent) FromReasoningStoppedEvent

func (t *ResponseStreamEvent) FromReasoningStoppedEvent(v ReasoningStoppedEvent) error

FromReasoningStoppedEvent overwrites any union data inside the ResponseStreamEvent as the provided ReasoningStoppedEvent

func (*ResponseStreamEvent) FromResponseCompletedEvent

func (t *ResponseStreamEvent) FromResponseCompletedEvent(v ResponseCompletedEvent) error

FromResponseCompletedEvent overwrites any union data inside the ResponseStreamEvent as the provided ResponseCompletedEvent

func (*ResponseStreamEvent) FromResponseCreatedEvent

func (t *ResponseStreamEvent) FromResponseCreatedEvent(v ResponseCreatedEvent) error

FromResponseCreatedEvent overwrites any union data inside the ResponseStreamEvent as the provided ResponseCreatedEvent

func (*ResponseStreamEvent) FromResponseFailedEvent

func (t *ResponseStreamEvent) FromResponseFailedEvent(v ResponseFailedEvent) error

FromResponseFailedEvent overwrites any union data inside the ResponseStreamEvent as the provided ResponseFailedEvent

func (*ResponseStreamEvent) FromResponseInProgressEvent

func (t *ResponseStreamEvent) FromResponseInProgressEvent(v ResponseInProgressEvent) error

FromResponseInProgressEvent overwrites any union data inside the ResponseStreamEvent as the provided ResponseInProgressEvent

func (*ResponseStreamEvent) FromSearchQueriesEvent

func (t *ResponseStreamEvent) FromSearchQueriesEvent(v SearchQueriesEvent) error

FromSearchQueriesEvent overwrites any union data inside the ResponseStreamEvent as the provided SearchQueriesEvent

func (*ResponseStreamEvent) FromSearchResultsEvent

func (t *ResponseStreamEvent) FromSearchResultsEvent(v SearchResultsEvent) error

FromSearchResultsEvent overwrites any union data inside the ResponseStreamEvent as the provided SearchResultsEvent

func (*ResponseStreamEvent) FromTextDeltaEvent

func (t *ResponseStreamEvent) FromTextDeltaEvent(v TextDeltaEvent) error

FromTextDeltaEvent overwrites any union data inside the ResponseStreamEvent as the provided TextDeltaEvent

func (*ResponseStreamEvent) FromTextDoneEvent

func (t *ResponseStreamEvent) FromTextDoneEvent(v TextDoneEvent) error

FromTextDoneEvent overwrites any union data inside the ResponseStreamEvent as the provided TextDoneEvent

func (ResponseStreamEvent) MarshalJSON

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

func (*ResponseStreamEvent) MergeFetchUrlQueriesEvent

func (t *ResponseStreamEvent) MergeFetchUrlQueriesEvent(v FetchUrlQueriesEvent) error

MergeFetchUrlQueriesEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided FetchUrlQueriesEvent

func (*ResponseStreamEvent) MergeFetchUrlResultsEvent

func (t *ResponseStreamEvent) MergeFetchUrlResultsEvent(v FetchUrlResultsEvent) error

MergeFetchUrlResultsEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided FetchUrlResultsEvent

func (*ResponseStreamEvent) MergeImageSearchQueriesEvent

func (t *ResponseStreamEvent) MergeImageSearchQueriesEvent(v ImageSearchQueriesEvent) error

MergeImageSearchQueriesEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided ImageSearchQueriesEvent

func (*ResponseStreamEvent) MergeImageSearchResultsEvent

func (t *ResponseStreamEvent) MergeImageSearchResultsEvent(v ImageSearchResultsEvent) error

MergeImageSearchResultsEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided ImageSearchResultsEvent

func (*ResponseStreamEvent) MergeOutputItemAddedEvent

func (t *ResponseStreamEvent) MergeOutputItemAddedEvent(v OutputItemAddedEvent) error

MergeOutputItemAddedEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided OutputItemAddedEvent

func (*ResponseStreamEvent) MergeOutputItemDoneEvent

func (t *ResponseStreamEvent) MergeOutputItemDoneEvent(v OutputItemDoneEvent) error

MergeOutputItemDoneEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided OutputItemDoneEvent

func (*ResponseStreamEvent) MergeReasoningStartedEvent

func (t *ResponseStreamEvent) MergeReasoningStartedEvent(v ReasoningStartedEvent) error

MergeReasoningStartedEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided ReasoningStartedEvent

func (*ResponseStreamEvent) MergeReasoningStoppedEvent

func (t *ResponseStreamEvent) MergeReasoningStoppedEvent(v ReasoningStoppedEvent) error

MergeReasoningStoppedEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided ReasoningStoppedEvent

func (*ResponseStreamEvent) MergeResponseCompletedEvent

func (t *ResponseStreamEvent) MergeResponseCompletedEvent(v ResponseCompletedEvent) error

MergeResponseCompletedEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided ResponseCompletedEvent

func (*ResponseStreamEvent) MergeResponseCreatedEvent

func (t *ResponseStreamEvent) MergeResponseCreatedEvent(v ResponseCreatedEvent) error

MergeResponseCreatedEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided ResponseCreatedEvent

func (*ResponseStreamEvent) MergeResponseFailedEvent

func (t *ResponseStreamEvent) MergeResponseFailedEvent(v ResponseFailedEvent) error

MergeResponseFailedEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided ResponseFailedEvent

func (*ResponseStreamEvent) MergeResponseInProgressEvent

func (t *ResponseStreamEvent) MergeResponseInProgressEvent(v ResponseInProgressEvent) error

MergeResponseInProgressEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided ResponseInProgressEvent

func (*ResponseStreamEvent) MergeSearchQueriesEvent

func (t *ResponseStreamEvent) MergeSearchQueriesEvent(v SearchQueriesEvent) error

MergeSearchQueriesEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided SearchQueriesEvent

func (*ResponseStreamEvent) MergeSearchResultsEvent

func (t *ResponseStreamEvent) MergeSearchResultsEvent(v SearchResultsEvent) error

MergeSearchResultsEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided SearchResultsEvent

func (*ResponseStreamEvent) MergeTextDeltaEvent

func (t *ResponseStreamEvent) MergeTextDeltaEvent(v TextDeltaEvent) error

MergeTextDeltaEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided TextDeltaEvent

func (*ResponseStreamEvent) MergeTextDoneEvent

func (t *ResponseStreamEvent) MergeTextDoneEvent(v TextDoneEvent) error

MergeTextDoneEvent performs a merge with any union data inside the ResponseStreamEvent, using the provided TextDoneEvent

func (*ResponseStreamEvent) UnmarshalJSON

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

func (ResponseStreamEvent) ValueByDiscriminator

func (t ResponseStreamEvent) ValueByDiscriminator() (interface{}, error)

type ResponsesCost

type ResponsesCost struct {
	// CacheCreationCost Cost for cache creation in USD
	CacheCreationCost *float64 `json:"cache_creation_cost,omitempty"`

	// CacheReadCost Cost for cache reads in USD
	CacheReadCost *float64 `json:"cache_read_cost,omitempty"`

	// Currency Currency of the cost values
	Currency Currency `json:"currency"`

	// InputCost Cost for input tokens in USD
	InputCost float64 `json:"input_cost"`

	// OutputCost Cost for output tokens in USD
	OutputCost float64 `json:"output_cost"`

	// ToolCallsCost Cost for tool call invocations in USD
	ToolCallsCost *float64 `json:"tool_calls_cost,omitempty"`

	// ToolCallsCostDetails USD cost attributed to each reported tool by tool name.
	// Unpriced reported tools are included with a value of 0.
	ToolCallsCostDetails *map[string]float64 `json:"tool_calls_cost_details,omitempty"`

	// TotalCost Total cost for the request in USD
	TotalCost float64 `json:"total_cost"`
}

ResponsesCost Cost breakdown for a Responses API request

type ResponsesObjectType

type ResponsesObjectType string

ResponsesObjectType Object type in API responses

const (
	ResponsesObjectTypeResponse ResponsesObjectType = "response"
)

Defines values for ResponsesObjectType.

func (ResponsesObjectType) Valid

func (e ResponsesObjectType) Valid() bool

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

type ResponsesRequest

type ResponsesRequest struct {
	// Background Run the response asynchronously. With `stream: false`, the request returns immediately with `status: "queued"`; poll `GET /v1/responses/{id}` until the response reaches a terminal status. Background runs are durable, so you can also stream them and reconnect after a drop.
	Background *bool `json:"background,omitempty"`

	// Effort Effort to run, as `name`, `name@latest`, or `name@<version>` (e.g., "fast", "low", "fast@2026-09-29.0").
	// An effort level is a pre-configured model with system prompt and search parameters.
	// `name` and `name@latest` run the active version. `name@<version>` runs that exact version.
	// An `effort` value returned on a response pins that configuration only when it carries a version.
	// A returned value without a version runs the active version.
	// Versions are opaque: do not parse, order, or calculate them.
	// Required if model is not provided.
	Effort *string `json:"effort,omitempty"`

	// Input Input content - either a string or array of input items
	Input Input `json:"input"`

	// Instructions System instructions for the model
	Instructions *string `json:"instructions,omitempty"`

	// LanguagePreference ISO 639-1 language code for response language
	LanguagePreference *string `json:"language_preference,omitempty"`

	// MaxOutputTokens Maximum tokens to generate. This is a shared optional Agent API request parameter, but it is required when using anthropic/* models. If omitted for an Anthropic model, the API returns HTTP 400 with: validation failed: max_output_tokens is required when using Anthropic models.
	MaxOutputTokens *int32 `json:"max_output_tokens,omitempty"`

	// MaxSteps Maximum number of research loop steps.
	// If provided, overrides the effort level's max_steps value. For requests that specify model or models without an effort level, the default is 1.
	// Set max_steps to at least 3 when using finance_search with a direct model so the agent has enough steps to initialize and run the tool.
	// Must be >= 1 if specified. Maximum allowed is 100.
	MaxSteps *int32 `json:"max_steps,omitempty"`

	// Model Model ID in provider/model format (e.g., "openai/gpt-5.6-terra", "anthropic/claude-sonnet-5-5").
	// If models is also provided, models takes precedence.
	// Required if neither models nor effort is provided.
	Model *string `json:"model,omitempty"`

	// Models Model fallback chain. Each model is in provider/model format.
	// Models are tried in order until one succeeds.
	// Max 5 models allowed. If set, takes precedence over single model field.
	// The response.model will reflect the model that actually succeeded.
	Models *[]string `json:"models,omitempty"`

	// PreviousResponseId OpenAI-compatible previous response id for multi-turn response chains. When set, the new response continues from the completed prior response's saved state. The prior response must belong to the same account and have completed.
	PreviousResponseId *string `json:"previous_response_id,omitempty"`

	// Profile Saved, versioned configuration to run with. The version is resolved when the request is admitted. Cannot be combined with effort.
	Profile   *ProfileReference `json:"profile,omitempty"`
	Reasoning *ReasoningConfig  `json:"reasoning,omitempty"`

	// ResponseFormat Specifies the desired output format for the model response
	ResponseFormat *ResponseFormat `json:"response_format,omitempty"`

	// Skills Built-in, request-scoped inline, and organization-owned custom skills available to the model. Skill metadata is disclosed to the model up front; full instructions are loaded on demand through the load_skill tool. Selecting any skill enables the sandbox tool for the request. Requests with skills run on the durable backend and skills are not echoed back on Response objects.
	Skills *[]Skill `json:"skills,omitempty"`

	// Store OpenAI-compatible storage toggle. When false, the response is hidden from later retrieve calls, and the echoed response reports `store: false`. It can still be used as a `previous_response_id` continuation source.
	Store *bool `json:"store,omitempty"`

	// Stream If true, returns SSE stream instead of JSON
	Stream *bool `json:"stream,omitempty"`

	// Temperature OpenAI-compatible sampling temperature forwarded to generation.
	Temperature *float64 `json:"temperature,omitempty"`

	// ToolChoice Tool choice strategy. Use `{"type":"image_search"}` to force image search.
	ToolChoice *ToolChoice `json:"tool_choice,omitempty"`

	// Tools Tools available to the model
	Tools *[]Tool `json:"tools,omitempty"`

	// TopP OpenAI-compatible nucleus sampling parameter forwarded to generation.
	TopP *float64 `json:"top_p,omitempty"`
}

ResponsesRequest defines model for ResponsesRequest.

type ResponsesResponse

type ResponsesResponse struct {
	// CreatedAt Unix timestamp when the response was created
	CreatedAt int64 `json:"created_at"`

	// Effort Effort and version that ran this response, as `name@<version>` (e.g., "fast@2026-09-29.0").
	// Present only when the request used an effort level. Streams resumed with `starting_after` omit it.
	// For an alias, this is the effort and version that the alias selects.
	// Send a value with a version as the request `effort` to run that configuration again.
	// A released version can receive bug-fix patches, so sending it back runs that version as currently patched.
	// A value without a version is the bare effort name: the run was created before effort versions, or was served without versions.
	// Sending it runs the active version.
	Effort *string `json:"effort,omitempty"`

	// Error Error details if the response failed
	Error *ErrorInfo `json:"error,omitempty"`

	// Id Unique identifier for the response
	Id string `json:"id"`

	// Model Model used for generation
	Model string `json:"model"`

	// Object Object type identifier
	Object ResponsesObjectType `json:"object"`

	// Output Array of output items (messages, search results, tool calls)
	Output []OutputItem `json:"output"`

	// Status Status of the response
	Status Status `json:"status"`

	// Usage Token usage and cost information
	Usage *ResponsesUsage `json:"usage,omitempty"`
}

ResponsesResponse Non-streaming response returned when stream is false

type ResponsesUsage

type ResponsesUsage struct {
	// Cost Cost breakdown for the request
	Cost *ResponsesCost `json:"cost,omitempty"`

	// InputTokens Number of input tokens used
	InputTokens        int64 `json:"input_tokens"`
	InputTokensDetails *struct {
		// CacheCreationInputTokens Tokens used for cache creation
		CacheCreationInputTokens *int64 `json:"cache_creation_input_tokens,omitempty"`

		// CacheReadInputTokens Tokens read from cache
		CacheReadInputTokens *int64 `json:"cache_read_input_tokens,omitempty"`
	} `json:"input_tokens_details,omitempty"`

	// OutputTokens Number of output tokens generated
	OutputTokens int64 `json:"output_tokens"`

	// ToolCallsDetails Details about tool call invocations
	ToolCallsDetails *map[string]ToolCallDetails `json:"tool_calls_details,omitempty"`

	// TotalTokens Total tokens used (input + output)
	TotalTokens int64 `json:"total_tokens"`
}

ResponsesUsage Token usage and cost information for a Responses API request

type RetrieveAgentResponse

type RetrieveAgentResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ResponsesResponse
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *struct {
		// Error Error information returned when a request fails
		Error *ErrorInfo `json:"error,omitempty"`
	}
}

func ParseRetrieveAgentResponse

func ParseRetrieveAgentResponse(rsp *http.Response) (*RetrieveAgentResponse, error)

ParseRetrieveAgentResponse parses an HTTP response from a RetrieveAgentWithResponse call

func (RetrieveAgentResponse) ContentType

func (r RetrieveAgentResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (RetrieveAgentResponse) GetBody

func (r RetrieveAgentResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (RetrieveAgentResponse) GetJSON200

func (r RetrieveAgentResponse) GetJSON200() *ResponsesResponse

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (RetrieveAgentResponse) GetJSON404

func (r RetrieveAgentResponse) GetJSON404() *struct {
	// Error Error information returned when a request fails
	Error *ErrorInfo `json:"error,omitempty"`
}

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (RetrieveAgentResponse) Status

func (r RetrieveAgentResponse) Status() string

Status returns HTTPResponse.Status

func (RetrieveAgentResponse) StatusCode

func (r RetrieveAgentResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Revision

type Revision = string

Revision defines model for Revision.

type RoleType

type RoleType string

RoleType Role in a message

const (
	RoleTypeAssistant RoleType = "assistant"
)

Defines values for RoleType.

func (RoleType) Valid

func (e RoleType) Valid() bool

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

type SandboxResultsOutputItem

type SandboxResultsOutputItem struct {
	// Code The code that was executed inside the sandbox.
	Code *string `json:"code,omitempty"`

	// DurationMs Wall-clock duration of the sandbox execution, in milliseconds.
	DurationMs *int64 `json:"duration_ms,omitempty"`

	// ExitCode Process exit code. Non-zero indicates a runtime error.
	ExitCode *int32 `json:"exit_code,omitempty"`

	// Status Execution status. One of `completed`, `timed_out`, `failed`.
	Status SandboxResultsOutputItemStatus `json:"status"`

	// Stderr Standard error captured from the sandbox execution.
	Stderr *string `json:"stderr,omitempty"`

	// Stdout Standard output captured from the sandbox execution.
	Stdout *string                      `json:"stdout,omitempty"`
	Type   SandboxResultsOutputItemType `json:"type"`
}

SandboxResultsOutputItem Result of a sandbox tool invocation. Contains the executed code and its output.

type SandboxResultsOutputItemStatus

type SandboxResultsOutputItemStatus string

SandboxResultsOutputItemStatus Execution status. One of `completed`, `timed_out`, `failed`.

const (
	SandboxResultsOutputItemStatusCompleted SandboxResultsOutputItemStatus = "completed"
	SandboxResultsOutputItemStatusFailed    SandboxResultsOutputItemStatus = "failed"
	SandboxResultsOutputItemStatusTimedOut  SandboxResultsOutputItemStatus = "timed_out"
)

Defines values for SandboxResultsOutputItemStatus.

func (SandboxResultsOutputItemStatus) Valid

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

type SandboxResultsOutputItemType

type SandboxResultsOutputItemType string

SandboxResultsOutputItemType defines model for SandboxResultsOutputItem.Type.

const (
	SandboxResultsOutputItemTypeSandboxResults SandboxResultsOutputItemType = "sandbox_results"
)

Defines values for SandboxResultsOutputItemType.

func (SandboxResultsOutputItemType) Valid

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

type SandboxTool

type SandboxTool struct {
	// Type Tool type identifier
	Type SandboxToolType `json:"type"`
}

SandboxTool Sandbox tool configuration for the Responses API. Executes code in an isolated container during an Agent API request.

type SandboxToolType

type SandboxToolType string

SandboxToolType Tool type identifier

const (
	SandboxToolTypeSandbox SandboxToolType = "sandbox"
)

Defines values for SandboxToolType.

func (SandboxToolType) Valid

func (e SandboxToolType) Valid() bool

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

type ScoreAnswer

type ScoreAnswer struct {
	// Confidence Computed from `probabilities` as `1 - spread / baseline`, with a floor of 0. `spread` is the sum of `p_i × |i - top|`, where `top` is the most likely level; `baseline` is the unweighted average of `|i - top|` over all levels. 1 for a single level.
	Confidence float64 `json:"confidence"`

	// Legend Level index, as a string, mapped back to the `criteria` entry it stands for.
	Legend map[string]ScoreAnswer_Legend_AdditionalProperties `json:"legend"`

	// Probabilities Probability of each level, keyed like `legend`. Values sum to approximately 1.
	Probabilities map[string]float64 `json:"probabilities"`

	// Score Probability-weighted average of the level indices. Can fall between two levels.
	Score float64 `json:"score"`

	// Type Always `score`.
	Type ScoreAnswerType `json:"type"`
}

ScoreAnswer Answer to a `score` question: the expected score, the rubric, a confidence value, and the probability of each level.

type ScoreAnswerLegend0

type ScoreAnswerLegend0 = string

ScoreAnswerLegend0 defines model for ScoreAnswer.Legend.0.

type ScoreAnswerLegend1

type ScoreAnswerLegend1 map[string]interface{}

ScoreAnswerLegend1 defines model for ScoreAnswer.Legend.1.

type ScoreAnswerLegend2

type ScoreAnswerLegend2 = []interface{}

ScoreAnswerLegend2 defines model for ScoreAnswer.Legend.2.

type ScoreAnswerType

type ScoreAnswerType string

ScoreAnswerType Always `score`.

const (
	ScoreAnswerTypeScore ScoreAnswerType = "score"
)

Defines values for ScoreAnswerType.

func (ScoreAnswerType) Valid

func (e ScoreAnswerType) Valid() bool

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

type ScoreAnswer_Legend_AdditionalProperties

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

ScoreAnswer_Legend_AdditionalProperties defines model for ScoreAnswer.legend.AdditionalProperties.

func (ScoreAnswer_Legend_AdditionalProperties) AsScoreAnswerLegend0

AsScoreAnswerLegend0 returns the union data inside the ScoreAnswer_Legend_AdditionalProperties as a ScoreAnswerLegend0

func (ScoreAnswer_Legend_AdditionalProperties) AsScoreAnswerLegend1

AsScoreAnswerLegend1 returns the union data inside the ScoreAnswer_Legend_AdditionalProperties as a ScoreAnswerLegend1

func (ScoreAnswer_Legend_AdditionalProperties) AsScoreAnswerLegend2

AsScoreAnswerLegend2 returns the union data inside the ScoreAnswer_Legend_AdditionalProperties as a ScoreAnswerLegend2

func (*ScoreAnswer_Legend_AdditionalProperties) FromScoreAnswerLegend0

FromScoreAnswerLegend0 overwrites any union data inside the ScoreAnswer_Legend_AdditionalProperties as the provided ScoreAnswerLegend0

func (*ScoreAnswer_Legend_AdditionalProperties) FromScoreAnswerLegend1

FromScoreAnswerLegend1 overwrites any union data inside the ScoreAnswer_Legend_AdditionalProperties as the provided ScoreAnswerLegend1

func (*ScoreAnswer_Legend_AdditionalProperties) FromScoreAnswerLegend2

FromScoreAnswerLegend2 overwrites any union data inside the ScoreAnswer_Legend_AdditionalProperties as the provided ScoreAnswerLegend2

func (ScoreAnswer_Legend_AdditionalProperties) MarshalJSON

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

func (*ScoreAnswer_Legend_AdditionalProperties) MergeScoreAnswerLegend0

MergeScoreAnswerLegend0 performs a merge with any union data inside the ScoreAnswer_Legend_AdditionalProperties, using the provided ScoreAnswerLegend0

func (*ScoreAnswer_Legend_AdditionalProperties) MergeScoreAnswerLegend1

MergeScoreAnswerLegend1 performs a merge with any union data inside the ScoreAnswer_Legend_AdditionalProperties, using the provided ScoreAnswerLegend1

func (*ScoreAnswer_Legend_AdditionalProperties) MergeScoreAnswerLegend2

MergeScoreAnswerLegend2 performs a merge with any union data inside the ScoreAnswer_Legend_AdditionalProperties, using the provided ScoreAnswerLegend2

func (*ScoreAnswer_Legend_AdditionalProperties) UnmarshalJSON

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

type ScoreQuestion

type ScoreQuestion struct {
	// Criteria Ordered level descriptions. The index in this array is the level's score, starting at 0. 1 to 10 levels; use at least two.
	Criteria []ScoreQuestion_Criteria_Item `json:"criteria"`

	// Instructions What to rate.
	Instructions *ScoreQuestion_Instructions `json:"instructions,omitempty"`

	// Type Always `score`.
	Type ScoreQuestionType `json:"type"`
}

ScoreQuestion A question that rates the content on an ordered rubric.

type ScoreQuestionCriteria0

type ScoreQuestionCriteria0 = string

ScoreQuestionCriteria0 defines model for ScoreQuestion.Criteria.0.

type ScoreQuestionCriteria1

type ScoreQuestionCriteria1 map[string]interface{}

ScoreQuestionCriteria1 defines model for ScoreQuestion.Criteria.1.

type ScoreQuestionCriteria2

type ScoreQuestionCriteria2 = []interface{}

ScoreQuestionCriteria2 defines model for ScoreQuestion.Criteria.2.

type ScoreQuestionInstructions0

type ScoreQuestionInstructions0 = string

ScoreQuestionInstructions0 defines model for ScoreQuestion.Instructions.0.

type ScoreQuestionInstructions1

type ScoreQuestionInstructions1 map[string]interface{}

ScoreQuestionInstructions1 defines model for ScoreQuestion.Instructions.1.

type ScoreQuestionInstructions2

type ScoreQuestionInstructions2 = []interface{}

ScoreQuestionInstructions2 defines model for ScoreQuestion.Instructions.2.

type ScoreQuestionType

type ScoreQuestionType string

ScoreQuestionType Always `score`.

const (
	ScoreQuestionTypeScore ScoreQuestionType = "score"
)

Defines values for ScoreQuestionType.

func (ScoreQuestionType) Valid

func (e ScoreQuestionType) Valid() bool

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

type ScoreQuestion_Criteria_Item

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

ScoreQuestion_Criteria_Item defines model for ScoreQuestion.criteria.Item.

func (ScoreQuestion_Criteria_Item) AsScoreQuestionCriteria0

func (t ScoreQuestion_Criteria_Item) AsScoreQuestionCriteria0() (ScoreQuestionCriteria0, error)

AsScoreQuestionCriteria0 returns the union data inside the ScoreQuestion_Criteria_Item as a ScoreQuestionCriteria0

func (ScoreQuestion_Criteria_Item) AsScoreQuestionCriteria1

func (t ScoreQuestion_Criteria_Item) AsScoreQuestionCriteria1() (ScoreQuestionCriteria1, error)

AsScoreQuestionCriteria1 returns the union data inside the ScoreQuestion_Criteria_Item as a ScoreQuestionCriteria1

func (ScoreQuestion_Criteria_Item) AsScoreQuestionCriteria2

func (t ScoreQuestion_Criteria_Item) AsScoreQuestionCriteria2() (ScoreQuestionCriteria2, error)

AsScoreQuestionCriteria2 returns the union data inside the ScoreQuestion_Criteria_Item as a ScoreQuestionCriteria2

func (*ScoreQuestion_Criteria_Item) FromScoreQuestionCriteria0

func (t *ScoreQuestion_Criteria_Item) FromScoreQuestionCriteria0(v ScoreQuestionCriteria0) error

FromScoreQuestionCriteria0 overwrites any union data inside the ScoreQuestion_Criteria_Item as the provided ScoreQuestionCriteria0

func (*ScoreQuestion_Criteria_Item) FromScoreQuestionCriteria1

func (t *ScoreQuestion_Criteria_Item) FromScoreQuestionCriteria1(v ScoreQuestionCriteria1) error

FromScoreQuestionCriteria1 overwrites any union data inside the ScoreQuestion_Criteria_Item as the provided ScoreQuestionCriteria1

func (*ScoreQuestion_Criteria_Item) FromScoreQuestionCriteria2

func (t *ScoreQuestion_Criteria_Item) FromScoreQuestionCriteria2(v ScoreQuestionCriteria2) error

FromScoreQuestionCriteria2 overwrites any union data inside the ScoreQuestion_Criteria_Item as the provided ScoreQuestionCriteria2

func (ScoreQuestion_Criteria_Item) MarshalJSON

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

func (*ScoreQuestion_Criteria_Item) MergeScoreQuestionCriteria0

func (t *ScoreQuestion_Criteria_Item) MergeScoreQuestionCriteria0(v ScoreQuestionCriteria0) error

MergeScoreQuestionCriteria0 performs a merge with any union data inside the ScoreQuestion_Criteria_Item, using the provided ScoreQuestionCriteria0

func (*ScoreQuestion_Criteria_Item) MergeScoreQuestionCriteria1

func (t *ScoreQuestion_Criteria_Item) MergeScoreQuestionCriteria1(v ScoreQuestionCriteria1) error

MergeScoreQuestionCriteria1 performs a merge with any union data inside the ScoreQuestion_Criteria_Item, using the provided ScoreQuestionCriteria1

func (*ScoreQuestion_Criteria_Item) MergeScoreQuestionCriteria2

func (t *ScoreQuestion_Criteria_Item) MergeScoreQuestionCriteria2(v ScoreQuestionCriteria2) error

MergeScoreQuestionCriteria2 performs a merge with any union data inside the ScoreQuestion_Criteria_Item, using the provided ScoreQuestionCriteria2

func (*ScoreQuestion_Criteria_Item) UnmarshalJSON

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

type ScoreQuestion_Instructions

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

ScoreQuestion_Instructions What to rate.

func (ScoreQuestion_Instructions) AsScoreQuestionInstructions0

func (t ScoreQuestion_Instructions) AsScoreQuestionInstructions0() (ScoreQuestionInstructions0, error)

AsScoreQuestionInstructions0 returns the union data inside the ScoreQuestion_Instructions as a ScoreQuestionInstructions0

func (ScoreQuestion_Instructions) AsScoreQuestionInstructions1

func (t ScoreQuestion_Instructions) AsScoreQuestionInstructions1() (ScoreQuestionInstructions1, error)

AsScoreQuestionInstructions1 returns the union data inside the ScoreQuestion_Instructions as a ScoreQuestionInstructions1

func (ScoreQuestion_Instructions) AsScoreQuestionInstructions2

func (t ScoreQuestion_Instructions) AsScoreQuestionInstructions2() (ScoreQuestionInstructions2, error)

AsScoreQuestionInstructions2 returns the union data inside the ScoreQuestion_Instructions as a ScoreQuestionInstructions2

func (*ScoreQuestion_Instructions) FromScoreQuestionInstructions0

func (t *ScoreQuestion_Instructions) FromScoreQuestionInstructions0(v ScoreQuestionInstructions0) error

FromScoreQuestionInstructions0 overwrites any union data inside the ScoreQuestion_Instructions as the provided ScoreQuestionInstructions0

func (*ScoreQuestion_Instructions) FromScoreQuestionInstructions1

func (t *ScoreQuestion_Instructions) FromScoreQuestionInstructions1(v ScoreQuestionInstructions1) error

FromScoreQuestionInstructions1 overwrites any union data inside the ScoreQuestion_Instructions as the provided ScoreQuestionInstructions1

func (*ScoreQuestion_Instructions) FromScoreQuestionInstructions2

func (t *ScoreQuestion_Instructions) FromScoreQuestionInstructions2(v ScoreQuestionInstructions2) error

FromScoreQuestionInstructions2 overwrites any union data inside the ScoreQuestion_Instructions as the provided ScoreQuestionInstructions2

func (ScoreQuestion_Instructions) MarshalJSON

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

func (*ScoreQuestion_Instructions) MergeScoreQuestionInstructions0

func (t *ScoreQuestion_Instructions) MergeScoreQuestionInstructions0(v ScoreQuestionInstructions0) error

MergeScoreQuestionInstructions0 performs a merge with any union data inside the ScoreQuestion_Instructions, using the provided ScoreQuestionInstructions0

func (*ScoreQuestion_Instructions) MergeScoreQuestionInstructions1

func (t *ScoreQuestion_Instructions) MergeScoreQuestionInstructions1(v ScoreQuestionInstructions1) error

MergeScoreQuestionInstructions1 performs a merge with any union data inside the ScoreQuestion_Instructions, using the provided ScoreQuestionInstructions1

func (*ScoreQuestion_Instructions) MergeScoreQuestionInstructions2

func (t *ScoreQuestion_Instructions) MergeScoreQuestionInstructions2(v ScoreQuestionInstructions2) error

MergeScoreQuestionInstructions2 performs a merge with any union data inside the ScoreQuestion_Instructions, using the provided ScoreQuestionInstructions2

func (*ScoreQuestion_Instructions) UnmarshalJSON

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

type SearchDomainFilter

type SearchDomainFilter struct {
	// SearchDomainFilter Limit search results to specific domains (max 20)
	SearchDomainFilter *[]string `json:"search_domain_filter,omitempty"`
}

SearchDomainFilter defines model for SearchDomainFilter.

type SearchQueriesEvent

type SearchQueriesEvent struct {
	Queries []string `json:"queries"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64   `json:"sequence_number"`
	Thought        *string `json:"thought,omitempty"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

SearchQueriesEvent Search queries event (type: "response.reasoning.search_queries"). Contains search queries being executed.

type SearchRecencyFilter

type SearchRecencyFilter string

SearchRecencyFilter Time-based recency filter for search results

const (
	SearchRecencyFilterDay   SearchRecencyFilter = "day"
	SearchRecencyFilterHour  SearchRecencyFilter = "hour"
	SearchRecencyFilterMonth SearchRecencyFilter = "month"
	SearchRecencyFilterWeek  SearchRecencyFilter = "week"
	SearchRecencyFilterYear  SearchRecencyFilter = "year"
)

Defines values for SearchRecencyFilter.

func (SearchRecencyFilter) Valid

func (e SearchRecencyFilter) Valid() bool

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

type SearchResult

type SearchResult struct {
	// Date Publication date of the result
	Date *string `json:"date,omitempty"`

	// Id Unique numeric identifier for the result
	Id int64 `json:"id"`

	// LastUpdated Date the result was last updated
	LastUpdated *string `json:"last_updated,omitempty"`

	// Snippet Text snippet from the search result
	Snippet string `json:"snippet"`

	// Source Source type of the result
	Source *SearchSource `json:"source,omitempty"`

	// Title Title of the search result page
	Title string `json:"title"`

	// Url URL of the search result page
	Url string `json:"url"`
}

SearchResult A single search result used in LLM responses

type SearchResultsEvent

type SearchResultsEvent struct {
	Results []SearchResult `json:"results"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64   `json:"sequence_number"`
	Thought        *string `json:"thought,omitempty"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`

	// Usage Token usage and cost information for a Responses API request
	Usage *ResponsesUsage `json:"usage,omitempty"`
}

SearchResultsEvent Search results event (type: "response.reasoning.search_results"). Contains search results returned.

type SearchResultsOutputItem

type SearchResultsOutputItem struct {
	Queries *[]string                   `json:"queries,omitempty"`
	Results []SearchResult              `json:"results"`
	Type    SearchResultsOutputItemType `json:"type"`
}

SearchResultsOutputItem defines model for SearchResultsOutputItem.

type SearchResultsOutputItemType

type SearchResultsOutputItemType string

SearchResultsOutputItemType defines model for SearchResultsOutputItem.Type.

const (
	SearchResultsOutputItemTypeSearchResults SearchResultsOutputItemType = "search_results"
)

Defines values for SearchResultsOutputItemType.

func (SearchResultsOutputItemType) Valid

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

type SearchSearchPostJSONRequestBody

type SearchSearchPostJSONRequestBody = ApiSearchRequest

SearchSearchPostJSONRequestBody defines body for SearchSearchPost for application/json ContentType.

type SearchSearchPostResponse

type SearchSearchPostResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ApiSearchResponse
	// JSON422 the response for an HTTP 422 `application/json` response
	JSON422 *HTTPValidationError
}

func ParseSearchSearchPostResponse

func ParseSearchSearchPostResponse(rsp *http.Response) (*SearchSearchPostResponse, error)

ParseSearchSearchPostResponse parses an HTTP response from a SearchSearchPostWithResponse call

func (SearchSearchPostResponse) ContentType

func (r SearchSearchPostResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (SearchSearchPostResponse) GetBody

func (r SearchSearchPostResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (SearchSearchPostResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (SearchSearchPostResponse) GetJSON422

GetJSON422 returns the response for an HTTP 422 `application/json` response

func (SearchSearchPostResponse) Status

func (r SearchSearchPostResponse) Status() string

Status returns HTTPResponse.Status

func (SearchSearchPostResponse) StatusCode

func (r SearchSearchPostResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type SearchSource

type SearchSource string

SearchSource Source of search results

const (
	SearchSourceWeb SearchSource = "web"
)

Defines values for SearchSource.

func (SearchSource) Valid

func (e SearchSource) Valid() bool

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

type Skill

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

Skill defines model for Skill.

func (Skill) AsBuiltinSkill

func (t Skill) AsBuiltinSkill() (BuiltinSkill, error)

AsBuiltinSkill returns the union data inside the Skill as a BuiltinSkill

func (Skill) AsCustomSkill

func (t Skill) AsCustomSkill() (CustomSkill, error)

AsCustomSkill returns the union data inside the Skill as a CustomSkill

func (Skill) AsInlineSkill

func (t Skill) AsInlineSkill() (InlineSkill, error)

AsInlineSkill returns the union data inside the Skill as a InlineSkill

func (Skill) Discriminator

func (t Skill) Discriminator() (string, error)

func (*Skill) FromBuiltinSkill

func (t *Skill) FromBuiltinSkill(v BuiltinSkill) error

FromBuiltinSkill overwrites any union data inside the Skill as the provided BuiltinSkill

func (*Skill) FromCustomSkill

func (t *Skill) FromCustomSkill(v CustomSkill) error

FromCustomSkill overwrites any union data inside the Skill as the provided CustomSkill

func (*Skill) FromInlineSkill

func (t *Skill) FromInlineSkill(v InlineSkill) error

FromInlineSkill overwrites any union data inside the Skill as the provided InlineSkill

func (Skill) MarshalJSON

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

func (*Skill) MergeBuiltinSkill

func (t *Skill) MergeBuiltinSkill(v BuiltinSkill) error

MergeBuiltinSkill performs a merge with any union data inside the Skill, using the provided BuiltinSkill

func (*Skill) MergeCustomSkill

func (t *Skill) MergeCustomSkill(v CustomSkill) error

MergeCustomSkill performs a merge with any union data inside the Skill, using the provided CustomSkill

func (*Skill) MergeInlineSkill

func (t *Skill) MergeInlineSkill(v InlineSkill) error

MergeInlineSkill performs a merge with any union data inside the Skill, using the provided InlineSkill

func (*Skill) UnmarshalJSON

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

func (Skill) ValueByDiscriminator

func (t Skill) ValueByDiscriminator() (interface{}, error)

type SkillDownload

type SkillDownload struct {
	// DownloadUrl Short-lived URL to download the zip bundle
	DownloadUrl string `json:"download_url"`

	// Name Skill name at this revision
	Name *string `json:"name,omitempty"`

	// Revision Opaque token of the downloaded revision
	Revision *string `json:"revision,omitempty"`
}

SkillDownload defines model for SkillDownload.

type SkillId

type SkillId = string

SkillId defines model for SkillId.

type SkillList

type SkillList struct {
	// NextPageToken Opaque token for the next page; omitted on the last page
	NextPageToken *string        `json:"next_page_token,omitempty"`
	Skills        []SkillSummary `json:"skills"`
}

SkillList defines model for SkillList.

type SkillRevision

type SkillRevision struct {
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// Name Skill name at this revision
	Name *string `json:"name,omitempty"`

	// Revision Opaque revision token
	Revision string `json:"revision"`
}

SkillRevision defines model for SkillRevision.

type SkillRevisionList

type SkillRevisionList struct {
	// NextPageToken Opaque token for the next page; omitted on the last page
	NextPageToken *string         `json:"next_page_token,omitempty"`
	Revisions     []SkillRevision `json:"revisions"`
}

SkillRevisionList defines model for SkillRevisionList.

type SkillSummary

type SkillSummary struct {
	CreatedAt *time.Time `json:"created_at,omitempty"`

	// Name Skill name, read from the bundle's `SKILL.md`
	Name *string `json:"name,omitempty"`

	// Revision Opaque revision token of the skill; pass as expected_revision to update or delete
	Revision *string `json:"revision,omitempty"`

	// SkillId Skill identifier
	SkillId   string     `json:"skill_id"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

SkillSummary defines model for SkillSummary.

type Status

type Status string

Status Status of a response or output item

const (
	StatusCancelled  Status = "cancelled"
	StatusCompleted  Status = "completed"
	StatusFailed     Status = "failed"
	StatusInProgress Status = "in_progress"
	StatusIncomplete Status = "incomplete"
	StatusQueued     Status = "queued"
)

Defines values for Status.

func (Status) Valid

func (e Status) Valid() bool

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

type TextDeltaEvent

type TextDeltaEvent struct {
	ContentIndex int64  `json:"content_index"`
	Delta        string `json:"delta"`
	ItemId       string `json:"item_id"`
	OutputIndex  int64  `json:"output_index"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64 `json:"sequence_number"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

TextDeltaEvent Text delta event (type: "response.output_text.delta"). Contains incremental text content.

type TextDoneEvent

type TextDoneEvent struct {
	ContentIndex int64  `json:"content_index"`
	ItemId       string `json:"item_id"`
	OutputIndex  int64  `json:"output_index"`

	// SequenceNumber Monotonically increasing sequence number for event ordering
	SequenceNumber int64  `json:"sequence_number"`
	Text           string `json:"text"`

	// Type SSE event type discriminator
	Type EventType `json:"type"`
}

TextDoneEvent Text done event (type: "response.output_text.done"). Contains the final text content.

type TooManyRequests

type TooManyRequests = ErrorResponse

TooManyRequests The body of an error response.

type Tool

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

Tool defines model for Tool.

func (Tool) AsConnectorTool

func (t Tool) AsConnectorTool() (ConnectorTool, error)

AsConnectorTool returns the union data inside the Tool as a ConnectorTool

func (Tool) AsFetchUrlTool

func (t Tool) AsFetchUrlTool() (FetchUrlTool, error)

AsFetchUrlTool returns the union data inside the Tool as a FetchUrlTool

func (Tool) AsFinanceSearchTool

func (t Tool) AsFinanceSearchTool() (FinanceSearchTool, error)

AsFinanceSearchTool returns the union data inside the Tool as a FinanceSearchTool

func (Tool) AsFunctionTool

func (t Tool) AsFunctionTool() (FunctionTool, error)

AsFunctionTool returns the union data inside the Tool as a FunctionTool

func (Tool) AsImageSearchTool

func (t Tool) AsImageSearchTool() (ImageSearchTool, error)

AsImageSearchTool returns the union data inside the Tool as a ImageSearchTool

func (Tool) AsMcpTool

func (t Tool) AsMcpTool() (McpTool, error)

AsMcpTool returns the union data inside the Tool as a McpTool

func (Tool) AsPeopleSearchTool

func (t Tool) AsPeopleSearchTool() (PeopleSearchTool, error)

AsPeopleSearchTool returns the union data inside the Tool as a PeopleSearchTool

func (Tool) AsSandboxTool

func (t Tool) AsSandboxTool() (SandboxTool, error)

AsSandboxTool returns the union data inside the Tool as a SandboxTool

func (Tool) AsWebSearchTool

func (t Tool) AsWebSearchTool() (WebSearchTool, error)

AsWebSearchTool returns the union data inside the Tool as a WebSearchTool

func (Tool) Discriminator

func (t Tool) Discriminator() (string, error)

func (*Tool) FromConnectorTool

func (t *Tool) FromConnectorTool(v ConnectorTool) error

FromConnectorTool overwrites any union data inside the Tool as the provided ConnectorTool

func (*Tool) FromFetchUrlTool

func (t *Tool) FromFetchUrlTool(v FetchUrlTool) error

FromFetchUrlTool overwrites any union data inside the Tool as the provided FetchUrlTool

func (*Tool) FromFinanceSearchTool

func (t *Tool) FromFinanceSearchTool(v FinanceSearchTool) error

FromFinanceSearchTool overwrites any union data inside the Tool as the provided FinanceSearchTool

func (*Tool) FromFunctionTool

func (t *Tool) FromFunctionTool(v FunctionTool) error

FromFunctionTool overwrites any union data inside the Tool as the provided FunctionTool

func (*Tool) FromImageSearchTool

func (t *Tool) FromImageSearchTool(v ImageSearchTool) error

FromImageSearchTool overwrites any union data inside the Tool as the provided ImageSearchTool

func (*Tool) FromMcpTool

func (t *Tool) FromMcpTool(v McpTool) error

FromMcpTool overwrites any union data inside the Tool as the provided McpTool

func (*Tool) FromPeopleSearchTool

func (t *Tool) FromPeopleSearchTool(v PeopleSearchTool) error

FromPeopleSearchTool overwrites any union data inside the Tool as the provided PeopleSearchTool

func (*Tool) FromSandboxTool

func (t *Tool) FromSandboxTool(v SandboxTool) error

FromSandboxTool overwrites any union data inside the Tool as the provided SandboxTool

func (*Tool) FromWebSearchTool

func (t *Tool) FromWebSearchTool(v WebSearchTool) error

FromWebSearchTool overwrites any union data inside the Tool as the provided WebSearchTool

func (Tool) MarshalJSON

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

func (*Tool) MergeConnectorTool

func (t *Tool) MergeConnectorTool(v ConnectorTool) error

MergeConnectorTool performs a merge with any union data inside the Tool, using the provided ConnectorTool

func (*Tool) MergeFetchUrlTool

func (t *Tool) MergeFetchUrlTool(v FetchUrlTool) error

MergeFetchUrlTool performs a merge with any union data inside the Tool, using the provided FetchUrlTool

func (*Tool) MergeFinanceSearchTool

func (t *Tool) MergeFinanceSearchTool(v FinanceSearchTool) error

MergeFinanceSearchTool performs a merge with any union data inside the Tool, using the provided FinanceSearchTool

func (*Tool) MergeFunctionTool

func (t *Tool) MergeFunctionTool(v FunctionTool) error

MergeFunctionTool performs a merge with any union data inside the Tool, using the provided FunctionTool

func (*Tool) MergeImageSearchTool

func (t *Tool) MergeImageSearchTool(v ImageSearchTool) error

MergeImageSearchTool performs a merge with any union data inside the Tool, using the provided ImageSearchTool

func (*Tool) MergeMcpTool

func (t *Tool) MergeMcpTool(v McpTool) error

MergeMcpTool performs a merge with any union data inside the Tool, using the provided McpTool

func (*Tool) MergePeopleSearchTool

func (t *Tool) MergePeopleSearchTool(v PeopleSearchTool) error

MergePeopleSearchTool performs a merge with any union data inside the Tool, using the provided PeopleSearchTool

func (*Tool) MergeSandboxTool

func (t *Tool) MergeSandboxTool(v SandboxTool) error

MergeSandboxTool performs a merge with any union data inside the Tool, using the provided SandboxTool

func (*Tool) MergeWebSearchTool

func (t *Tool) MergeWebSearchTool(v WebSearchTool) error

MergeWebSearchTool performs a merge with any union data inside the Tool, using the provided WebSearchTool

func (*Tool) UnmarshalJSON

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

func (Tool) ValueByDiscriminator

func (t Tool) ValueByDiscriminator() (interface{}, error)

type ToolCallDetails

type ToolCallDetails struct {
	// CostUsd Accumulated customer charge in USD for this tool when the API can attribute one directly.
	CostUsd *float64 `json:"cost_usd,omitempty"`

	// Invocation Number of times this tool was invoked
	Invocation *int64 `json:"invocation,omitempty"`

	// TokenUsage Model token usage for tools backed by internal LLM calls. Sandbox SDK usage is aggregated by model.
	TokenUsage *[]ToolCallTokenUsage `json:"token_usage,omitempty"`
}

ToolCallDetails Details about a tool call invocation

type ToolCallTokenUsage

type ToolCallTokenUsage struct {
	// InputTokens Total input tokens, including uncached, cache write, and cache read tokens.
	InputTokens        int64              `json:"input_tokens"`
	InputTokensDetails InputTokensDetails `json:"input_tokens_details"`

	// Model Model identifier reported by the internal LLM call.
	Model *string `json:"model,omitempty"`

	// OutputTokens Output tokens returned by the internal LLM call.
	OutputTokens        int64               `json:"output_tokens"`
	OutputTokensDetails OutputTokensDetails `json:"output_tokens_details"`
}

ToolCallTokenUsage defines model for ToolCallTokenUsage.

type ToolChoice

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

ToolChoice defines model for ToolChoice.

func (ToolChoice) AsToolChoice0

func (t ToolChoice) AsToolChoice0() (ToolChoice0, error)

AsToolChoice0 returns the union data inside the ToolChoice as a ToolChoice0

func (ToolChoice) AsToolChoice1

func (t ToolChoice) AsToolChoice1() (ToolChoice1, error)

AsToolChoice1 returns the union data inside the ToolChoice as a ToolChoice1

func (*ToolChoice) FromToolChoice0

func (t *ToolChoice) FromToolChoice0(v ToolChoice0) error

FromToolChoice0 overwrites any union data inside the ToolChoice as the provided ToolChoice0

func (*ToolChoice) FromToolChoice1

func (t *ToolChoice) FromToolChoice1(v ToolChoice1) error

FromToolChoice1 overwrites any union data inside the ToolChoice as the provided ToolChoice1

func (ToolChoice) MarshalJSON

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

func (*ToolChoice) MergeToolChoice0

func (t *ToolChoice) MergeToolChoice0(v ToolChoice0) error

MergeToolChoice0 performs a merge with any union data inside the ToolChoice, using the provided ToolChoice0

func (*ToolChoice) MergeToolChoice1

func (t *ToolChoice) MergeToolChoice1(v ToolChoice1) error

MergeToolChoice1 performs a merge with any union data inside the ToolChoice, using the provided ToolChoice1

func (*ToolChoice) UnmarshalJSON

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

type ToolChoice0

type ToolChoice0 string

ToolChoice0 defines model for ToolChoice.0.

const (
	ToolChoice0Auto     ToolChoice0 = "auto"
	ToolChoice0None     ToolChoice0 = "none"
	ToolChoice0Required ToolChoice0 = "required"
)

Defines values for ToolChoice0.

func (ToolChoice0) Valid

func (e ToolChoice0) Valid() bool

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

type ToolChoice1

type ToolChoice1 map[string]interface{}

ToolChoice1 defines model for ToolChoice.1.

type ToolSearchOutputItem

type ToolSearchOutputItem struct {
	// Arguments Exact argument text authored by the model for hosted search.
	Arguments *string `json:"arguments,omitempty"`

	// CallId Always null for hosted search.
	CallId *string `json:"call_id"`

	// Execution Execution location. Currently `server`. Clients must tolerate unknown values.
	Execution string `json:"execution"`
	Id        string `json:"id"`

	// Status Current execution status. Known values are `in_progress`, `completed`, and `incomplete`. Clients must tolerate unknown values.
	Status string                   `json:"status"`
	Tools  []NamespaceTool          `json:"tools"`
	Type   ToolSearchOutputItemType `json:"type"`
}

ToolSearchOutputItem Complete public definitions matched by one hosted external-tool search.

type ToolSearchOutputItemType

type ToolSearchOutputItemType string

ToolSearchOutputItemType defines model for ToolSearchOutputItem.Type.

const (
	ToolSearchOutputItemTypeToolSearchOutput ToolSearchOutputItemType = "tool_search_output"
)

Defines values for ToolSearchOutputItemType.

func (ToolSearchOutputItemType) Valid

func (e ToolSearchOutputItemType) Valid() bool

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

type ToolUserLocation

type ToolUserLocation struct {
	// City City name
	City *string `json:"city,omitempty"`

	// Country ISO 3166-1 alpha-2 country code
	Country *string `json:"country,omitempty"`

	// Latitude Latitude coordinate
	Latitude *float64 `json:"latitude,omitempty"`

	// Longitude Longitude coordinate
	Longitude *float64 `json:"longitude,omitempty"`

	// Region State or region name
	Region *string `json:"region,omitempty"`
}

ToolUserLocation User's geographic location for search personalization

type URL

type URL struct {
	Url string `json:"url"`
}

URL defines model for URL.

type Unauthorized

type Unauthorized = ErrorResponse

Unauthorized The body of an error response.

type UpdateSkillMultipartBody

type UpdateSkillMultipartBody struct {
	// File The skill bundle, a zip archive containing `SKILL.md`
	File openapi_types.File `json:"file"`
}

UpdateSkillMultipartBody defines parameters for UpdateSkill.

type UpdateSkillMultipartRequestBody

type UpdateSkillMultipartRequestBody UpdateSkillMultipartBody

UpdateSkillMultipartRequestBody defines body for UpdateSkill for multipart/form-data ContentType.

type UpdateSkillParams

type UpdateSkillParams struct {
	// ExpectedRevision Opaque revision token the skill must currently be at. The write applies
	// only if it matches, so it cannot race a concurrent update.
	ExpectedRevision ExpectedRevisionRequired `form:"expected_revision" json:"expected_revision"`
}

UpdateSkillParams defines parameters for UpdateSkill.

type UpdateSkillResponse

type UpdateSkillResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *ManagedSkill
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *ApiError
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *ApiError
	// JSON409 the response for an HTTP 409 `application/json` response
	JSON409 *ApiError
	// JSON413 the response for an HTTP 413 `application/json` response
	JSON413 *ApiError
	// JSON429 the response for an HTTP 429 `application/json` response
	JSON429 *ApiError
	// JSON502 the response for an HTTP 502 `application/json` response
	JSON502 *ApiError
}

func ParseUpdateSkillResponse

func ParseUpdateSkillResponse(rsp *http.Response) (*UpdateSkillResponse, error)

ParseUpdateSkillResponse parses an HTTP response from a UpdateSkillWithResponse call

func (UpdateSkillResponse) ContentType

func (r UpdateSkillResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (UpdateSkillResponse) GetBody

func (r UpdateSkillResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (UpdateSkillResponse) GetJSON200

func (r UpdateSkillResponse) GetJSON200() *ManagedSkill

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (UpdateSkillResponse) GetJSON400

func (r UpdateSkillResponse) GetJSON400() *ApiError

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (UpdateSkillResponse) GetJSON404

func (r UpdateSkillResponse) GetJSON404() *ApiError

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (UpdateSkillResponse) GetJSON409

func (r UpdateSkillResponse) GetJSON409() *ApiError

GetJSON409 returns the response for an HTTP 409 `application/json` response

func (UpdateSkillResponse) GetJSON413

func (r UpdateSkillResponse) GetJSON413() *ApiError

GetJSON413 returns the response for an HTTP 413 `application/json` response

func (UpdateSkillResponse) GetJSON429

func (r UpdateSkillResponse) GetJSON429() *ApiError

GetJSON429 returns the response for an HTTP 429 `application/json` response

func (UpdateSkillResponse) GetJSON502

func (r UpdateSkillResponse) GetJSON502() *ApiError

GetJSON502 returns the response for an HTTP 502 `application/json` response

func (UpdateSkillResponse) Status

func (r UpdateSkillResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateSkillResponse) StatusCode

func (r UpdateSkillResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type UrlContent

type UrlContent struct {
	// Snippet The fetched content snippet
	Snippet string `json:"snippet"`

	// Title The title of the page
	Title string `json:"title"`

	// Url The URL from which content was fetched
	Url string `json:"url"`
}

UrlContent Content fetched from a URL

type Usage

type Usage struct {
	// InputTokens Input tokens processed for the request.
	InputTokens int `json:"input_tokens"`

	// OutputTokens Output tokens generated for the answers.
	OutputTokens int `json:"output_tokens"`
}

Usage Token counts for the request. Input tokens are billed per million at the rate of the selected model: $0.02 for `pplx-decider-v1.2` and $0.01 for `pplx-decider-flash-v1.2`. Output tokens are free.

type UsageInfo

type UsageInfo struct {
	// CitationTokens Number of tokens used for citations
	CitationTokens *int `json:"citation_tokens,omitempty"`

	// CompletionTokens Number of tokens in the completion/output
	CompletionTokens int `json:"completion_tokens"`

	// Cost Cost breakdown for the request
	Cost Cost `json:"cost"`

	// NumSearchQueries Number of search queries executed
	NumSearchQueries *int `json:"num_search_queries,omitempty"`

	// PromptTokens Number of tokens in the prompt/input
	PromptTokens int `json:"prompt_tokens"`

	// ReasoningTokens Number of tokens used for reasoning
	ReasoningTokens *int `json:"reasoning_tokens,omitempty"`

	// SearchContextSize Size of search context used
	SearchContextSize *string `json:"search_context_size,omitempty"`

	// TotalTokens Total tokens used (prompt + completion)
	TotalTokens int `json:"total_tokens"`
}

UsageInfo Token usage and cost information for a request

type UserLocation

type UserLocation struct {
	// City City name
	City *string `json:"city,omitempty"`

	// Country ISO 3166-1 alpha-2 country code
	Country *string `json:"country,omitempty"`

	// Latitude Latitude coordinate
	Latitude *float64 `json:"latitude,omitempty"`

	// Longitude Longitude coordinate
	Longitude *float64 `json:"longitude,omitempty"`

	// Region State or region name
	Region *string `json:"region,omitempty"`
}

UserLocation User's geographic location for search personalization

type ValidationError

type ValidationError struct {
	Loc  []ValidationError_Loc_Item `json:"loc"`
	Msg  string                     `json:"msg"`
	Type string                     `json:"type"`
}

ValidationError defines model for ValidationError.

type ValidationErrorLoc0

type ValidationErrorLoc0 = string

ValidationErrorLoc0 defines model for ValidationError.Loc.0.

type ValidationErrorLoc1

type ValidationErrorLoc1 = int

ValidationErrorLoc1 defines model for ValidationError.Loc.1.

type ValidationError_Loc_Item

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

ValidationError_Loc_Item defines model for ValidationError.loc.Item.

func (ValidationError_Loc_Item) AsValidationErrorLoc0

func (t ValidationError_Loc_Item) AsValidationErrorLoc0() (ValidationErrorLoc0, error)

AsValidationErrorLoc0 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc0

func (ValidationError_Loc_Item) AsValidationErrorLoc1

func (t ValidationError_Loc_Item) AsValidationErrorLoc1() (ValidationErrorLoc1, error)

AsValidationErrorLoc1 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc1

func (*ValidationError_Loc_Item) FromValidationErrorLoc0

func (t *ValidationError_Loc_Item) FromValidationErrorLoc0(v ValidationErrorLoc0) error

FromValidationErrorLoc0 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc0

func (*ValidationError_Loc_Item) FromValidationErrorLoc1

func (t *ValidationError_Loc_Item) FromValidationErrorLoc1(v ValidationErrorLoc1) error

FromValidationErrorLoc1 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc1

func (ValidationError_Loc_Item) MarshalJSON

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

func (*ValidationError_Loc_Item) MergeValidationErrorLoc0

func (t *ValidationError_Loc_Item) MergeValidationErrorLoc0(v ValidationErrorLoc0) error

MergeValidationErrorLoc0 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc0

func (*ValidationError_Loc_Item) MergeValidationErrorLoc1

func (t *ValidationError_Loc_Item) MergeValidationErrorLoc1(v ValidationErrorLoc1) error

MergeValidationErrorLoc1 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc1

func (*ValidationError_Loc_Item) UnmarshalJSON

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

type VideoURL

type VideoURL struct {
	FrameInterval *VideoURL_FrameInterval `json:"frame_interval,omitempty"`
	Url           string                  `json:"url"`
}

VideoURL defines model for VideoURL.

type VideoURLFrameInterval0

type VideoURLFrameInterval0 = string

VideoURLFrameInterval0 defines model for VideoURL.FrameInterval.0.

type VideoURLFrameInterval1

type VideoURLFrameInterval1 = int

VideoURLFrameInterval1 defines model for VideoURL.FrameInterval.1.

type VideoURL_FrameInterval

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

VideoURL_FrameInterval defines model for VideoURL.FrameInterval.

func (VideoURL_FrameInterval) AsVideoURLFrameInterval0

func (t VideoURL_FrameInterval) AsVideoURLFrameInterval0() (VideoURLFrameInterval0, error)

AsVideoURLFrameInterval0 returns the union data inside the VideoURL_FrameInterval as a VideoURLFrameInterval0

func (VideoURL_FrameInterval) AsVideoURLFrameInterval1

func (t VideoURL_FrameInterval) AsVideoURLFrameInterval1() (VideoURLFrameInterval1, error)

AsVideoURLFrameInterval1 returns the union data inside the VideoURL_FrameInterval as a VideoURLFrameInterval1

func (*VideoURL_FrameInterval) FromVideoURLFrameInterval0

func (t *VideoURL_FrameInterval) FromVideoURLFrameInterval0(v VideoURLFrameInterval0) error

FromVideoURLFrameInterval0 overwrites any union data inside the VideoURL_FrameInterval as the provided VideoURLFrameInterval0

func (*VideoURL_FrameInterval) FromVideoURLFrameInterval1

func (t *VideoURL_FrameInterval) FromVideoURLFrameInterval1(v VideoURLFrameInterval1) error

FromVideoURLFrameInterval1 overwrites any union data inside the VideoURL_FrameInterval as the provided VideoURLFrameInterval1

func (VideoURL_FrameInterval) MarshalJSON

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

func (*VideoURL_FrameInterval) MergeVideoURLFrameInterval0

func (t *VideoURL_FrameInterval) MergeVideoURLFrameInterval0(v VideoURLFrameInterval0) error

MergeVideoURLFrameInterval0 performs a merge with any union data inside the VideoURL_FrameInterval, using the provided VideoURLFrameInterval0

func (*VideoURL_FrameInterval) MergeVideoURLFrameInterval1

func (t *VideoURL_FrameInterval) MergeVideoURLFrameInterval1(v VideoURLFrameInterval1) error

MergeVideoURLFrameInterval1 performs a merge with any union data inside the VideoURL_FrameInterval, using the provided VideoURLFrameInterval1

func (*VideoURL_FrameInterval) UnmarshalJSON

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

type WebSearchFilters

type WebSearchFilters struct {
	// LastUpdatedAfterFilter Return results updated after this date (MM/DD/YYYY)
	LastUpdatedAfterFilter *Date `json:"last_updated_after_filter,omitempty"`

	// LastUpdatedBeforeFilter Return results updated before this date (MM/DD/YYYY)
	LastUpdatedBeforeFilter *Date `json:"last_updated_before_filter,omitempty"`

	// SearchAfterDateFilter Return results published after this date (MM/DD/YYYY)
	SearchAfterDateFilter *Date `json:"search_after_date_filter,omitempty"`

	// SearchBeforeDateFilter Return results published before this date (MM/DD/YYYY)
	SearchBeforeDateFilter *Date `json:"search_before_date_filter,omitempty"`

	// SearchDomainFilter Limit search results to specific domains (max 20)
	SearchDomainFilter *[]string `json:"search_domain_filter,omitempty"`

	// SearchRecencyFilter Filter by publication recency (hour/day/week/month/year)
	SearchRecencyFilter *SearchRecencyFilter `json:"search_recency_filter,omitempty"`
}

WebSearchFilters defines model for WebSearchFilters.

type WebSearchOptions

type WebSearchOptions struct {
	// ImageResultsEnhancedRelevance When true, applies enhanced relevance filtering to image results
	ImageResultsEnhancedRelevance *bool `json:"image_results_enhanced_relevance,omitempty"`

	// SearchContextSize Amount of search context to include (low, medium, or high)
	SearchContextSize *WebSearchOptionsSearchContextSize `json:"search_context_size,omitempty"`

	// SearchType Search type (fast for speed, pro for quality, auto to let the model decide)
	SearchType   *WebSearchOptionsSearchType `json:"search_type,omitempty"`
	UserLocation *UserLocation               `json:"user_location,omitempty"`
}

WebSearchOptions Configuration options for web search behavior

type WebSearchOptionsSearchContextSize

type WebSearchOptionsSearchContextSize string

WebSearchOptionsSearchContextSize Amount of search context to include (low, medium, or high)

const (
	WebSearchOptionsSearchContextSizeHigh   WebSearchOptionsSearchContextSize = "high"
	WebSearchOptionsSearchContextSizeLow    WebSearchOptionsSearchContextSize = "low"
	WebSearchOptionsSearchContextSizeMedium WebSearchOptionsSearchContextSize = "medium"
)

Defines values for WebSearchOptionsSearchContextSize.

func (WebSearchOptionsSearchContextSize) Valid

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

type WebSearchOptionsSearchType

type WebSearchOptionsSearchType string

WebSearchOptionsSearchType defines model for WebSearchOptions.SearchType.

const (
	WebSearchOptionsSearchTypeAuto WebSearchOptionsSearchType = "auto"
	WebSearchOptionsSearchTypeFast WebSearchOptionsSearchType = "fast"
	WebSearchOptionsSearchTypePro  WebSearchOptionsSearchType = "pro"
)

Defines values for WebSearchOptionsSearchType.

func (WebSearchOptionsSearchType) Valid

func (e WebSearchOptionsSearchType) Valid() bool

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

type WebSearchTool

type WebSearchTool struct {
	// Filters Domain and date filters for search results
	Filters *WebSearchFilters `json:"filters,omitempty"`

	// MaxResults Upper bound on the number of search results collected per call. Must be between 1 and 50; values outside that range are rejected with a 400 error.
	MaxResults *int32 `json:"max_results,omitempty"`

	// MaxTokens Maximum total tokens for search context
	MaxTokens *int32 `json:"max_tokens,omitempty"`

	// MaxTokensPerPage Maximum tokens to extract per search result page
	MaxTokensPerPage *int32 `json:"max_tokens_per_page,omitempty"`

	// SearchType Search type for this tool. `web` uses standard web search. `fast` uses the lower-latency Fast Search path, billed at $1.00 per 1,000 invocations plus model tokens. When omitted, inherits the effort's search type if configured; otherwise uses `web`.
	SearchType *WebSearchToolSearchType `json:"search_type,omitempty"`

	// Type Tool type identifier
	Type WebSearchToolType `json:"type"`

	// UserLocation User's location for search personalization
	UserLocation *ToolUserLocation `json:"user_location,omitempty"`
}

WebSearchTool Web search tool configuration for the Responses API

type WebSearchToolSearchType

type WebSearchToolSearchType string

WebSearchToolSearchType Search type for this tool. `web` uses standard web search. `fast` uses the lower-latency Fast Search path, billed at $1.00 per 1,000 invocations plus model tokens. When omitted, inherits the effort's search type if configured; otherwise uses `web`.

const (
	WebSearchToolSearchTypeFast WebSearchToolSearchType = "fast"
	WebSearchToolSearchTypeWeb  WebSearchToolSearchType = "web"
)

Defines values for WebSearchToolSearchType.

func (WebSearchToolSearchType) Valid

func (e WebSearchToolSearchType) Valid() bool

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

type WebSearchToolType

type WebSearchToolType string

WebSearchToolType Tool type identifier

const (
	WebSearchToolTypeWebSearch WebSearchToolType = "web_search"
)

Defines values for WebSearchToolType.

func (WebSearchToolType) Valid

func (e WebSearchToolType) Valid() bool

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

Jump to

Keyboard shortcuts

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