cerebras

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

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

README

go-cerebras

Go Reference CI version license imported by

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

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

Contents

Install · Usage · Auth · Regenerating · Agent integrations · Development · License

Install

go get github.com/psyb0t/go-cerebras

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"
	"fmt"
	"net/http"
	"os"

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

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

		return nil
	})

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

	res, err := client.ListModelsV1ModelsGetWithResponse(
		context.Background(),
		&cerebras.ListModelsV1ModelsGetParams{},
	)
	if err != nil {
		panic(err)
	}

	list, err := res.JSON200.AsModelMetadataList()
	if err != nil {
		panic(err)
	}

	for _, m := range list.Data {
		fmt.Println(m.Id)
	}
}

example_test.go runs the same code against a local test server, so make test checks it.

Method names come from the spec's operation IDs, so they are long: ChatV1ChatCompletionsPost, CompletionsV1CompletionsPost, ListModelsV1ModelsGet, GetModelV1ModelsModelIdGet.

The full API is in the Go reference; after go get, go doc github.com/psyb0t/go-cerebras prints it locally.

Many schemas in the spec are anyOf unions, and oapi-codegen turns each into a struct with As... and From... methods. The model list response is one (AsModelMetadataList, or the OpenRouter and Hugging Face formats), the chat response is another (AsChatCompletionResponse), and so is every chat message. A user message is built like this:

var content cerebras.UserMessageRequest_Content
_ = content.FromUserMessageRequestContent0("hello")

role := cerebras.UserMessageRequestRoleUser

var msg cerebras.ChatCompletionRequest_Messages_Item
_ = msg.FromUserMessageRequest(cerebras.UserMessageRequest{Content: content, Role: &role})

res, err := client.ChatV1ChatCompletionsPostWithResponse(ctx,
	&cerebras.ChatV1ChatCompletionsPostParams{},
	cerebras.ChatCompletionRequest{Model: "<model-id>", Messages: []cerebras.ChatCompletionRequest_Messages_Item{msg}},
)

Auth

Cerebras uses a Bearer token: send the API key as Authorization: Bearer <key>. Create a key in the Cerebras Cloud console. The request editor in the usage example sets the header on every request. The spec doesn't list a server, so pass the base URL, https://api.cerebras.ai, yourself.

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 reads openapi_spec_url from the .stats.yml of Cerebras/cerebras-cloud-sdk-python and downloads that URL to api/openapi.yaml. Stainless hosts the spec under a URL with a content hash that changes on every update, so the script never hardcodes it.
  • oapi-codegen runs with config.yaml. The config maps number to float64, because 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-cerebras 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-cerebras@psyb0t
Codex
codex plugin marketplace add psyb0t/agents
codex plugin add go-cerebras@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-cerebras

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 Cerebras's published API specification. The specification itself is not redistributed here.

Documentation

Overview

Package cerebras 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 cerebras is a Go client for the Cerebras Inference API, generated with oapi-codegen from the OpenAPI document Cerebras publishes.

Example

This is the README usage example. A local test server stands in for https://api.cerebras.ai so the example runs without credentials.

package main

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

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

func main() {
	srv := httptest.NewServer(http.HandlerFunc(
		func(w http.ResponseWriter, _ *http.Request) {
			w.Header().Set("Content-Type", "application/json")
			_, _ = w.Write([]byte(
				`{"object":"list","data":[{"id":"model-x"}]}`,
			))
		},
	))
	defer srv.Close()

	baseURL := srv.URL // https://api.cerebras.ai in real use

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

			return nil
		},
	)

	client, err := cerebras.NewClientWithResponses(baseURL, auth)
	if err != nil {
		panic(err)
	}

	res, err := client.ListModelsV1ModelsGetWithResponse(
		context.Background(),
		&cerebras.ListModelsV1ModelsGetParams{},
	)
	if err != nil {
		panic(err)
	}

	list, err := res.JSON200.AsModelMetadataList()
	if err != nil {
		panic(err)
	}

	for _, m := range list.Data {
		fmt.Println(m.Id)
	}

}
Output:
model-x

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewChatV1ChatCompletionsPostRequest

func NewChatV1ChatCompletionsPostRequest(server string, params *ChatV1ChatCompletionsPostParams, body ChatV1ChatCompletionsPostJSONRequestBody) (*http.Request, error)

NewChatV1ChatCompletionsPostRequest calls the generic ChatV1ChatCompletionsPost builder with application/json body

func NewChatV1ChatCompletionsPostRequestWithBody

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

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

func NewCompletionsV1CompletionsPostRequest

func NewCompletionsV1CompletionsPostRequest(server string, params *CompletionsV1CompletionsPostParams, body CompletionsV1CompletionsPostJSONRequestBody) (*http.Request, error)

NewCompletionsV1CompletionsPostRequest calls the generic CompletionsV1CompletionsPost builder with application/json body

func NewCompletionsV1CompletionsPostRequestWithBody

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

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

func NewGetModelV1ModelsModelIdGetRequest

func NewGetModelV1ModelsModelIdGetRequest(server string, modelId string, params *GetModelV1ModelsModelIdGetParams) (*http.Request, error)

NewGetModelV1ModelsModelIdGetRequest constructs an http.Request for the GetModelV1ModelsModelIdGet method

func NewGetPublicModelPublicV1ModelsModelIdGetRequest

func NewGetPublicModelPublicV1ModelsModelIdGetRequest(server string, modelId string, params *GetPublicModelPublicV1ModelsModelIdGetParams) (*http.Request, error)

NewGetPublicModelPublicV1ModelsModelIdGetRequest constructs an http.Request for the GetPublicModelPublicV1ModelsModelIdGet method

func NewListModelsV1ModelsGetRequest

func NewListModelsV1ModelsGetRequest(server string, params *ListModelsV1ModelsGetParams) (*http.Request, error)

NewListModelsV1ModelsGetRequest constructs an http.Request for the ListModelsV1ModelsGet method

func NewListPublicModelsEndpointPublicV1ModelsGetRequest

func NewListPublicModelsEndpointPublicV1ModelsGetRequest(server string, params *ListPublicModelsEndpointPublicV1ModelsGetParams) (*http.Request, error)

NewListPublicModelsEndpointPublicV1ModelsGetRequest constructs an http.Request for the ListPublicModelsEndpointPublicV1ModelsGet method

func NewTcpWarmingV1TcpWarmingGetRequest

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

NewTcpWarmingV1TcpWarmingGetRequest constructs an http.Request for the TcpWarmingV1TcpWarmingGet method

Types

type AssistantMessageRequest

type AssistantMessageRequest struct {
	Content   *AssistantMessageRequest_Content   `json:"content,omitempty"`
	Name      *string                            `json:"name,omitempty"`
	Reasoning *AssistantMessageRequest_Reasoning `json:"reasoning,omitempty"`
	Role      *AssistantMessageRequestRole       `json:"role,omitempty"`
	ToolCalls *[]AssistantToolCall               `json:"tool_calls,omitempty"`
}

AssistantMessageRequest A message request from an assistant.

type AssistantMessageRequestContent0

type AssistantMessageRequestContent0 = string

AssistantMessageRequestContent0 defines model for AssistantMessageRequest.Content.0.

type AssistantMessageRequestContent1

type AssistantMessageRequestContent1 = []TextContent

AssistantMessageRequestContent1 defines model for AssistantMessageRequest.Content.1.

type AssistantMessageRequestReasoning0

type AssistantMessageRequestReasoning0 = string

AssistantMessageRequestReasoning0 defines model for AssistantMessageRequest.Reasoning.0.

type AssistantMessageRequestReasoning1

type AssistantMessageRequestReasoning1 = []TextContent

AssistantMessageRequestReasoning1 defines model for AssistantMessageRequest.Reasoning.1.

type AssistantMessageRequestRole

type AssistantMessageRequestRole string

AssistantMessageRequestRole defines model for AssistantMessageRequest.Role.

const (
	AssistantMessageRequestRoleAssistant AssistantMessageRequestRole = "assistant"
)

Defines values for AssistantMessageRequestRole.

func (AssistantMessageRequestRole) Valid

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

type AssistantMessageRequest_Content

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

AssistantMessageRequest_Content defines model for AssistantMessageRequest.Content.

func (AssistantMessageRequest_Content) AsAssistantMessageRequestContent0

func (t AssistantMessageRequest_Content) AsAssistantMessageRequestContent0() (AssistantMessageRequestContent0, error)

AsAssistantMessageRequestContent0 returns the union data inside the AssistantMessageRequest_Content as a AssistantMessageRequestContent0

func (AssistantMessageRequest_Content) AsAssistantMessageRequestContent1

func (t AssistantMessageRequest_Content) AsAssistantMessageRequestContent1() (AssistantMessageRequestContent1, error)

AsAssistantMessageRequestContent1 returns the union data inside the AssistantMessageRequest_Content as a AssistantMessageRequestContent1

func (*AssistantMessageRequest_Content) FromAssistantMessageRequestContent0

func (t *AssistantMessageRequest_Content) FromAssistantMessageRequestContent0(v AssistantMessageRequestContent0) error

FromAssistantMessageRequestContent0 overwrites any union data inside the AssistantMessageRequest_Content as the provided AssistantMessageRequestContent0

func (*AssistantMessageRequest_Content) FromAssistantMessageRequestContent1

func (t *AssistantMessageRequest_Content) FromAssistantMessageRequestContent1(v AssistantMessageRequestContent1) error

FromAssistantMessageRequestContent1 overwrites any union data inside the AssistantMessageRequest_Content as the provided AssistantMessageRequestContent1

func (AssistantMessageRequest_Content) MarshalJSON

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

func (*AssistantMessageRequest_Content) MergeAssistantMessageRequestContent0

func (t *AssistantMessageRequest_Content) MergeAssistantMessageRequestContent0(v AssistantMessageRequestContent0) error

MergeAssistantMessageRequestContent0 performs a merge with any union data inside the AssistantMessageRequest_Content, using the provided AssistantMessageRequestContent0

func (*AssistantMessageRequest_Content) MergeAssistantMessageRequestContent1

func (t *AssistantMessageRequest_Content) MergeAssistantMessageRequestContent1(v AssistantMessageRequestContent1) error

MergeAssistantMessageRequestContent1 performs a merge with any union data inside the AssistantMessageRequest_Content, using the provided AssistantMessageRequestContent1

func (*AssistantMessageRequest_Content) UnmarshalJSON

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

type AssistantMessageRequest_Reasoning

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

AssistantMessageRequest_Reasoning defines model for AssistantMessageRequest.Reasoning.

func (AssistantMessageRequest_Reasoning) AsAssistantMessageRequestReasoning0

func (t AssistantMessageRequest_Reasoning) AsAssistantMessageRequestReasoning0() (AssistantMessageRequestReasoning0, error)

AsAssistantMessageRequestReasoning0 returns the union data inside the AssistantMessageRequest_Reasoning as a AssistantMessageRequestReasoning0

func (AssistantMessageRequest_Reasoning) AsAssistantMessageRequestReasoning1

func (t AssistantMessageRequest_Reasoning) AsAssistantMessageRequestReasoning1() (AssistantMessageRequestReasoning1, error)

AsAssistantMessageRequestReasoning1 returns the union data inside the AssistantMessageRequest_Reasoning as a AssistantMessageRequestReasoning1

func (*AssistantMessageRequest_Reasoning) FromAssistantMessageRequestReasoning0

func (t *AssistantMessageRequest_Reasoning) FromAssistantMessageRequestReasoning0(v AssistantMessageRequestReasoning0) error

FromAssistantMessageRequestReasoning0 overwrites any union data inside the AssistantMessageRequest_Reasoning as the provided AssistantMessageRequestReasoning0

func (*AssistantMessageRequest_Reasoning) FromAssistantMessageRequestReasoning1

func (t *AssistantMessageRequest_Reasoning) FromAssistantMessageRequestReasoning1(v AssistantMessageRequestReasoning1) error

FromAssistantMessageRequestReasoning1 overwrites any union data inside the AssistantMessageRequest_Reasoning as the provided AssistantMessageRequestReasoning1

func (AssistantMessageRequest_Reasoning) MarshalJSON

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

func (*AssistantMessageRequest_Reasoning) MergeAssistantMessageRequestReasoning0

func (t *AssistantMessageRequest_Reasoning) MergeAssistantMessageRequestReasoning0(v AssistantMessageRequestReasoning0) error

MergeAssistantMessageRequestReasoning0 performs a merge with any union data inside the AssistantMessageRequest_Reasoning, using the provided AssistantMessageRequestReasoning0

func (*AssistantMessageRequest_Reasoning) MergeAssistantMessageRequestReasoning1

func (t *AssistantMessageRequest_Reasoning) MergeAssistantMessageRequestReasoning1(v AssistantMessageRequestReasoning1) error

MergeAssistantMessageRequestReasoning1 performs a merge with any union data inside the AssistantMessageRequest_Reasoning, using the provided AssistantMessageRequestReasoning1

func (*AssistantMessageRequest_Reasoning) UnmarshalJSON

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

type AssistantToolCall

type AssistantToolCall struct {
	// Function A function call for an assistant tool.
	Function AssistantToolCallFunction `json:"function"`
	Id       string                    `json:"id"`
	Index    *int                      `json:"index,omitempty"`
	Type     AssistantToolCallType     `json:"type"`
}

AssistantToolCall A tool call for an assistant.

type AssistantToolCallFunction

type AssistantToolCallFunction struct {
	Arguments string `json:"arguments"`
	Name      string `json:"name"`
}

AssistantToolCallFunction A function call for an assistant tool.

type AssistantToolCallType

type AssistantToolCallType string

AssistantToolCallType defines model for AssistantToolCall.Type.

const (
	AssistantToolCallTypeFunction AssistantToolCallType = "function"
)

Defines values for AssistantToolCallType.

func (AssistantToolCallType) Valid

func (e AssistantToolCallType) Valid() bool

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

type ChatChunkChoice

type ChatChunkChoice struct {
	Delta             *ChunkResponseMessage        `json:"delta,omitempty"`
	FinishReason      *ChatChunkChoiceFinishReason `json:"finish_reason,omitempty"`
	Index             int                          `json:"index"`
	Logprobs          *ChatCompletionLogProbs      `json:"logprobs,omitempty"`
	ReasoningLogprobs *ChatCompletionLogProbs      `json:"reasoning_logprobs,omitempty"`
	// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
	Text *string `json:"text,omitempty"`
	// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
	Tokens *[]int `json:"tokens,omitempty"`
}

ChatChunkChoice defines model for ChatChunkChoice.

type ChatChunkChoiceFinishReason

type ChatChunkChoiceFinishReason string

ChatChunkChoiceFinishReason defines model for ChatChunkChoice.FinishReason.

const (
	ChatChunkChoiceFinishReasonContentFilter ChatChunkChoiceFinishReason = "content_filter"
	ChatChunkChoiceFinishReasonLength        ChatChunkChoiceFinishReason = "length"
	ChatChunkChoiceFinishReasonStop          ChatChunkChoiceFinishReason = "stop"
	ChatChunkChoiceFinishReasonToolCalls     ChatChunkChoiceFinishReason = "tool_calls"
)

Defines values for ChatChunkChoiceFinishReason.

func (ChatChunkChoiceFinishReason) Valid

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

type ChatChunkResponse

type ChatChunkResponse struct {
	Choices           *[]ChatChunkChoice      `json:"choices,omitempty"`
	Created           int                     `json:"created"`
	Id                string                  `json:"id"`
	Model             string                  `json:"model"`
	Object            ChatChunkResponseObject `json:"object"`
	ServiceTier       *string                 `json:"service_tier,omitempty"`
	SystemFingerprint string                  `json:"system_fingerprint"`
	TimeInfo          *TimeInfo               `json:"time_info,omitempty"`
	Usage             *Usage                  `json:"usage,omitempty"`
}

ChatChunkResponse Examples: {"choices":[{"delta":{"role":"assistant"},"index":0}],"created":1721088719,"id":"response_1721","model":"llama3.1-8b","object":"chat.completion.chunk","system_fingerprint":"88719"}, {"choices":[{"delta":{"content":"Generative "},"index":0}],"created":1721088719,"id":"response_1721","model":"llama3.1-8b","object":"chat.completion.chunk","system_fingerprint":"88719"}, {"choices":[{"delta":{},"finish_reason":"stop","index":0}],"created":1721088719,"id":"response_1721","model":"llama3.1-8b","object":"chat.completion.chunk","system_fingerprint":"88719","time_info":{"completion_time":0.44,"prompt_time":0.02,"queue_time":0,"total_time":0.46},"usage":{"completion_tokens":1020,"prompt_tokens":40,"prompt_tokens_details":{"cached_tokens":1020},"total_tokens":1060}}

type ChatChunkResponseObject

type ChatChunkResponseObject string

ChatChunkResponseObject defines model for ChatChunkResponse.Object.

const (
	ChatChunkResponseObjectChatCompletionChunk ChatChunkResponseObject = "chat.completion.chunk"
)

Defines values for ChatChunkResponseObject.

func (ChatChunkResponseObject) Valid

func (e ChatChunkResponseObject) Valid() bool

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

type ChatCompletionChoice

type ChatCompletionChoice struct {
	FinishReason      *ChatCompletionChoiceFinishReason `json:"finish_reason,omitempty"`
	Index             int                               `json:"index"`
	Logprobs          *ChatCompletionLogProbs           `json:"logprobs,omitempty"`
	Message           ChatCompletionResponseMessage     `json:"message"`
	ReasoningLogprobs *ChatCompletionLogProbs           `json:"reasoning_logprobs,omitempty"`
}

ChatCompletionChoice defines model for ChatCompletionChoice.

type ChatCompletionChoiceFinishReason

type ChatCompletionChoiceFinishReason string

ChatCompletionChoiceFinishReason defines model for ChatCompletionChoice.FinishReason.

const (
	ChatCompletionChoiceFinishReasonContentFilter ChatCompletionChoiceFinishReason = "content_filter"
	ChatCompletionChoiceFinishReasonLength        ChatCompletionChoiceFinishReason = "length"
	ChatCompletionChoiceFinishReasonStop          ChatCompletionChoiceFinishReason = "stop"
	ChatCompletionChoiceFinishReasonToolCalls     ChatCompletionChoiceFinishReason = "tool_calls"
)

Defines values for ChatCompletionChoiceFinishReason.

func (ChatCompletionChoiceFinishReason) Valid

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

type ChatCompletionLogProbs

type ChatCompletionLogProbs struct {
	Content *[]LogProbsContent `json:"content,omitempty"`
	Refusal *[]LogProbsContent `json:"refusal,omitempty"`
}

ChatCompletionLogProbs defines model for ChatCompletionLogProbs.

type ChatCompletionRequest

type ChatCompletionRequest struct {
	// ClearThinking When True, removes reasoning content from messages that appear before the latest user message.
	ClearThinking *bool `json:"clear_thinking,omitempty"`

	// DisableReasoning Disables reasoning for reasoning models. If set to True, the model will not use any reasoning in its response.
	DisableReasoning *bool `json:"disable_reasoning,omitempty"`

	// FrequencyPenalty Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
	FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"`

	// LogitBias Modify the likelihood of specified tokens appearing in the completion.
	//
	// Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
	LogitBias *map[string]float64 `json:"logit_bias,omitempty"`

	// Logprobs Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
	Logprobs *bool `json:"logprobs,omitempty"`

	// MaxCompletionTokens An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens.
	MaxCompletionTokens *int `json:"max_completion_tokens,omitempty"`

	// MaxTokens The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. This value is now deprecated in favor of max_completion_tokens.
	MaxTokens *int                                  `json:"max_tokens,omitempty"`
	Messages  []ChatCompletionRequest_Messages_Item `json:"messages"`

	// MinCompletionTokens The minimum number of tokens to generate for a completion. If not specified or set to 0, the model will generate as many tokens as it deems necessary. Setting to -1 sets to max sequence length.
	MinCompletionTokens *int `json:"min_completion_tokens,omitempty"`

	// MinTokens The minimum number of tokens to generate for a completion. If not specified or set to 0, the model will generate as many tokens as it deems necessary. Setting to -1 sets to max sequence length.
	MinTokens *int   `json:"min_tokens,omitempty"`
	Model     string `json:"model"`

	// ModelParameters Model-specific parameters. The accepted keys and values are defined per-model by the model's “model_parameters“ schema. The schema is used downstream to validate the contents of this field. Unsupported for models that declare none.
	ModelParameters *map[string]interface{} `json:"model_parameters,omitempty"`

	// N How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs.
	N                 *int  `json:"n,omitempty"`
	ParallelToolCalls *bool `json:"parallel_tool_calls,omitempty"`

	// Prediction Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time. This is most common when regenerating a file with only minor changes to most of the content.
	Prediction *Prediction `json:"prediction,omitempty"`

	// PresencePenalty Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
	PresencePenalty *float64 `json:"presence_penalty,omitempty"`

	// PromptCacheKey An optional opaque string. The requests with the same prompt cache key would highly likely share the same prompt prefixes. Examples would be IDs of chat conversations, IDs of users, the hashes of system prompts, etc.
	PromptCacheKey *string `json:"prompt_cache_key,omitempty"`

	// ReasoningEffort Constrains effort on reasoning for reasoning models. Currently supported values are none, low, medium, and high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. If set to None, the model will use the default reasoning effort for the model. If set to 'none', the model will not reason
	ReasoningEffort *ReasoningEffort `json:"reasoning_effort,omitempty"`

	// ReasoningFormat Determines how reasoning is returned in the response. If set to `parsed`, the reasoning will be returned in the `reasoning` field of the response message as a string. If set to `raw`, the reasoning will be returned in the `content` field of the response message with special tokens. If set to `hidden`, the reasoning will not be returned in the response. If set to `none`, the model's default behavior will be used. If set to `text_parsed`, the reasoning will be returned in the `reasoning` field of the response message as a string, similar to `parsed`, but logprobs will not be separated into `reasoning_logprobs` and `logprobs`.
	ReasoningFormat *ReasoningFormat `json:"reasoning_format,omitempty"`
	ResponseFormat  *struct {
		// contains filtered or unexported fields
	} `json:"response_format,omitempty"`

	// Seed If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. Determinism is not guaranteed.
	Seed        *int         `json:"seed,omitempty"`
	ServiceTier *ServiceTier `json:"service_tier,omitempty"`

	// Stop Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
	Stop          *ChatCompletionRequest_Stop `json:"stop,omitempty"`
	Stream        *bool                       `json:"stream,omitempty"`
	StreamOptions *StreamOptions              `json:"stream_options,omitempty"`

	// Temperature What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both.
	Temperature *float64                          `json:"temperature,omitempty"`
	ToolChoice  *ChatCompletionRequest_ToolChoice `json:"tool_choice,omitempty"`
	Tools       *[]Tool                           `json:"tools,omitempty"`

	// TopLogprobs An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.
	TopLogprobs *int `json:"top_logprobs,omitempty"`

	// TopP An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.
	TopP *float64 `json:"top_p,omitempty"`

	// User A unique identifier representing your end-user, which can help Cerebras to monitor and detect abuse.
	User *string `json:"user,omitempty"`
}

ChatCompletionRequest Generic base class for chat completion requests.

Examples: {"max_completion_tokens":-1,"messages":[{"content":"You are a helpful assistant running on a CS-3 hardware at Cerebras Systems","role":"system"},{"content":"What is Generative AI?","role":"user"}],"min_tokens":1000,"model":"llama3.1-8b","seed":0,"stop_sequence":null,"stream":false,"temperature":0,"top_p":1}

type ChatCompletionRequestStop0

type ChatCompletionRequestStop0 = string

ChatCompletionRequestStop0 defines model for ChatCompletionRequest.Stop.0.

type ChatCompletionRequestStop1

type ChatCompletionRequestStop1 = []string

ChatCompletionRequestStop1 defines model for ChatCompletionRequest.Stop.1.

type ChatCompletionRequest_Messages_Item

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

ChatCompletionRequest_Messages_Item defines model for ChatCompletionRequest.messages.Item.

func (ChatCompletionRequest_Messages_Item) AsAssistantMessageRequest

func (t ChatCompletionRequest_Messages_Item) AsAssistantMessageRequest() (AssistantMessageRequest, error)

AsAssistantMessageRequest returns the union data inside the ChatCompletionRequest_Messages_Item as a AssistantMessageRequest

func (ChatCompletionRequest_Messages_Item) AsDeveloperMessageRequest

func (t ChatCompletionRequest_Messages_Item) AsDeveloperMessageRequest() (DeveloperMessageRequest, error)

AsDeveloperMessageRequest returns the union data inside the ChatCompletionRequest_Messages_Item as a DeveloperMessageRequest

func (ChatCompletionRequest_Messages_Item) AsSystemMessageRequest

func (t ChatCompletionRequest_Messages_Item) AsSystemMessageRequest() (SystemMessageRequest, error)

AsSystemMessageRequest returns the union data inside the ChatCompletionRequest_Messages_Item as a SystemMessageRequest

func (ChatCompletionRequest_Messages_Item) AsToolMessageRequest

func (t ChatCompletionRequest_Messages_Item) AsToolMessageRequest() (ToolMessageRequest, error)

AsToolMessageRequest returns the union data inside the ChatCompletionRequest_Messages_Item as a ToolMessageRequest

func (ChatCompletionRequest_Messages_Item) AsUserMessageRequest

func (t ChatCompletionRequest_Messages_Item) AsUserMessageRequest() (UserMessageRequest, error)

AsUserMessageRequest returns the union data inside the ChatCompletionRequest_Messages_Item as a UserMessageRequest

func (ChatCompletionRequest_Messages_Item) Discriminator

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

func (*ChatCompletionRequest_Messages_Item) FromAssistantMessageRequest

func (t *ChatCompletionRequest_Messages_Item) FromAssistantMessageRequest(v AssistantMessageRequest) error

FromAssistantMessageRequest overwrites any union data inside the ChatCompletionRequest_Messages_Item as the provided AssistantMessageRequest

func (*ChatCompletionRequest_Messages_Item) FromDeveloperMessageRequest

func (t *ChatCompletionRequest_Messages_Item) FromDeveloperMessageRequest(v DeveloperMessageRequest) error

FromDeveloperMessageRequest overwrites any union data inside the ChatCompletionRequest_Messages_Item as the provided DeveloperMessageRequest

func (*ChatCompletionRequest_Messages_Item) FromSystemMessageRequest

func (t *ChatCompletionRequest_Messages_Item) FromSystemMessageRequest(v SystemMessageRequest) error

FromSystemMessageRequest overwrites any union data inside the ChatCompletionRequest_Messages_Item as the provided SystemMessageRequest

func (*ChatCompletionRequest_Messages_Item) FromToolMessageRequest

func (t *ChatCompletionRequest_Messages_Item) FromToolMessageRequest(v ToolMessageRequest) error

FromToolMessageRequest overwrites any union data inside the ChatCompletionRequest_Messages_Item as the provided ToolMessageRequest

func (*ChatCompletionRequest_Messages_Item) FromUserMessageRequest

func (t *ChatCompletionRequest_Messages_Item) FromUserMessageRequest(v UserMessageRequest) error

FromUserMessageRequest overwrites any union data inside the ChatCompletionRequest_Messages_Item as the provided UserMessageRequest

func (ChatCompletionRequest_Messages_Item) MarshalJSON

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

func (*ChatCompletionRequest_Messages_Item) MergeAssistantMessageRequest

func (t *ChatCompletionRequest_Messages_Item) MergeAssistantMessageRequest(v AssistantMessageRequest) error

MergeAssistantMessageRequest performs a merge with any union data inside the ChatCompletionRequest_Messages_Item, using the provided AssistantMessageRequest

func (*ChatCompletionRequest_Messages_Item) MergeDeveloperMessageRequest

func (t *ChatCompletionRequest_Messages_Item) MergeDeveloperMessageRequest(v DeveloperMessageRequest) error

MergeDeveloperMessageRequest performs a merge with any union data inside the ChatCompletionRequest_Messages_Item, using the provided DeveloperMessageRequest

func (*ChatCompletionRequest_Messages_Item) MergeSystemMessageRequest

func (t *ChatCompletionRequest_Messages_Item) MergeSystemMessageRequest(v SystemMessageRequest) error

MergeSystemMessageRequest performs a merge with any union data inside the ChatCompletionRequest_Messages_Item, using the provided SystemMessageRequest

func (*ChatCompletionRequest_Messages_Item) MergeToolMessageRequest

func (t *ChatCompletionRequest_Messages_Item) MergeToolMessageRequest(v ToolMessageRequest) error

MergeToolMessageRequest performs a merge with any union data inside the ChatCompletionRequest_Messages_Item, using the provided ToolMessageRequest

func (*ChatCompletionRequest_Messages_Item) MergeUserMessageRequest

func (t *ChatCompletionRequest_Messages_Item) MergeUserMessageRequest(v UserMessageRequest) error

MergeUserMessageRequest performs a merge with any union data inside the ChatCompletionRequest_Messages_Item, using the provided UserMessageRequest

func (*ChatCompletionRequest_Messages_Item) UnmarshalJSON

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

func (ChatCompletionRequest_Messages_Item) ValueByDiscriminator

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

type ChatCompletionRequest_Stop

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

ChatCompletionRequest_Stop Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.

func (ChatCompletionRequest_Stop) AsChatCompletionRequestStop0

func (t ChatCompletionRequest_Stop) AsChatCompletionRequestStop0() (ChatCompletionRequestStop0, error)

AsChatCompletionRequestStop0 returns the union data inside the ChatCompletionRequest_Stop as a ChatCompletionRequestStop0

func (ChatCompletionRequest_Stop) AsChatCompletionRequestStop1

func (t ChatCompletionRequest_Stop) AsChatCompletionRequestStop1() (ChatCompletionRequestStop1, error)

AsChatCompletionRequestStop1 returns the union data inside the ChatCompletionRequest_Stop as a ChatCompletionRequestStop1

func (*ChatCompletionRequest_Stop) FromChatCompletionRequestStop0

func (t *ChatCompletionRequest_Stop) FromChatCompletionRequestStop0(v ChatCompletionRequestStop0) error

FromChatCompletionRequestStop0 overwrites any union data inside the ChatCompletionRequest_Stop as the provided ChatCompletionRequestStop0

func (*ChatCompletionRequest_Stop) FromChatCompletionRequestStop1

func (t *ChatCompletionRequest_Stop) FromChatCompletionRequestStop1(v ChatCompletionRequestStop1) error

FromChatCompletionRequestStop1 overwrites any union data inside the ChatCompletionRequest_Stop as the provided ChatCompletionRequestStop1

func (ChatCompletionRequest_Stop) MarshalJSON

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

func (*ChatCompletionRequest_Stop) MergeChatCompletionRequestStop0

func (t *ChatCompletionRequest_Stop) MergeChatCompletionRequestStop0(v ChatCompletionRequestStop0) error

MergeChatCompletionRequestStop0 performs a merge with any union data inside the ChatCompletionRequest_Stop, using the provided ChatCompletionRequestStop0

func (*ChatCompletionRequest_Stop) MergeChatCompletionRequestStop1

func (t *ChatCompletionRequest_Stop) MergeChatCompletionRequestStop1(v ChatCompletionRequestStop1) error

MergeChatCompletionRequestStop1 performs a merge with any union data inside the ChatCompletionRequest_Stop, using the provided ChatCompletionRequestStop1

func (*ChatCompletionRequest_Stop) UnmarshalJSON

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

type ChatCompletionRequest_ToolChoice

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

ChatCompletionRequest_ToolChoice defines model for ChatCompletionRequest.ToolChoice.

func (ChatCompletionRequest_ToolChoice) AsChoiceObject

func (t ChatCompletionRequest_ToolChoice) AsChoiceObject() (ChoiceObject, error)

AsChoiceObject returns the union data inside the ChatCompletionRequest_ToolChoice as a ChoiceObject

func (ChatCompletionRequest_ToolChoice) AsToolChoice

AsToolChoice returns the union data inside the ChatCompletionRequest_ToolChoice as a ToolChoice

func (*ChatCompletionRequest_ToolChoice) FromChoiceObject

func (t *ChatCompletionRequest_ToolChoice) FromChoiceObject(v ChoiceObject) error

FromChoiceObject overwrites any union data inside the ChatCompletionRequest_ToolChoice as the provided ChoiceObject

func (*ChatCompletionRequest_ToolChoice) FromToolChoice

func (t *ChatCompletionRequest_ToolChoice) FromToolChoice(v ToolChoice) error

FromToolChoice overwrites any union data inside the ChatCompletionRequest_ToolChoice as the provided ToolChoice

func (ChatCompletionRequest_ToolChoice) MarshalJSON

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

func (*ChatCompletionRequest_ToolChoice) MergeChoiceObject

func (t *ChatCompletionRequest_ToolChoice) MergeChoiceObject(v ChoiceObject) error

MergeChoiceObject performs a merge with any union data inside the ChatCompletionRequest_ToolChoice, using the provided ChoiceObject

func (*ChatCompletionRequest_ToolChoice) MergeToolChoice

func (t *ChatCompletionRequest_ToolChoice) MergeToolChoice(v ToolChoice) error

MergeToolChoice performs a merge with any union data inside the ChatCompletionRequest_ToolChoice, using the provided ToolChoice

func (*ChatCompletionRequest_ToolChoice) UnmarshalJSON

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

type ChatCompletionResponse

type ChatCompletionResponse struct {
	Choices           []ChatCompletionChoice       `json:"choices"`
	Created           int                          `json:"created"`
	Id                string                       `json:"id"`
	Model             string                       `json:"model"`
	Object            ChatCompletionResponseObject `json:"object"`
	ServiceTier       *string                      `json:"service_tier,omitempty"`
	SystemFingerprint string                       `json:"system_fingerprint"`
	TimeInfo          *TimeInfo                    `json:"time_info,omitempty"`
	Usage             *Usage                       `json:"usage,omitempty"`
}

ChatCompletionResponse Examples: {"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Generative AI is a subfield of artificial intelligence that focuses on generating new, original content, such as images, music, text, or videos. These models are trained on large datasets and learn to recognize patterns, relationships, and structures within the data, allowing them to generate new content that is similar in style, tone, or characteristics to the training data. \n \n Generative AI models can be categorized into two main types: Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs). GANs consist of two neural networks: a generator and a discriminator. The generator creates new content, while the discriminator evaluates the generated content and tells the generator whether it's realistic or not. VAEs are neural networks that learn to compress and reconstruct data. \n \n Generative AI has numerous applications across various industries, including art and design, content generation, data augmentation, and recommendation systems. Some examples of Generative AI in action include Deep Dream Generator, Amper Music, and DALL-E. \n \n In summary, Generative AI is a powerful technology that enables the creation of new, original content using machine learning models. It has the potential to revolutionize various industries and create new opportunities for artists, designers, and content creators.","role":"assistant"}}],"created":1721088719,"id":"response_1721","model":"llama3.1-8b","object":"chat.completion","system_fingerprint":"88719","time_info":{"completion_time":0.44,"prompt_time":0.02,"queue_time":0,"total_time":0.46},"usage":{"completion_tokens":1020,"prompt_tokens":40,"prompt_tokens_details":{"cached_tokens":1020},"total_tokens":1060}}

type ChatCompletionResponseMessage

type ChatCompletionResponseMessage struct {
	Content   *string                           `json:"content,omitempty"`
	Reasoning *string                           `json:"reasoning,omitempty"`
	Role      ChatCompletionResponseMessageRole `json:"role"`
	ToolCalls *[]ChunkAssistantToolCall         `json:"tool_calls,omitempty"`
}

ChatCompletionResponseMessage defines model for ChatCompletionResponseMessage.

type ChatCompletionResponseMessageRole

type ChatCompletionResponseMessageRole string

ChatCompletionResponseMessageRole defines model for ChatCompletionResponseMessage.Role.

const (
	ChatCompletionResponseMessageRoleAssistant ChatCompletionResponseMessageRole = "assistant"
	ChatCompletionResponseMessageRoleSystem    ChatCompletionResponseMessageRole = "system"
	ChatCompletionResponseMessageRoleTool      ChatCompletionResponseMessageRole = "tool"
	ChatCompletionResponseMessageRoleUser      ChatCompletionResponseMessageRole = "user"
)

Defines values for ChatCompletionResponseMessageRole.

func (ChatCompletionResponseMessageRole) Valid

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

type ChatCompletionResponseObject

type ChatCompletionResponseObject string

ChatCompletionResponseObject defines model for ChatCompletionResponse.Object.

const (
	ChatCompletionResponseObjectChatCompletion ChatCompletionResponseObject = "chat.completion"
)

Defines values for ChatCompletionResponseObject.

func (ChatCompletionResponseObject) Valid

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

type ChatV1ChatCompletionsPostJSONRequestBody

type ChatV1ChatCompletionsPostJSONRequestBody = ChatCompletionRequest

ChatV1ChatCompletionsPostJSONRequestBody defines body for ChatV1ChatCompletionsPost for application/json ContentType.

type ChatV1ChatCompletionsPostParams

type ChatV1ChatCompletionsPostParams struct {
	XAmzCfId   *string  `json:"X-Amz-Cf-Id,omitempty"`
	CFRAY      *string  `json:"CF-RAY,omitempty"`
	XDelayTime *float64 `json:"X-delay-time,omitempty"`
}

ChatV1ChatCompletionsPostParams defines parameters for ChatV1ChatCompletionsPost.

type ChatV1ChatCompletionsPostResponse

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

func ParseChatV1ChatCompletionsPostResponse

func ParseChatV1ChatCompletionsPostResponse(rsp *http.Response) (*ChatV1ChatCompletionsPostResponse, error)

ParseChatV1ChatCompletionsPostResponse parses an HTTP response from a ChatV1ChatCompletionsPostWithResponse call

func (ChatV1ChatCompletionsPostResponse) ContentType

func (r ChatV1ChatCompletionsPostResponse) ContentType() string

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

func (ChatV1ChatCompletionsPostResponse) GetBody

GetBody returns the raw response body bytes

func (ChatV1ChatCompletionsPostResponse) GetJSON200

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

func (ChatV1ChatCompletionsPostResponse) GetJSON422

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

func (ChatV1ChatCompletionsPostResponse) Status

Status returns HTTPResponse.Status

func (ChatV1ChatCompletionsPostResponse) StatusCode

func (r ChatV1ChatCompletionsPostResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ChoiceObject

type ChoiceObject struct {
	// Function A function for a choice object.
	Function ChoiceObjectFunction `json:"function"`
	Type     string               `json:"type"`
}

ChoiceObject A choice object.

type ChoiceObjectFunction

type ChoiceObjectFunction struct {
	Name string `json:"name"`
}

ChoiceObjectFunction A function for a choice object.

type ChunkAssistantToolCall

type ChunkAssistantToolCall struct {
	// Function Streaming only. Represents a function in an assistant tool call.
	Function ChunkAssistantToolCallFunction `json:"function"`
	Id       *string                        `json:"id,omitempty"`
	Index    *int                           `json:"index,omitempty"`
	Type     ChunkAssistantToolCallType     `json:"type"`
}

ChunkAssistantToolCall Streaming only. Represents a function call in an assistant tool call.

type ChunkAssistantToolCallFunction

type ChunkAssistantToolCallFunction struct {
	Arguments *string `json:"arguments,omitempty"`
	Name      *string `json:"name,omitempty"`
}

ChunkAssistantToolCallFunction Streaming only. Represents a function in an assistant tool call.

type ChunkAssistantToolCallType

type ChunkAssistantToolCallType string

ChunkAssistantToolCallType defines model for ChunkAssistantToolCall.Type.

const (
	ChunkAssistantToolCallTypeFunction ChunkAssistantToolCallType = "function"
)

Defines values for ChunkAssistantToolCallType.

func (ChunkAssistantToolCallType) Valid

func (e ChunkAssistantToolCallType) Valid() bool

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

type ChunkResponseMessage

type ChunkResponseMessage struct {
	Content   *string                   `json:"content,omitempty"`
	Reasoning *string                   `json:"reasoning,omitempty"`
	Role      *ChunkResponseMessageRole `json:"role,omitempty"`
	// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
	Tokens    *[]int                    `json:"tokens,omitempty"`
	ToolCalls *[]ChunkAssistantToolCall `json:"tool_calls,omitempty"`
}

ChunkResponseMessage defines model for ChunkResponseMessage.

type ChunkResponseMessageRole

type ChunkResponseMessageRole string

ChunkResponseMessageRole defines model for ChunkResponseMessage.Role.

const (
	ChunkResponseMessageRoleAssistant ChunkResponseMessageRole = "assistant"
	ChunkResponseMessageRoleSystem    ChunkResponseMessageRole = "system"
	ChunkResponseMessageRoleTool      ChunkResponseMessageRole = "tool"
	ChunkResponseMessageRoleUser      ChunkResponseMessageRole = "user"
)

Defines values for ChunkResponseMessageRole.

func (ChunkResponseMessageRole) Valid

func (e ChunkResponseMessageRole) Valid() bool

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

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) ChatV1ChatCompletionsPost

func (c *Client) ChatV1ChatCompletionsPost(ctx context.Context, params *ChatV1ChatCompletionsPostParams, body ChatV1ChatCompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

ChatV1ChatCompletionsPost Chat

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

Corresponds with POST /v1/chat/completions (the `ChatV1ChatCompletionsPost` operationId).

func (*Client) ChatV1ChatCompletionsPostWithBody

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

ChatV1ChatCompletionsPostWithBody Chat

Takes any type of body and a specified content type.

Corresponds with POST /v1/chat/completions (the `ChatV1ChatCompletionsPost` operationId).

func (*Client) CompletionsV1CompletionsPost

func (c *Client) CompletionsV1CompletionsPost(ctx context.Context, params *CompletionsV1CompletionsPostParams, body CompletionsV1CompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

CompletionsV1CompletionsPost Completions

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

Corresponds with POST /v1/completions (the `CompletionsV1CompletionsPost` operationId).

func (*Client) CompletionsV1CompletionsPostWithBody

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

CompletionsV1CompletionsPostWithBody Completions

Takes any type of body and a specified content type.

Corresponds with POST /v1/completions (the `CompletionsV1CompletionsPost` operationId).

func (*Client) GetModelV1ModelsModelIdGet

func (c *Client) GetModelV1ModelsModelIdGet(ctx context.Context, modelId string, params *GetModelV1ModelsModelIdGetParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetModelV1ModelsModelIdGet Get Model

Corresponds with GET /v1/models/{model_id} (the `GetModelV1ModelsModelIdGet` operationId).

func (*Client) GetPublicModelPublicV1ModelsModelIdGet

func (c *Client) GetPublicModelPublicV1ModelsModelIdGet(ctx context.Context, modelId string, params *GetPublicModelPublicV1ModelsModelIdGetParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetPublicModelPublicV1ModelsModelIdGet Retrieve a specific model

Retrieve a specific publicly available model by ID (modelVisibility='PUBLIC' only). Use the `format` parameter to get responses compatible with OpenRouter or HuggingFace APIs.

Corresponds with GET /public/v1/models/{model_id} (the `GetPublicModelPublicV1ModelsModelIdGet` operationId).

func (*Client) ListModelsV1ModelsGet

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

ListModelsV1ModelsGet List Models

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

func (*Client) ListPublicModelsEndpointPublicV1ModelsGet

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

ListPublicModelsEndpointPublicV1ModelsGet List all available models

List all publicly available models (modelVisibility='PUBLIC' only). Use the `format` parameter to get responses compatible with OpenRouter or HuggingFace APIs.

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

func (*Client) TcpWarmingV1TcpWarmingGet

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

TcpWarmingV1TcpWarmingGet Tcp Warming

Corresponds with GET /v1/tcp_warming (the `TcpWarmingV1TcpWarmingGet` operationId).

type ClientInterface

type ClientInterface interface {

	// ListPublicModelsEndpointPublicV1ModelsGet List all available models
	//
	// List all publicly available models (modelVisibility='PUBLIC' only). Use the `format` parameter to get responses compatible with OpenRouter or HuggingFace APIs.
	//
	// Corresponds with GET /public/v1/models (the `ListPublicModelsEndpointPublicV1ModelsGet` operationId).
	ListPublicModelsEndpointPublicV1ModelsGet(ctx context.Context, params *ListPublicModelsEndpointPublicV1ModelsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetPublicModelPublicV1ModelsModelIdGet Retrieve a specific model
	//
	// Retrieve a specific publicly available model by ID (modelVisibility='PUBLIC' only). Use the `format` parameter to get responses compatible with OpenRouter or HuggingFace APIs.
	//
	// Corresponds with GET /public/v1/models/{model_id} (the `GetPublicModelPublicV1ModelsModelIdGet` operationId).
	GetPublicModelPublicV1ModelsModelIdGet(ctx context.Context, modelId string, params *GetPublicModelPublicV1ModelsModelIdGetParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ChatV1ChatCompletionsPostWithBody Chat
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/chat/completions (the `ChatV1ChatCompletionsPost` operationId).
	ChatV1ChatCompletionsPostWithBody(ctx context.Context, params *ChatV1ChatCompletionsPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ChatV1ChatCompletionsPost Chat
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/chat/completions (the `ChatV1ChatCompletionsPost` operationId).
	ChatV1ChatCompletionsPost(ctx context.Context, params *ChatV1ChatCompletionsPostParams, body ChatV1ChatCompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CompletionsV1CompletionsPostWithBody Completions
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /v1/completions (the `CompletionsV1CompletionsPost` operationId).
	CompletionsV1CompletionsPostWithBody(ctx context.Context, params *CompletionsV1CompletionsPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CompletionsV1CompletionsPost Completions
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /v1/completions (the `CompletionsV1CompletionsPost` operationId).
	CompletionsV1CompletionsPost(ctx context.Context, params *CompletionsV1CompletionsPostParams, body CompletionsV1CompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListModelsV1ModelsGet List Models
	//
	// Corresponds with GET /v1/models (the `ListModelsV1ModelsGet` operationId).
	ListModelsV1ModelsGet(ctx context.Context, params *ListModelsV1ModelsGetParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetModelV1ModelsModelIdGet Get Model
	//
	// Corresponds with GET /v1/models/{model_id} (the `GetModelV1ModelsModelIdGet` operationId).
	GetModelV1ModelsModelIdGet(ctx context.Context, modelId string, params *GetModelV1ModelsModelIdGetParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// TcpWarmingV1TcpWarmingGet Tcp Warming
	//
	// Corresponds with GET /v1/tcp_warming (the `TcpWarmingV1TcpWarmingGet` operationId).
	TcpWarmingV1TcpWarmingGet(ctx context.Context, 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) ChatV1ChatCompletionsPostWithBodyWithResponse

func (c *ClientWithResponses) ChatV1ChatCompletionsPostWithBodyWithResponse(ctx context.Context, params *ChatV1ChatCompletionsPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ChatV1ChatCompletionsPostResponse, error)

ChatV1ChatCompletionsPostWithBodyWithResponse Chat

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/chat/completions (the `ChatV1ChatCompletionsPost` operationId).

func (*ClientWithResponses) ChatV1ChatCompletionsPostWithResponse

ChatV1ChatCompletionsPostWithResponse Chat

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/chat/completions (the `ChatV1ChatCompletionsPost` operationId).

func (*ClientWithResponses) CompletionsV1CompletionsPostWithBodyWithResponse

func (c *ClientWithResponses) CompletionsV1CompletionsPostWithBodyWithResponse(ctx context.Context, params *CompletionsV1CompletionsPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CompletionsV1CompletionsPostResponse, error)

CompletionsV1CompletionsPostWithBodyWithResponse Completions

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/completions (the `CompletionsV1CompletionsPost` operationId).

func (*ClientWithResponses) CompletionsV1CompletionsPostWithResponse

CompletionsV1CompletionsPostWithResponse Completions

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/completions (the `CompletionsV1CompletionsPost` operationId).

func (*ClientWithResponses) GetModelV1ModelsModelIdGetWithResponse

func (c *ClientWithResponses) GetModelV1ModelsModelIdGetWithResponse(ctx context.Context, modelId string, params *GetModelV1ModelsModelIdGetParams, reqEditors ...RequestEditorFn) (*GetModelV1ModelsModelIdGetResponse, error)

GetModelV1ModelsModelIdGetWithResponse Get Model

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

Corresponds with GET /v1/models/{model_id} (the `GetModelV1ModelsModelIdGet` operationId).

func (*ClientWithResponses) GetPublicModelPublicV1ModelsModelIdGetWithResponse

func (c *ClientWithResponses) GetPublicModelPublicV1ModelsModelIdGetWithResponse(ctx context.Context, modelId string, params *GetPublicModelPublicV1ModelsModelIdGetParams, reqEditors ...RequestEditorFn) (*GetPublicModelPublicV1ModelsModelIdGetResponse, error)

GetPublicModelPublicV1ModelsModelIdGetWithResponse Retrieve a specific model

Retrieve a specific publicly available model by ID (modelVisibility='PUBLIC' only). Use the `format` parameter to get responses compatible with OpenRouter or HuggingFace APIs.

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

Corresponds with GET /public/v1/models/{model_id} (the `GetPublicModelPublicV1ModelsModelIdGet` operationId).

func (*ClientWithResponses) ListModelsV1ModelsGetWithResponse

func (c *ClientWithResponses) ListModelsV1ModelsGetWithResponse(ctx context.Context, params *ListModelsV1ModelsGetParams, reqEditors ...RequestEditorFn) (*ListModelsV1ModelsGetResponse, error)

ListModelsV1ModelsGetWithResponse List Models

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

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

func (*ClientWithResponses) ListPublicModelsEndpointPublicV1ModelsGetWithResponse

func (c *ClientWithResponses) ListPublicModelsEndpointPublicV1ModelsGetWithResponse(ctx context.Context, params *ListPublicModelsEndpointPublicV1ModelsGetParams, reqEditors ...RequestEditorFn) (*ListPublicModelsEndpointPublicV1ModelsGetResponse, error)

ListPublicModelsEndpointPublicV1ModelsGetWithResponse List all available models

List all publicly available models (modelVisibility='PUBLIC' only). Use the `format` parameter to get responses compatible with OpenRouter or HuggingFace APIs.

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

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

func (*ClientWithResponses) TcpWarmingV1TcpWarmingGetWithResponse

func (c *ClientWithResponses) TcpWarmingV1TcpWarmingGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TcpWarmingV1TcpWarmingGetResponse, error)

TcpWarmingV1TcpWarmingGetWithResponse Tcp Warming

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

Corresponds with GET /v1/tcp_warming (the `TcpWarmingV1TcpWarmingGet` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// ListPublicModelsEndpointPublicV1ModelsGetWithResponse List all available models
	//
	// List all publicly available models (modelVisibility='PUBLIC' only). Use the `format` parameter to get responses compatible with OpenRouter or HuggingFace APIs.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /public/v1/models (the `ListPublicModelsEndpointPublicV1ModelsGet` operationId).
	ListPublicModelsEndpointPublicV1ModelsGetWithResponse(ctx context.Context, params *ListPublicModelsEndpointPublicV1ModelsGetParams, reqEditors ...RequestEditorFn) (*ListPublicModelsEndpointPublicV1ModelsGetResponse, error)

	// GetPublicModelPublicV1ModelsModelIdGetWithResponse Retrieve a specific model
	//
	// Retrieve a specific publicly available model by ID (modelVisibility='PUBLIC' only). Use the `format` parameter to get responses compatible with OpenRouter or HuggingFace APIs.
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /public/v1/models/{model_id} (the `GetPublicModelPublicV1ModelsModelIdGet` operationId).
	GetPublicModelPublicV1ModelsModelIdGetWithResponse(ctx context.Context, modelId string, params *GetPublicModelPublicV1ModelsModelIdGetParams, reqEditors ...RequestEditorFn) (*GetPublicModelPublicV1ModelsModelIdGetResponse, error)

	// ChatV1ChatCompletionsPostWithBodyWithResponse Chat
	//
	// 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/chat/completions (the `ChatV1ChatCompletionsPost` operationId).
	ChatV1ChatCompletionsPostWithBodyWithResponse(ctx context.Context, params *ChatV1ChatCompletionsPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ChatV1ChatCompletionsPostResponse, error)

	// ChatV1ChatCompletionsPostWithResponse Chat
	//
	// 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/chat/completions (the `ChatV1ChatCompletionsPost` operationId).
	ChatV1ChatCompletionsPostWithResponse(ctx context.Context, params *ChatV1ChatCompletionsPostParams, body ChatV1ChatCompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*ChatV1ChatCompletionsPostResponse, error)

	// CompletionsV1CompletionsPostWithBodyWithResponse Completions
	//
	// 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/completions (the `CompletionsV1CompletionsPost` operationId).
	CompletionsV1CompletionsPostWithBodyWithResponse(ctx context.Context, params *CompletionsV1CompletionsPostParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CompletionsV1CompletionsPostResponse, error)

	// CompletionsV1CompletionsPostWithResponse Completions
	//
	// 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/completions (the `CompletionsV1CompletionsPost` operationId).
	CompletionsV1CompletionsPostWithResponse(ctx context.Context, params *CompletionsV1CompletionsPostParams, body CompletionsV1CompletionsPostJSONRequestBody, reqEditors ...RequestEditorFn) (*CompletionsV1CompletionsPostResponse, error)

	// ListModelsV1ModelsGetWithResponse List Models
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/models (the `ListModelsV1ModelsGet` operationId).
	ListModelsV1ModelsGetWithResponse(ctx context.Context, params *ListModelsV1ModelsGetParams, reqEditors ...RequestEditorFn) (*ListModelsV1ModelsGetResponse, error)

	// GetModelV1ModelsModelIdGetWithResponse Get Model
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/models/{model_id} (the `GetModelV1ModelsModelIdGet` operationId).
	GetModelV1ModelsModelIdGetWithResponse(ctx context.Context, modelId string, params *GetModelV1ModelsModelIdGetParams, reqEditors ...RequestEditorFn) (*GetModelV1ModelsModelIdGetResponse, error)

	// TcpWarmingV1TcpWarmingGetWithResponse Tcp Warming
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /v1/tcp_warming (the `TcpWarmingV1TcpWarmingGet` operationId).
	TcpWarmingV1TcpWarmingGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TcpWarmingV1TcpWarmingGetResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CompletionChoice

type CompletionChoice struct {
	FinishReason *CompletionChoiceFinishReason `json:"finish_reason,omitempty"`
	Index        int                           `json:"index"`
	Logprobs     *CompletionLogProbs           `json:"logprobs,omitempty"`
	Text         *string                       `json:"text,omitempty"`
	Tokens       *[]int                        `json:"tokens,omitempty"`
}

CompletionChoice defines model for CompletionChoice.

type CompletionChoiceFinishReason

type CompletionChoiceFinishReason string

CompletionChoiceFinishReason defines model for CompletionChoice.FinishReason.

const (
	CompletionChoiceFinishReasonContentFilter CompletionChoiceFinishReason = "content_filter"
	CompletionChoiceFinishReasonLength        CompletionChoiceFinishReason = "length"
	CompletionChoiceFinishReasonStop          CompletionChoiceFinishReason = "stop"
	CompletionChoiceFinishReasonToolCalls     CompletionChoiceFinishReason = "tool_calls"
)

Defines values for CompletionChoiceFinishReason.

func (CompletionChoiceFinishReason) Valid

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

type CompletionLogProbs

type CompletionLogProbs struct {
	TextOffset    *[]int                `json:"text_offset,omitempty"`
	TokenLogprobs *[]float64            `json:"token_logprobs,omitempty"`
	Tokens        *[]string             `json:"tokens,omitempty"`
	TopLogprobs   *[]map[string]float64 `json:"top_logprobs,omitempty"`
}

CompletionLogProbs defines model for CompletionLogProbs.

type CompletionRequest

type CompletionRequest struct {
	// BestOf Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`
	BestOf *int `json:"best_of,omitempty"`

	// Echo Echo back the prompt in addition to the completion
	Echo *bool `json:"echo,omitempty"`

	// FrequencyPenalty Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
	FrequencyPenalty *float64 `json:"frequency_penalty,omitempty"`

	// GrammarRoot The grammar root used for structured output generation.
	GrammarRoot *string `json:"grammar_root,omitempty"`

	// LogitBias Modify the likelihood of specified tokens appearing in the completion.
	//
	//  Accepts a JSON object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
	LogitBias *map[string]float64 `json:"logit_bias,omitempty"`

	// Logprobs Include the log probabilities on the logprobs most likely output tokens, as well the chosen tokens. For example, if logprobs is 5, the API will return a list of the 5 most likely tokens. The API will always return the logprob of the sampled token, so there may be up to logprobs+1 elements in the response.
	Logprobs *int `json:"logprobs,omitempty"`

	// MaxTokens The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length.
	MaxTokens *int `json:"max_tokens,omitempty"`

	// MinTokens The minimum number of tokens to generate for a completion. If not specified or set to 0, the model will generate as many tokens as it deems necessary. Setting to -1 sets to max sequence length.
	MinTokens *int   `json:"min_tokens,omitempty"`
	Model     string `json:"model"`

	// N How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs.
	N *int `json:"n,omitempty"`

	// PresencePenalty Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
	PresencePenalty *float64 `json:"presence_penalty,omitempty"`

	// Prompt The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.
	Prompt CompletionRequest_Prompt `json:"prompt"`

	// PromptCacheKey An optional opaque string. The requests with the same prompt cache key would highly likely share the same prompt prefixes. Examples would be IDs of chat conversations, IDs of users, the hashes of system prompts, etc.
	PromptCacheKey *string `json:"prompt_cache_key,omitempty"`

	// ReasoningFormat Determines how reasoning is returned in the response. If set to `parsed`, the reasoning will be returned in the `reasoning` field of the response message as a string. If set to `raw`, the reasoning will be returned in the `content` field of the response message with special tokens. If set to `hidden`, the reasoning will not be returned in the response.
	// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
	ReasoningFormat *ReasoningFormat `json:"reasoning_format,omitempty"`

	// ReturnRawTokens Return raw tokens instead of text
	ReturnRawTokens *bool `json:"return_raw_tokens,omitempty"`

	// Seed If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. Determinism is not guaranteed.
	Seed *int `json:"seed,omitempty"`

	// Stop Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
	Stop          *CompletionRequest_Stop `json:"stop,omitempty"`
	Stream        *bool                   `json:"stream,omitempty"`
	StreamOptions *StreamOptions          `json:"stream_options,omitempty"`

	// Suffix The suffix that comes after a completion of inserted text. (OpenAI feature, not supported)
	Suffix *string `json:"suffix,omitempty"`

	// Temperature What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both.
	Temperature *float64 `json:"temperature,omitempty"`

	// TopP An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.
	TopP *float64 `json:"top_p,omitempty"`

	// User A unique identifier representing your end-user, which can help Cerebras to monitor and detect abuse.
	User *string `json:"user,omitempty"`
}

CompletionRequest Request for completions endpoint

Examples: {"model":"llama3.1-70b","prompt":"Micheael Jordan is born in ","stream":true}

type CompletionRequestPrompt0

type CompletionRequestPrompt0 = string

CompletionRequestPrompt0 defines model for CompletionRequest.Prompt.0.

type CompletionRequestPrompt1

type CompletionRequestPrompt1 = []string

CompletionRequestPrompt1 defines model for CompletionRequest.Prompt.1.

type CompletionRequestPrompt2

type CompletionRequestPrompt2 = []int

CompletionRequestPrompt2 defines model for CompletionRequest.Prompt.2.

type CompletionRequestPrompt3

type CompletionRequestPrompt3 = [][]int

CompletionRequestPrompt3 defines model for CompletionRequest.Prompt.3.

type CompletionRequestStop0

type CompletionRequestStop0 = string

CompletionRequestStop0 defines model for CompletionRequest.Stop.0.

type CompletionRequestStop1

type CompletionRequestStop1 = []string

CompletionRequestStop1 defines model for CompletionRequest.Stop.1.

type CompletionRequest_Prompt

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

CompletionRequest_Prompt The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.

func (CompletionRequest_Prompt) AsCompletionRequestPrompt0

func (t CompletionRequest_Prompt) AsCompletionRequestPrompt0() (CompletionRequestPrompt0, error)

AsCompletionRequestPrompt0 returns the union data inside the CompletionRequest_Prompt as a CompletionRequestPrompt0

func (CompletionRequest_Prompt) AsCompletionRequestPrompt1

func (t CompletionRequest_Prompt) AsCompletionRequestPrompt1() (CompletionRequestPrompt1, error)

AsCompletionRequestPrompt1 returns the union data inside the CompletionRequest_Prompt as a CompletionRequestPrompt1

func (CompletionRequest_Prompt) AsCompletionRequestPrompt2

func (t CompletionRequest_Prompt) AsCompletionRequestPrompt2() (CompletionRequestPrompt2, error)

AsCompletionRequestPrompt2 returns the union data inside the CompletionRequest_Prompt as a CompletionRequestPrompt2

func (CompletionRequest_Prompt) AsCompletionRequestPrompt3

func (t CompletionRequest_Prompt) AsCompletionRequestPrompt3() (CompletionRequestPrompt3, error)

AsCompletionRequestPrompt3 returns the union data inside the CompletionRequest_Prompt as a CompletionRequestPrompt3

func (*CompletionRequest_Prompt) FromCompletionRequestPrompt0

func (t *CompletionRequest_Prompt) FromCompletionRequestPrompt0(v CompletionRequestPrompt0) error

FromCompletionRequestPrompt0 overwrites any union data inside the CompletionRequest_Prompt as the provided CompletionRequestPrompt0

func (*CompletionRequest_Prompt) FromCompletionRequestPrompt1

func (t *CompletionRequest_Prompt) FromCompletionRequestPrompt1(v CompletionRequestPrompt1) error

FromCompletionRequestPrompt1 overwrites any union data inside the CompletionRequest_Prompt as the provided CompletionRequestPrompt1

func (*CompletionRequest_Prompt) FromCompletionRequestPrompt2

func (t *CompletionRequest_Prompt) FromCompletionRequestPrompt2(v CompletionRequestPrompt2) error

FromCompletionRequestPrompt2 overwrites any union data inside the CompletionRequest_Prompt as the provided CompletionRequestPrompt2

func (*CompletionRequest_Prompt) FromCompletionRequestPrompt3

func (t *CompletionRequest_Prompt) FromCompletionRequestPrompt3(v CompletionRequestPrompt3) error

FromCompletionRequestPrompt3 overwrites any union data inside the CompletionRequest_Prompt as the provided CompletionRequestPrompt3

func (CompletionRequest_Prompt) MarshalJSON

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

func (*CompletionRequest_Prompt) MergeCompletionRequestPrompt0

func (t *CompletionRequest_Prompt) MergeCompletionRequestPrompt0(v CompletionRequestPrompt0) error

MergeCompletionRequestPrompt0 performs a merge with any union data inside the CompletionRequest_Prompt, using the provided CompletionRequestPrompt0

func (*CompletionRequest_Prompt) MergeCompletionRequestPrompt1

func (t *CompletionRequest_Prompt) MergeCompletionRequestPrompt1(v CompletionRequestPrompt1) error

MergeCompletionRequestPrompt1 performs a merge with any union data inside the CompletionRequest_Prompt, using the provided CompletionRequestPrompt1

func (*CompletionRequest_Prompt) MergeCompletionRequestPrompt2

func (t *CompletionRequest_Prompt) MergeCompletionRequestPrompt2(v CompletionRequestPrompt2) error

MergeCompletionRequestPrompt2 performs a merge with any union data inside the CompletionRequest_Prompt, using the provided CompletionRequestPrompt2

func (*CompletionRequest_Prompt) MergeCompletionRequestPrompt3

func (t *CompletionRequest_Prompt) MergeCompletionRequestPrompt3(v CompletionRequestPrompt3) error

MergeCompletionRequestPrompt3 performs a merge with any union data inside the CompletionRequest_Prompt, using the provided CompletionRequestPrompt3

func (*CompletionRequest_Prompt) UnmarshalJSON

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

type CompletionRequest_Stop

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

CompletionRequest_Stop Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.

func (CompletionRequest_Stop) AsCompletionRequestStop0

func (t CompletionRequest_Stop) AsCompletionRequestStop0() (CompletionRequestStop0, error)

AsCompletionRequestStop0 returns the union data inside the CompletionRequest_Stop as a CompletionRequestStop0

func (CompletionRequest_Stop) AsCompletionRequestStop1

func (t CompletionRequest_Stop) AsCompletionRequestStop1() (CompletionRequestStop1, error)

AsCompletionRequestStop1 returns the union data inside the CompletionRequest_Stop as a CompletionRequestStop1

func (*CompletionRequest_Stop) FromCompletionRequestStop0

func (t *CompletionRequest_Stop) FromCompletionRequestStop0(v CompletionRequestStop0) error

FromCompletionRequestStop0 overwrites any union data inside the CompletionRequest_Stop as the provided CompletionRequestStop0

func (*CompletionRequest_Stop) FromCompletionRequestStop1

func (t *CompletionRequest_Stop) FromCompletionRequestStop1(v CompletionRequestStop1) error

FromCompletionRequestStop1 overwrites any union data inside the CompletionRequest_Stop as the provided CompletionRequestStop1

func (CompletionRequest_Stop) MarshalJSON

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

func (*CompletionRequest_Stop) MergeCompletionRequestStop0

func (t *CompletionRequest_Stop) MergeCompletionRequestStop0(v CompletionRequestStop0) error

MergeCompletionRequestStop0 performs a merge with any union data inside the CompletionRequest_Stop, using the provided CompletionRequestStop0

func (*CompletionRequest_Stop) MergeCompletionRequestStop1

func (t *CompletionRequest_Stop) MergeCompletionRequestStop1(v CompletionRequestStop1) error

MergeCompletionRequestStop1 performs a merge with any union data inside the CompletionRequest_Stop, using the provided CompletionRequestStop1

func (*CompletionRequest_Stop) UnmarshalJSON

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

type CompletionResponse

type CompletionResponse struct {
	Choices           []CompletionChoice       `json:"choices"`
	Created           int                      `json:"created"`
	Id                string                   `json:"id"`
	Model             string                   `json:"model"`
	Object            CompletionResponseObject `json:"object"`
	SystemFingerprint string                   `json:"system_fingerprint"`
	TimeInfo          *TimeInfo                `json:"time_info,omitempty"`
	Usage             *Usage                   `json:"usage,omitempty"`
}

CompletionResponse Examples: {"choices":[{"finish_reason":"stop","index":0,"text":"Generative AI is a subfield of artificial intelligence that focuses on generating new, original content, such as images, music, text, or videos. These models are trained on large datasets and learn to recognize patterns, relationships, and structures within the data, allowing them to generate new content that is similar in style, tone, or characteristics to the training data. \n \n Generative AI models can be categorized into two main types: Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs). GANs consist of two neural networks: a generator and a discriminator. The generator creates new content, while the discriminator evaluates the generated content and tells the generator whether it's realistic or not. VAEs are neural networks that learn to compress and reconstruct data. \n \n Generative AI has numerous applications across various industries, including art and design, content generation, data augmentation, and recommendation systems. Some examples of Generative AI in action include Deep Dream Generator, Amper Music, and DALL-E. \n \n In summary, Generative AI is a powerful technology that enables the creation of new, original content using machine learning models. It has the potential to revolutionize various industries and create new opportunities for artists, designers, and content creators."}],"created":1721088719,"id":"response_1721","model":"llama3.1-8b","object":"text_completion","system_fingerprint":"88719","time_info":{"completion_time":0.44,"prompt_time":0.02,"queue_time":0,"total_time":0.46},"usage":{"completion_tokens":1020,"prompt_tokens":40,"total_tokens":1060}}

type CompletionResponseObject

type CompletionResponseObject string

CompletionResponseObject defines model for CompletionResponse.Object.

const (
	CompletionResponseObjectTextCompletion CompletionResponseObject = "text_completion"
)

Defines values for CompletionResponseObject.

func (CompletionResponseObject) Valid

func (e CompletionResponseObject) Valid() bool

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

type CompletionTokensDetails

type CompletionTokensDetails struct {
	AcceptedPredictionTokens *int `json:"accepted_prediction_tokens,omitempty"`
	ReasoningTokens          *int `json:"reasoning_tokens,omitempty"`
	RejectedPredictionTokens *int `json:"rejected_prediction_tokens,omitempty"`
}

CompletionTokensDetails Examples: {"accepted_prediction_tokens":900,"rejected_prediction_tokens":100}

type CompletionsV1CompletionsPostJSONRequestBody

type CompletionsV1CompletionsPostJSONRequestBody = CompletionRequest

CompletionsV1CompletionsPostJSONRequestBody defines body for CompletionsV1CompletionsPost for application/json ContentType.

type CompletionsV1CompletionsPostParams

type CompletionsV1CompletionsPostParams struct {
	XAmzCfId   *string  `json:"X-Amz-Cf-Id,omitempty"`
	CFRAY      *string  `json:"CF-RAY,omitempty"`
	XDelayTime *float64 `json:"X-delay-time,omitempty"`
}

CompletionsV1CompletionsPostParams defines parameters for CompletionsV1CompletionsPost.

type CompletionsV1CompletionsPostResponse

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

func ParseCompletionsV1CompletionsPostResponse

func ParseCompletionsV1CompletionsPostResponse(rsp *http.Response) (*CompletionsV1CompletionsPostResponse, error)

ParseCompletionsV1CompletionsPostResponse parses an HTTP response from a CompletionsV1CompletionsPostWithResponse call

func (CompletionsV1CompletionsPostResponse) ContentType

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

func (CompletionsV1CompletionsPostResponse) GetBody

GetBody returns the raw response body bytes

func (CompletionsV1CompletionsPostResponse) GetJSON200

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

func (CompletionsV1CompletionsPostResponse) GetJSON422

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

func (CompletionsV1CompletionsPostResponse) Status

Status returns HTTPResponse.Status

func (CompletionsV1CompletionsPostResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type CreateChatCompletionResponse

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

CreateChatCompletionResponse defines model for CreateChatCompletionResponse.

func (CreateChatCompletionResponse) AsChatChunkResponse

func (t CreateChatCompletionResponse) AsChatChunkResponse() (ChatChunkResponse, error)

AsChatChunkResponse returns the union data inside the CreateChatCompletionResponse as a ChatChunkResponse

func (CreateChatCompletionResponse) AsChatCompletionResponse

func (t CreateChatCompletionResponse) AsChatCompletionResponse() (ChatCompletionResponse, error)

AsChatCompletionResponse returns the union data inside the CreateChatCompletionResponse as a ChatCompletionResponse

func (CreateChatCompletionResponse) AsErrorChunkResponse

func (t CreateChatCompletionResponse) AsErrorChunkResponse() (ErrorChunkResponse, error)

AsErrorChunkResponse returns the union data inside the CreateChatCompletionResponse as a ErrorChunkResponse

func (*CreateChatCompletionResponse) FromChatChunkResponse

func (t *CreateChatCompletionResponse) FromChatChunkResponse(v ChatChunkResponse) error

FromChatChunkResponse overwrites any union data inside the CreateChatCompletionResponse as the provided ChatChunkResponse

func (*CreateChatCompletionResponse) FromChatCompletionResponse

func (t *CreateChatCompletionResponse) FromChatCompletionResponse(v ChatCompletionResponse) error

FromChatCompletionResponse overwrites any union data inside the CreateChatCompletionResponse as the provided ChatCompletionResponse

func (*CreateChatCompletionResponse) FromErrorChunkResponse

func (t *CreateChatCompletionResponse) FromErrorChunkResponse(v ErrorChunkResponse) error

FromErrorChunkResponse overwrites any union data inside the CreateChatCompletionResponse as the provided ErrorChunkResponse

func (CreateChatCompletionResponse) MarshalJSON

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

func (*CreateChatCompletionResponse) MergeChatChunkResponse

func (t *CreateChatCompletionResponse) MergeChatChunkResponse(v ChatChunkResponse) error

MergeChatChunkResponse performs a merge with any union data inside the CreateChatCompletionResponse, using the provided ChatChunkResponse

func (*CreateChatCompletionResponse) MergeChatCompletionResponse

func (t *CreateChatCompletionResponse) MergeChatCompletionResponse(v ChatCompletionResponse) error

MergeChatCompletionResponse performs a merge with any union data inside the CreateChatCompletionResponse, using the provided ChatCompletionResponse

func (*CreateChatCompletionResponse) MergeErrorChunkResponse

func (t *CreateChatCompletionResponse) MergeErrorChunkResponse(v ErrorChunkResponse) error

MergeErrorChunkResponse performs a merge with any union data inside the CreateChatCompletionResponse, using the provided ErrorChunkResponse

func (*CreateChatCompletionResponse) UnmarshalJSON

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

type CreateCompletionResponse

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

CreateCompletionResponse defines model for CreateCompletionResponse.

func (CreateCompletionResponse) AsCompletionResponse

func (t CreateCompletionResponse) AsCompletionResponse() (CompletionResponse, error)

AsCompletionResponse returns the union data inside the CreateCompletionResponse as a CompletionResponse

func (CreateCompletionResponse) AsErrorChunkResponse

func (t CreateCompletionResponse) AsErrorChunkResponse() (ErrorChunkResponse, error)

AsErrorChunkResponse returns the union data inside the CreateCompletionResponse as a ErrorChunkResponse

func (*CreateCompletionResponse) FromCompletionResponse

func (t *CreateCompletionResponse) FromCompletionResponse(v CompletionResponse) error

FromCompletionResponse overwrites any union data inside the CreateCompletionResponse as the provided CompletionResponse

func (*CreateCompletionResponse) FromErrorChunkResponse

func (t *CreateCompletionResponse) FromErrorChunkResponse(v ErrorChunkResponse) error

FromErrorChunkResponse overwrites any union data inside the CreateCompletionResponse as the provided ErrorChunkResponse

func (CreateCompletionResponse) MarshalJSON

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

func (*CreateCompletionResponse) MergeCompletionResponse

func (t *CreateCompletionResponse) MergeCompletionResponse(v CompletionResponse) error

MergeCompletionResponse performs a merge with any union data inside the CreateCompletionResponse, using the provided CompletionResponse

func (*CreateCompletionResponse) MergeErrorChunkResponse

func (t *CreateCompletionResponse) MergeErrorChunkResponse(v ErrorChunkResponse) error

MergeErrorChunkResponse performs a merge with any union data inside the CreateCompletionResponse, using the provided ErrorChunkResponse

func (*CreateCompletionResponse) UnmarshalJSON

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

type DatacenterLocation

type DatacenterLocation struct {
	// CountryCode ISO 3166 Alpha-2 country code
	CountryCode string `json:"country_code"`
}

DatacenterLocation Datacenter location information.

type DeveloperMessageRequest

type DeveloperMessageRequest struct {
	Content DeveloperMessageRequest_Content `json:"content"`
	Name    *string                         `json:"name,omitempty"`
	Role    *DeveloperMessageRequestRole    `json:"role,omitempty"`
}

DeveloperMessageRequest A message request from the developer: Currently only for openai models, where they are functionally the same as system

type DeveloperMessageRequestContent0

type DeveloperMessageRequestContent0 = string

DeveloperMessageRequestContent0 defines model for DeveloperMessageRequest.Content.0.

type DeveloperMessageRequestContent1

type DeveloperMessageRequestContent1 = []DeveloperMessageRequest_Content_1_Item

DeveloperMessageRequestContent1 defines model for DeveloperMessageRequest.Content.1.

type DeveloperMessageRequestRole

type DeveloperMessageRequestRole string

DeveloperMessageRequestRole defines model for DeveloperMessageRequest.Role.

const (
	DeveloperMessageRequestRoleDeveloper DeveloperMessageRequestRole = "developer"
)

Defines values for DeveloperMessageRequestRole.

func (DeveloperMessageRequestRole) Valid

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

type DeveloperMessageRequest_Content

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

DeveloperMessageRequest_Content defines model for DeveloperMessageRequest.Content.

func (DeveloperMessageRequest_Content) AsDeveloperMessageRequestContent0

func (t DeveloperMessageRequest_Content) AsDeveloperMessageRequestContent0() (DeveloperMessageRequestContent0, error)

AsDeveloperMessageRequestContent0 returns the union data inside the DeveloperMessageRequest_Content as a DeveloperMessageRequestContent0

func (DeveloperMessageRequest_Content) AsDeveloperMessageRequestContent1

func (t DeveloperMessageRequest_Content) AsDeveloperMessageRequestContent1() (DeveloperMessageRequestContent1, error)

AsDeveloperMessageRequestContent1 returns the union data inside the DeveloperMessageRequest_Content as a DeveloperMessageRequestContent1

func (*DeveloperMessageRequest_Content) FromDeveloperMessageRequestContent0

func (t *DeveloperMessageRequest_Content) FromDeveloperMessageRequestContent0(v DeveloperMessageRequestContent0) error

FromDeveloperMessageRequestContent0 overwrites any union data inside the DeveloperMessageRequest_Content as the provided DeveloperMessageRequestContent0

func (*DeveloperMessageRequest_Content) FromDeveloperMessageRequestContent1

func (t *DeveloperMessageRequest_Content) FromDeveloperMessageRequestContent1(v DeveloperMessageRequestContent1) error

FromDeveloperMessageRequestContent1 overwrites any union data inside the DeveloperMessageRequest_Content as the provided DeveloperMessageRequestContent1

func (DeveloperMessageRequest_Content) MarshalJSON

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

func (*DeveloperMessageRequest_Content) MergeDeveloperMessageRequestContent0

func (t *DeveloperMessageRequest_Content) MergeDeveloperMessageRequestContent0(v DeveloperMessageRequestContent0) error

MergeDeveloperMessageRequestContent0 performs a merge with any union data inside the DeveloperMessageRequest_Content, using the provided DeveloperMessageRequestContent0

func (*DeveloperMessageRequest_Content) MergeDeveloperMessageRequestContent1

func (t *DeveloperMessageRequest_Content) MergeDeveloperMessageRequestContent1(v DeveloperMessageRequestContent1) error

MergeDeveloperMessageRequestContent1 performs a merge with any union data inside the DeveloperMessageRequest_Content, using the provided DeveloperMessageRequestContent1

func (*DeveloperMessageRequest_Content) UnmarshalJSON

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

type DeveloperMessageRequest_Content_1_Item

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

DeveloperMessageRequest_Content_1_Item defines model for DeveloperMessageRequest.Content.1.Item.

func (DeveloperMessageRequest_Content_1_Item) AsImageContent

AsImageContent returns the union data inside the DeveloperMessageRequest_Content_1_Item as a ImageContent

func (DeveloperMessageRequest_Content_1_Item) AsImageUrlContent

AsImageUrlContent returns the union data inside the DeveloperMessageRequest_Content_1_Item as a ImageUrlContent

func (DeveloperMessageRequest_Content_1_Item) AsTextContent

AsTextContent returns the union data inside the DeveloperMessageRequest_Content_1_Item as a TextContent

func (DeveloperMessageRequest_Content_1_Item) Discriminator

func (*DeveloperMessageRequest_Content_1_Item) FromImageContent

FromImageContent overwrites any union data inside the DeveloperMessageRequest_Content_1_Item as the provided ImageContent

func (*DeveloperMessageRequest_Content_1_Item) FromImageUrlContent

FromImageUrlContent overwrites any union data inside the DeveloperMessageRequest_Content_1_Item as the provided ImageUrlContent

func (*DeveloperMessageRequest_Content_1_Item) FromTextContent

FromTextContent overwrites any union data inside the DeveloperMessageRequest_Content_1_Item as the provided TextContent

func (DeveloperMessageRequest_Content_1_Item) MarshalJSON

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

func (*DeveloperMessageRequest_Content_1_Item) MergeImageContent

MergeImageContent performs a merge with any union data inside the DeveloperMessageRequest_Content_1_Item, using the provided ImageContent

func (*DeveloperMessageRequest_Content_1_Item) MergeImageUrlContent

MergeImageUrlContent performs a merge with any union data inside the DeveloperMessageRequest_Content_1_Item, using the provided ImageUrlContent

func (*DeveloperMessageRequest_Content_1_Item) MergeTextContent

MergeTextContent performs a merge with any union data inside the DeveloperMessageRequest_Content_1_Item, using the provided TextContent

func (*DeveloperMessageRequest_Content_1_Item) UnmarshalJSON

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

func (DeveloperMessageRequest_Content_1_Item) ValueByDiscriminator

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

type ErrorChunkContent

type ErrorChunkContent struct {
	Code    *string `json:"code,omitempty"`
	Id      *string `json:"id,omitempty"`
	Message *string `json:"message,omitempty"`
	Param   *string `json:"param,omitempty"`
	Type    *string `json:"type,omitempty"`
}

ErrorChunkContent defines model for ErrorChunkContent.

type ErrorChunkResponse

type ErrorChunkResponse struct {
	Error      ErrorChunkContent `json:"error"`
	StatusCode int               `json:"status_code"`
}

ErrorChunkResponse defines model for ErrorChunkResponse.

type FunctionObject

type FunctionObject struct {
	Description *string     `json:"description,omitempty"`
	Name        string      `json:"name"`
	Parameters  *Parameters `json:"parameters,omitempty"`
	Strict      *bool       `json:"strict,omitempty"`
}

FunctionObject A function object.

type GetModelV1ModelsModelIdGet200JSONResponseBody

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

GetModelV1ModelsModelIdGet200JSONResponseBody defines parameters for GetModelV1ModelsModelIdGet.

func (GetModelV1ModelsModelIdGet200JSONResponseBody) AsHuggingFaceModel

AsHuggingFaceModel returns the union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as a HuggingFaceModel

func (GetModelV1ModelsModelIdGet200JSONResponseBody) AsModelMetadata

AsModelMetadata returns the union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as a ModelMetadata

func (GetModelV1ModelsModelIdGet200JSONResponseBody) AsOpenRouterModel

AsOpenRouterModel returns the union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as a OpenRouterModel

func (GetModelV1ModelsModelIdGet200JSONResponseBody) AsPublicModel

AsPublicModel returns the union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as a PublicModel

func (*GetModelV1ModelsModelIdGet200JSONResponseBody) FromHuggingFaceModel

FromHuggingFaceModel overwrites any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as the provided HuggingFaceModel

func (*GetModelV1ModelsModelIdGet200JSONResponseBody) FromModelMetadata

FromModelMetadata overwrites any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as the provided ModelMetadata

func (*GetModelV1ModelsModelIdGet200JSONResponseBody) FromOpenRouterModel

FromOpenRouterModel overwrites any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as the provided OpenRouterModel

func (*GetModelV1ModelsModelIdGet200JSONResponseBody) FromPublicModel

FromPublicModel overwrites any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as the provided PublicModel

func (GetModelV1ModelsModelIdGet200JSONResponseBody) MarshalJSON

func (*GetModelV1ModelsModelIdGet200JSONResponseBody) MergeHuggingFaceModel

MergeHuggingFaceModel performs a merge with any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody, using the provided HuggingFaceModel

func (*GetModelV1ModelsModelIdGet200JSONResponseBody) MergeModelMetadata

MergeModelMetadata performs a merge with any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody, using the provided ModelMetadata

func (*GetModelV1ModelsModelIdGet200JSONResponseBody) MergeOpenRouterModel

MergeOpenRouterModel performs a merge with any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody, using the provided OpenRouterModel

func (*GetModelV1ModelsModelIdGet200JSONResponseBody) MergePublicModel

MergePublicModel performs a merge with any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody, using the provided PublicModel

func (*GetModelV1ModelsModelIdGet200JSONResponseBody) UnmarshalJSON

type GetModelV1ModelsModelIdGetParams

type GetModelV1ModelsModelIdGetParams struct {
	// Format Output format: 'default' (OpenAI-compatible), 'openrouter', or 'huggingface'
	Format   *ModelFormat `form:"format,omitempty" json:"format,omitempty"`
	XAmzCfId *string      `json:"X-Amz-Cf-Id,omitempty"`
	CFRAY    *string      `json:"CF-RAY,omitempty"`
}

GetModelV1ModelsModelIdGetParams defines parameters for GetModelV1ModelsModelIdGet.

type GetModelV1ModelsModelIdGetResponse

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

func ParseGetModelV1ModelsModelIdGetResponse

func ParseGetModelV1ModelsModelIdGetResponse(rsp *http.Response) (*GetModelV1ModelsModelIdGetResponse, error)

ParseGetModelV1ModelsModelIdGetResponse parses an HTTP response from a GetModelV1ModelsModelIdGetWithResponse call

func (GetModelV1ModelsModelIdGetResponse) ContentType

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

func (GetModelV1ModelsModelIdGetResponse) GetBody

GetBody returns the raw response body bytes

func (GetModelV1ModelsModelIdGetResponse) GetJSON200

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

func (GetModelV1ModelsModelIdGetResponse) GetJSON422

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

func (GetModelV1ModelsModelIdGetResponse) Status

Status returns HTTPResponse.Status

func (GetModelV1ModelsModelIdGetResponse) StatusCode

func (r GetModelV1ModelsModelIdGetResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody

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

GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody defines parameters for GetPublicModelPublicV1ModelsModelIdGet.

func (GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsHuggingFaceModel

AsHuggingFaceModel returns the union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as a HuggingFaceModel

func (GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsOpenRouterModel

AsOpenRouterModel returns the union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as a OpenRouterModel

func (GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsPublicModel

AsPublicModel returns the union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as a PublicModel

func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromHuggingFaceModel

FromHuggingFaceModel overwrites any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as the provided HuggingFaceModel

func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromOpenRouterModel

FromOpenRouterModel overwrites any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as the provided OpenRouterModel

func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromPublicModel

FromPublicModel overwrites any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as the provided PublicModel

func (GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MarshalJSON

func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergeHuggingFaceModel

MergeHuggingFaceModel performs a merge with any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody, using the provided HuggingFaceModel

func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergeOpenRouterModel

MergeOpenRouterModel performs a merge with any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody, using the provided OpenRouterModel

func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergePublicModel

MergePublicModel performs a merge with any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody, using the provided PublicModel

func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) UnmarshalJSON

type GetPublicModelPublicV1ModelsModelIdGetParams

type GetPublicModelPublicV1ModelsModelIdGetParams struct {
	// Format Output format: 'default' (Cerebras schema), 'openrouter', or 'huggingface'
	Format   *ModelFormat `form:"format,omitempty" json:"format,omitempty"`
	XAmzCfId *string      `json:"X-Amz-Cf-Id,omitempty"`
	CFRAY    *string      `json:"CF-RAY,omitempty"`
}

GetPublicModelPublicV1ModelsModelIdGetParams defines parameters for GetPublicModelPublicV1ModelsModelIdGet.

type GetPublicModelPublicV1ModelsModelIdGetResponse

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

func ParseGetPublicModelPublicV1ModelsModelIdGetResponse

func ParseGetPublicModelPublicV1ModelsModelIdGetResponse(rsp *http.Response) (*GetPublicModelPublicV1ModelsModelIdGetResponse, error)

ParseGetPublicModelPublicV1ModelsModelIdGetResponse parses an HTTP response from a GetPublicModelPublicV1ModelsModelIdGetWithResponse call

func (GetPublicModelPublicV1ModelsModelIdGetResponse) ContentType

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

func (GetPublicModelPublicV1ModelsModelIdGetResponse) GetBody

GetBody returns the raw response body bytes

func (GetPublicModelPublicV1ModelsModelIdGetResponse) GetJSON200

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

func (GetPublicModelPublicV1ModelsModelIdGetResponse) GetJSON422

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

func (GetPublicModelPublicV1ModelsModelIdGetResponse) Status

Status returns HTTPResponse.Status

func (GetPublicModelPublicV1ModelsModelIdGetResponse) StatusCode

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 HuggingFaceCapabilities

type HuggingFaceCapabilities struct {
	FunctionCalling   *bool `json:"function_calling,omitempty"`
	Streaming         *bool `json:"streaming,omitempty"`
	StructuredOutputs *bool `json:"structured_outputs,omitempty"`
	Vision            *bool `json:"vision,omitempty"`
}

HuggingFaceCapabilities HuggingFace capabilities format.

type HuggingFaceModel

type HuggingFaceModel struct {
	// Capabilities HuggingFace capabilities format.
	Capabilities *HuggingFaceCapabilities `json:"capabilities,omitempty"`

	// ContextLength Supported context length in tokens
	ContextLength int `json:"context_length"`
	Created       int `json:"created"`

	// HuggingFaceId The corresponding HuggingFace Hub model ID
	HuggingFaceId *string                 `json:"hugging_face_id,omitempty"`
	Id            string                  `json:"id"`
	Object        *HuggingFaceModelObject `json:"object,omitempty"`
	OwnedBy       string                  `json:"owned_by"`

	// Pricing HuggingFace pricing format - price in USD per million tokens.
	Pricing HuggingFacePricing `json:"pricing"`
}

HuggingFaceModel Model in HuggingFace-compatible format for inference providers.

This format is used by HuggingFace to power their provider comparison table and provider selection features.

type HuggingFaceModelObject

type HuggingFaceModelObject string

HuggingFaceModelObject defines model for HuggingFaceModel.Object.

const (
	HuggingFaceModelObjectModel HuggingFaceModelObject = "model"
)

Defines values for HuggingFaceModelObject.

func (HuggingFaceModelObject) Valid

func (e HuggingFaceModelObject) Valid() bool

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

type HuggingFaceModelsResponse

type HuggingFaceModelsResponse struct {
	Data   []HuggingFaceModel               `json:"data"`
	Object *HuggingFaceModelsResponseObject `json:"object,omitempty"`
}

HuggingFaceModelsResponse HuggingFace-compatible list of models.

type HuggingFaceModelsResponseObject

type HuggingFaceModelsResponseObject string

HuggingFaceModelsResponseObject defines model for HuggingFaceModelsResponse.Object.

const (
	HuggingFaceModelsResponseObjectList HuggingFaceModelsResponseObject = "list"
)

Defines values for HuggingFaceModelsResponseObject.

func (HuggingFaceModelsResponseObject) Valid

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

type HuggingFacePricing

type HuggingFacePricing struct {
	// Input Price in USD per million input tokens
	Input float64 `json:"input"`

	// Output Price in USD per million output tokens
	Output float64 `json:"output"`
}

HuggingFacePricing HuggingFace pricing format - price in USD per million tokens.

type ImageContent

type ImageContent struct {
	Image string           `json:"image"`
	Type  ImageContentType `json:"type"`
}

ImageContent Image URL content for a message.

type ImageContentType

type ImageContentType string

ImageContentType defines model for ImageContent.Type.

const (
	ImageContentTypeImage ImageContentType = "image"
)

Defines values for ImageContentType.

func (ImageContentType) Valid

func (e ImageContentType) Valid() bool

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

type ImageUrl

type ImageUrl struct {
	Detail *string `json:"detail,omitempty"`
	Url    string  `json:"url"`
}

ImageUrl Image URL

type ImageUrlContent

type ImageUrlContent struct {
	// ImageUrl Image URL
	ImageUrl ImageUrl            `json:"image_url"`
	Type     ImageUrlContentType `json:"type"`
}

ImageUrlContent Image URL content for a message.

type ImageUrlContentType

type ImageUrlContentType string

ImageUrlContentType defines model for ImageUrlContent.Type.

const (
	ImageUrlContentTypeImageUrl ImageUrlContentType = "image_url"
)

Defines values for ImageUrlContentType.

func (ImageUrlContentType) Valid

func (e ImageUrlContentType) Valid() bool

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

type JSONSchema

type JSONSchema struct {
	Description *string                 `json:"description,omitempty"`
	Name        string                  `json:"name"`
	Schema      *map[string]interface{} `json:"schema,omitempty"`
	Strict      *bool                   `json:"strict,omitempty"`
}

JSONSchema A JSON Schema object.

type ListModelsV1ModelsGet200JSONResponseBody

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

ListModelsV1ModelsGet200JSONResponseBody defines parameters for ListModelsV1ModelsGet.

func (ListModelsV1ModelsGet200JSONResponseBody) AsHuggingFaceModelsResponse

AsHuggingFaceModelsResponse returns the union data inside the ListModelsV1ModelsGet200JSONResponseBody as a HuggingFaceModelsResponse

func (ListModelsV1ModelsGet200JSONResponseBody) AsModelMetadataList

AsModelMetadataList returns the union data inside the ListModelsV1ModelsGet200JSONResponseBody as a ModelMetadataList

func (ListModelsV1ModelsGet200JSONResponseBody) AsOpenRouterModelsResponse

AsOpenRouterModelsResponse returns the union data inside the ListModelsV1ModelsGet200JSONResponseBody as a OpenRouterModelsResponse

func (*ListModelsV1ModelsGet200JSONResponseBody) FromHuggingFaceModelsResponse

func (t *ListModelsV1ModelsGet200JSONResponseBody) FromHuggingFaceModelsResponse(v HuggingFaceModelsResponse) error

FromHuggingFaceModelsResponse overwrites any union data inside the ListModelsV1ModelsGet200JSONResponseBody as the provided HuggingFaceModelsResponse

func (*ListModelsV1ModelsGet200JSONResponseBody) FromModelMetadataList

FromModelMetadataList overwrites any union data inside the ListModelsV1ModelsGet200JSONResponseBody as the provided ModelMetadataList

func (*ListModelsV1ModelsGet200JSONResponseBody) FromOpenRouterModelsResponse

func (t *ListModelsV1ModelsGet200JSONResponseBody) FromOpenRouterModelsResponse(v OpenRouterModelsResponse) error

FromOpenRouterModelsResponse overwrites any union data inside the ListModelsV1ModelsGet200JSONResponseBody as the provided OpenRouterModelsResponse

func (ListModelsV1ModelsGet200JSONResponseBody) MarshalJSON

func (*ListModelsV1ModelsGet200JSONResponseBody) MergeHuggingFaceModelsResponse

func (t *ListModelsV1ModelsGet200JSONResponseBody) MergeHuggingFaceModelsResponse(v HuggingFaceModelsResponse) error

MergeHuggingFaceModelsResponse performs a merge with any union data inside the ListModelsV1ModelsGet200JSONResponseBody, using the provided HuggingFaceModelsResponse

func (*ListModelsV1ModelsGet200JSONResponseBody) MergeModelMetadataList

MergeModelMetadataList performs a merge with any union data inside the ListModelsV1ModelsGet200JSONResponseBody, using the provided ModelMetadataList

func (*ListModelsV1ModelsGet200JSONResponseBody) MergeOpenRouterModelsResponse

func (t *ListModelsV1ModelsGet200JSONResponseBody) MergeOpenRouterModelsResponse(v OpenRouterModelsResponse) error

MergeOpenRouterModelsResponse performs a merge with any union data inside the ListModelsV1ModelsGet200JSONResponseBody, using the provided OpenRouterModelsResponse

func (*ListModelsV1ModelsGet200JSONResponseBody) UnmarshalJSON

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

type ListModelsV1ModelsGetParams

type ListModelsV1ModelsGetParams struct {
	// Format Output format: 'default' (OpenAI-compatible), 'openrouter', or 'huggingface'
	Format   *ModelFormat `form:"format,omitempty" json:"format,omitempty"`
	XAmzCfId *string      `json:"X-Amz-Cf-Id,omitempty"`
	CFRAY    *string      `json:"CF-RAY,omitempty"`
}

ListModelsV1ModelsGetParams defines parameters for ListModelsV1ModelsGet.

type ListModelsV1ModelsGetResponse

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

func ParseListModelsV1ModelsGetResponse

func ParseListModelsV1ModelsGetResponse(rsp *http.Response) (*ListModelsV1ModelsGetResponse, error)

ParseListModelsV1ModelsGetResponse parses an HTTP response from a ListModelsV1ModelsGetWithResponse call

func (ListModelsV1ModelsGetResponse) ContentType

func (r ListModelsV1ModelsGetResponse) ContentType() string

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

func (ListModelsV1ModelsGetResponse) GetBody

func (r ListModelsV1ModelsGetResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListModelsV1ModelsGetResponse) GetJSON200

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

func (ListModelsV1ModelsGetResponse) GetJSON422

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

func (ListModelsV1ModelsGetResponse) Status

Status returns HTTPResponse.Status

func (ListModelsV1ModelsGetResponse) StatusCode

func (r ListModelsV1ModelsGetResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody

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

ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody defines parameters for ListPublicModelsEndpointPublicV1ModelsGet.

func (ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsHuggingFaceModelsResponse

AsHuggingFaceModelsResponse returns the union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as a HuggingFaceModelsResponse

func (ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsOpenRouterModelsResponse

AsOpenRouterModelsResponse returns the union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as a OpenRouterModelsResponse

func (ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsPublicModelsListResponse

AsPublicModelsListResponse returns the union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as a PublicModelsListResponse

func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromHuggingFaceModelsResponse

FromHuggingFaceModelsResponse overwrites any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as the provided HuggingFaceModelsResponse

func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromOpenRouterModelsResponse

FromOpenRouterModelsResponse overwrites any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as the provided OpenRouterModelsResponse

func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromPublicModelsListResponse

FromPublicModelsListResponse overwrites any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as the provided PublicModelsListResponse

func (ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MarshalJSON

func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergeHuggingFaceModelsResponse

MergeHuggingFaceModelsResponse performs a merge with any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody, using the provided HuggingFaceModelsResponse

func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergeOpenRouterModelsResponse

MergeOpenRouterModelsResponse performs a merge with any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody, using the provided OpenRouterModelsResponse

func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergePublicModelsListResponse

MergePublicModelsListResponse performs a merge with any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody, using the provided PublicModelsListResponse

func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) UnmarshalJSON

type ListPublicModelsEndpointPublicV1ModelsGetParams

type ListPublicModelsEndpointPublicV1ModelsGetParams struct {
	// Format Output format: 'default' (Cerebras schema), 'openrouter', or 'huggingface'
	Format   *ModelFormat `form:"format,omitempty" json:"format,omitempty"`
	XAmzCfId *string      `json:"X-Amz-Cf-Id,omitempty"`
	CFRAY    *string      `json:"CF-RAY,omitempty"`
}

ListPublicModelsEndpointPublicV1ModelsGetParams defines parameters for ListPublicModelsEndpointPublicV1ModelsGet.

type ListPublicModelsEndpointPublicV1ModelsGetResponse

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

func ParseListPublicModelsEndpointPublicV1ModelsGetResponse

func ParseListPublicModelsEndpointPublicV1ModelsGetResponse(rsp *http.Response) (*ListPublicModelsEndpointPublicV1ModelsGetResponse, error)

ParseListPublicModelsEndpointPublicV1ModelsGetResponse parses an HTTP response from a ListPublicModelsEndpointPublicV1ModelsGetWithResponse call

func (ListPublicModelsEndpointPublicV1ModelsGetResponse) ContentType

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

func (ListPublicModelsEndpointPublicV1ModelsGetResponse) GetBody

GetBody returns the raw response body bytes

func (ListPublicModelsEndpointPublicV1ModelsGetResponse) GetJSON200

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

func (ListPublicModelsEndpointPublicV1ModelsGetResponse) GetJSON422

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

func (ListPublicModelsEndpointPublicV1ModelsGetResponse) Status

Status returns HTTPResponse.Status

func (ListPublicModelsEndpointPublicV1ModelsGetResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type LogProbsContent

type LogProbsContent struct {
	Bytes       *[]int        `json:"bytes,omitempty"`
	Logprob     float64       `json:"logprob"`
	Token       string        `json:"token"`
	TopLogprobs []TopLogProbs `json:"top_logprobs"`
}

LogProbsContent defines model for LogProbsContent.

type ModelArchitecture

type ModelArchitecture struct {
	// InstructType The instruction format type used for fine-tuning (e.g., 'llama3', 'chatml').
	InstructType *string `json:"instruct_type,omitempty"`

	// Modality The modality of the model (e.g., 'text', 'text+vision', 'multimodal').
	Modality ModelArchitectureModality `json:"modality"`

	// Tokenizer The tokenizer used by the model (e.g., 'Llama3', 'GPT4').
	Tokenizer string `json:"tokenizer"`
}

ModelArchitecture Architecture details of the model.

type ModelArchitectureModality

type ModelArchitectureModality string

ModelArchitectureModality The modality of the model (e.g., 'text', 'text+vision', 'multimodal').

const (
	ModelArchitectureModalityMultimodal ModelArchitectureModality = "multimodal"
	ModelArchitectureModalityText       ModelArchitectureModality = "text"
	ModelArchitectureModalityTextVision ModelArchitectureModality = "text+vision"
)

Defines values for ModelArchitectureModality.

func (ModelArchitectureModality) Valid

func (e ModelArchitectureModality) Valid() bool

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

type ModelCapabilities

type ModelCapabilities struct {
	// FunctionCalling Indicates if the model supports function calling (tool use).
	FunctionCalling *bool `json:"function_calling,omitempty"`

	// JsonMode Indicates if the model supports JSON mode (guaranteed JSON output).
	JsonMode *bool `json:"json_mode,omitempty"`

	// ParallelToolCalls Indicates if the model supports parallel tool calls.
	ParallelToolCalls *bool `json:"parallel_tool_calls,omitempty"`

	// Reasoning Indicates if the model supports reasoning/chain-of-thought outputs.
	Reasoning *bool `json:"reasoning,omitempty"`

	// ResponseFormat Indicates if the model supports the response_format parameter.
	ResponseFormat *bool `json:"response_format,omitempty"`

	// Streaming Indicates if the model supports streaming responses via Server-Sent Events (SSE).
	Streaming *bool `json:"streaming,omitempty"`

	// StructuredOutputs Indicates if the model supports structured outputs (e.g. JSON schema enforcement).
	StructuredOutputs *bool `json:"structured_outputs,omitempty"`

	// ToolChoice Indicates if the model supports the tool_choice parameter.
	ToolChoice *bool `json:"tool_choice,omitempty"`

	// Tools Indicates if the model supports the tools parameter.
	Tools *bool `json:"tools,omitempty"`

	// Vision Indicates if the model accepts image inputs (vision capabilities).
	Vision *bool `json:"vision,omitempty"`
}

ModelCapabilities Capabilities and features supported by the model.

type ModelFormat

type ModelFormat string

ModelFormat Output format for public models endpoint.

const (
	ModelFormatDefault     ModelFormat = "default"
	ModelFormatHuggingface ModelFormat = "huggingface"
	ModelFormatOpenrouter  ModelFormat = "openrouter"
)

Defines values for ModelFormat.

func (ModelFormat) Valid

func (e ModelFormat) Valid() bool

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

type ModelLimits

type ModelLimits struct {
	// MaxCompletionTokens The maximum number of tokens that can be generated in a single completion.
	MaxCompletionTokens int `json:"max_completion_tokens"`

	// MaxContextLength The maximum context window size in tokens.
	MaxContextLength int `json:"max_context_length"`

	// RequestsPerMinute The default rate limit for requests per minute (RPM).
	RequestsPerMinute *int `json:"requests_per_minute,omitempty"`

	// TokensPerMinute The default rate limit for tokens per minute (TPM).
	TokensPerMinute *int `json:"tokens_per_minute,omitempty"`
}

ModelLimits Rate limits and constraints for the model.

type ModelMetadata

type ModelMetadata struct {
	Created *int                 `json:"created,omitempty"`
	Id      string               `json:"id"`
	Object  *ModelMetadataObject `json:"object,omitempty"`
	OwnedBy *string              `json:"owned_by,omitempty"`
}

ModelMetadata defines model for ModelMetadata.

type ModelMetadataList

type ModelMetadataList struct {
	Data   []ModelMetadata          `json:"data"`
	Object *ModelMetadataListObject `json:"object,omitempty"`
}

ModelMetadataList defines model for ModelMetadataList.

type ModelMetadataListObject

type ModelMetadataListObject string

ModelMetadataListObject defines model for ModelMetadataList.Object.

const (
	ModelMetadataListObjectList ModelMetadataListObject = "list"
)

Defines values for ModelMetadataListObject.

func (ModelMetadataListObject) Valid

func (e ModelMetadataListObject) Valid() bool

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

type ModelMetadataObject

type ModelMetadataObject string

ModelMetadataObject defines model for ModelMetadata.Object.

const (
	ModelMetadataObjectModel ModelMetadataObject = "model"
)

Defines values for ModelMetadataObject.

func (ModelMetadataObject) Valid

func (e ModelMetadataObject) Valid() bool

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

type ModelPricing

type ModelPricing struct {
	// Completion Cost per token for completion (output) tokens in USD.
	Completion string `json:"completion"`

	// Prompt Cost per token for prompt (input) tokens in USD.
	Prompt string `json:"prompt"`
}

ModelPricing Pricing information for a model.

type OpenRouterInfo

type OpenRouterInfo struct {
	// Slug OpenRouter slug for the model
	Slug string `json:"slug"`
}

OpenRouterInfo OpenRouter metadata.

type OpenRouterModel

type OpenRouterModel struct {
	ContextLength int `json:"context_length"`

	// Created Unix timestamp when model was created
	Created int `json:"created"`

	// Datacenters Datacenter locations
	Datacenters *[]DatacenterLocation `json:"datacenters,omitempty"`

	// Description Model description
	Description *string `json:"description,omitempty"`

	// HuggingFaceId The corresponding HuggingFace Hub model ID, if available
	HuggingFaceId *string `json:"hugging_face_id,omitempty"`

	// Id Model ID with provider prefix, e.g., 'cerebras/llama3.1-8b'
	Id string `json:"id"`

	// InputModalities Supported input modalities (text, image, file)
	InputModalities *[]string `json:"input_modalities,omitempty"`

	// MaxOutputLength Maximum number of output tokens
	MaxOutputLength int    `json:"max_output_length"`
	Name            string `json:"name"`

	// Openrouter OpenRouter metadata
	Openrouter *OpenRouterInfo `json:"openrouter,omitempty"`

	// OutputModalities Supported output modalities (text, image, file)
	OutputModalities *[]string `json:"output_modalities,omitempty"`

	// Pricing OpenRouter pricing format.
	Pricing OpenRouterPricing `json:"pricing"`

	// Quantization Model quantization (fp16 only for Cerebras)
	Quantization *string `json:"quantization,omitempty"`

	// SupportedFeatures List of supported features
	SupportedFeatures *[]string `json:"supported_features,omitempty"`

	// SupportedSamplingParameters List of supported sampling parameters
	SupportedSamplingParameters *[]string `json:"supported_sampling_parameters,omitempty"`
}

OpenRouterModel Model in OpenRouter-compatible format.

type OpenRouterModelsResponse

type OpenRouterModelsResponse struct {
	Data []OpenRouterModel `json:"data"`
}

OpenRouterModelsResponse OpenRouter-compatible list of models.

type OpenRouterPricing

type OpenRouterPricing struct {
	// Completion Cost per output token as string
	Completion string `json:"completion"`

	// Image Cost per image as string
	Image *string `json:"image,omitempty"`

	// InputCacheRead Cost per cached input token read as string
	InputCacheRead *string `json:"input_cache_read,omitempty"`

	// InputCacheWrite Cost per cached input token write as string
	InputCacheWrite *string `json:"input_cache_write,omitempty"`

	// Prompt Cost per input token as string
	Prompt string `json:"prompt"`

	// Request Cost per request as string
	Request *string `json:"request,omitempty"`
}

OpenRouterPricing OpenRouter pricing format.

type Parameters

type Parameters map[string]interface{}

Parameters Represents the parameters a function accepts. This model is designed to be flexible to accommodate any JSON Schema. The key-value pairs you provide will define the parameters.

type Prediction

type Prediction struct {
	Content Prediction_Content `json:"content"`
	Type    PredictionType     `json:"type"`
}

Prediction defines model for Prediction.

type PredictionContent0

type PredictionContent0 = string

PredictionContent0 defines model for Prediction.Content.0.

type PredictionContent1

type PredictionContent1 = []TextContent

PredictionContent1 defines model for Prediction.Content.1.

type PredictionType

type PredictionType string

PredictionType defines model for Prediction.Type.

const (
	PredictionTypeContent PredictionType = "content"
)

Defines values for PredictionType.

func (PredictionType) Valid

func (e PredictionType) Valid() bool

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

type Prediction_Content

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

Prediction_Content defines model for Prediction.Content.

func (Prediction_Content) AsPredictionContent0

func (t Prediction_Content) AsPredictionContent0() (PredictionContent0, error)

AsPredictionContent0 returns the union data inside the Prediction_Content as a PredictionContent0

func (Prediction_Content) AsPredictionContent1

func (t Prediction_Content) AsPredictionContent1() (PredictionContent1, error)

AsPredictionContent1 returns the union data inside the Prediction_Content as a PredictionContent1

func (*Prediction_Content) FromPredictionContent0

func (t *Prediction_Content) FromPredictionContent0(v PredictionContent0) error

FromPredictionContent0 overwrites any union data inside the Prediction_Content as the provided PredictionContent0

func (*Prediction_Content) FromPredictionContent1

func (t *Prediction_Content) FromPredictionContent1(v PredictionContent1) error

FromPredictionContent1 overwrites any union data inside the Prediction_Content as the provided PredictionContent1

func (Prediction_Content) MarshalJSON

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

func (*Prediction_Content) MergePredictionContent0

func (t *Prediction_Content) MergePredictionContent0(v PredictionContent0) error

MergePredictionContent0 performs a merge with any union data inside the Prediction_Content, using the provided PredictionContent0

func (*Prediction_Content) MergePredictionContent1

func (t *Prediction_Content) MergePredictionContent1(v PredictionContent1) error

MergePredictionContent1 performs a merge with any union data inside the Prediction_Content, using the provided PredictionContent1

func (*Prediction_Content) UnmarshalJSON

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

type PromptTokensDetails

type PromptTokensDetails struct {
	CachedTokens *int `json:"cached_tokens,omitempty"`
}

PromptTokensDetails Examples: {"cached_tokens":1020}

type PublicModel

type PublicModel struct {
	// Architecture Technical architecture details of the model.
	Architecture ModelArchitecture `json:"architecture"`

	// Capabilities The capabilities supported by the model.
	Capabilities ModelCapabilities `json:"capabilities"`

	// Created The Unix timestamp (in seconds) when the model was created.
	Created int `json:"created"`

	// DatacenterLocations List of datacenter locations where this model is deployed (e.g., ['us-east-1', 'eu-west-1']).
	DatacenterLocations *[]string `json:"datacenter_locations,omitempty"`

	// Deprecated Indicates if the model is deprecated and should not be used for new applications.
	Deprecated *bool `json:"deprecated,omitempty"`

	// Description A brief description of the model.
	Description string `json:"description"`

	// HuggingFaceId The corresponding HuggingFace Hub model ID, if available (e.g., 'meta-llama/Llama-3.1-8B-Instruct').
	HuggingFaceId *string `json:"hugging_face_id,omitempty"`

	// Id The unique identifier for the model (e.g., 'llama3.1-8b').
	Id string `json:"id"`

	// Limits Usage limits and constraints for the model.
	Limits ModelLimits `json:"limits"`

	// Name The human-readable name of the model.
	Name string `json:"name"`

	// Object The object type, which is always 'model'.
	Object *PublicModelObject `json:"object,omitempty"`

	// OwnedBy The organization that owns or created the model.
	OwnedBy string `json:"owned_by"`

	// Preview Indicates if the model is in preview or beta status.
	Preview *bool `json:"preview,omitempty"`

	// Pricing Pricing details for the model.
	Pricing ModelPricing `json:"pricing"`

	// Quantization Quantization precision (e.g., 'FP16', 'FP16/FP8 (weights only)').
	Quantization *string `json:"quantization,omitempty"`

	// SupportedParameters Sampling parameters supported by the model.
	SupportedParameters SupportedParameters `json:"supported_parameters"`
}

PublicModel Complete model specification following OpenAI-compatible schema with extensions for OpenRouter/HuggingFace compatibility.

type PublicModelObject

type PublicModelObject string

PublicModelObject The object type, which is always 'model'.

const (
	PublicModelObjectModel PublicModelObject = "model"
)

Defines values for PublicModelObject.

func (PublicModelObject) Valid

func (e PublicModelObject) Valid() bool

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

type PublicModelsListResponse

type PublicModelsListResponse struct {
	// Data Array of model objects
	Data []PublicModel `json:"data"`

	// Object Object type (always 'list')
	Object *PublicModelsListResponseObject `json:"object,omitempty"`
}

PublicModelsListResponse OpenAI-compatible list of models.

type PublicModelsListResponseObject

type PublicModelsListResponseObject string

PublicModelsListResponseObject Object type (always 'list')

const (
	PublicModelsListResponseObjectList PublicModelsListResponseObject = "list"
)

Defines values for PublicModelsListResponseObject.

func (PublicModelsListResponseObject) Valid

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

type ReasoningEffort

type ReasoningEffort string

ReasoningEffort defines model for ReasoningEffort.

const (
	ReasoningEffortHigh   ReasoningEffort = "high"
	ReasoningEffortLow    ReasoningEffort = "low"
	ReasoningEffortMedium ReasoningEffort = "medium"
	ReasoningEffortNone   ReasoningEffort = "none"
)

Defines values for ReasoningEffort.

func (ReasoningEffort) Valid

func (e ReasoningEffort) Valid() bool

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

type ReasoningFormat

type ReasoningFormat string

ReasoningFormat defines model for ReasoningFormat.

const (
	ReasoningFormatHidden     ReasoningFormat = "hidden"
	ReasoningFormatNone       ReasoningFormat = "none"
	ReasoningFormatParsed     ReasoningFormat = "parsed"
	ReasoningFormatRaw        ReasoningFormat = "raw"
	ReasoningFormatTextParsed ReasoningFormat = "text_parsed"
)

Defines values for ReasoningFormat.

func (ReasoningFormat) Valid

func (e ReasoningFormat) Valid() bool

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

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ResponseFormatJSONObject

type ResponseFormatJSONObject struct {
	Type ResponseFormatJSONObjectType `json:"type"`
}

ResponseFormatJSONObject A response format for a JSON object.

type ResponseFormatJSONObjectType

type ResponseFormatJSONObjectType string

ResponseFormatJSONObjectType defines model for ResponseFormatJSONObject.Type.

const (
	ResponseFormatJSONObjectTypeJsonObject ResponseFormatJSONObjectType = "json_object"
)

Defines values for ResponseFormatJSONObjectType.

func (ResponseFormatJSONObjectType) Valid

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

type ResponseFormatJSONSchema

type ResponseFormatJSONSchema struct {
	// JsonSchema A JSON Schema object.
	JsonSchema JSONSchema                   `json:"json_schema"`
	Type       ResponseFormatJSONSchemaType `json:"type"`
}

ResponseFormatJSONSchema A response format for a JSON schema.

type ResponseFormatJSONSchemaType

type ResponseFormatJSONSchemaType string

ResponseFormatJSONSchemaType defines model for ResponseFormatJSONSchema.Type.

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 ResponseFormatTextType `json:"type"`
}

ResponseFormatText A response format for text.

type ResponseFormatTextType

type ResponseFormatTextType string

ResponseFormatTextType defines model for ResponseFormatText.Type.

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 ServiceTier

type ServiceTier string

ServiceTier defines model for ServiceTier.

const (
	ServiceTierAuto     ServiceTier = "auto"
	ServiceTierDefault  ServiceTier = "default"
	ServiceTierFlex     ServiceTier = "flex"
	ServiceTierPriority ServiceTier = "priority"
)

Defines values for ServiceTier.

func (ServiceTier) Valid

func (e ServiceTier) Valid() bool

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

type StreamOptions

type StreamOptions struct {
	IncludeUsage *bool `json:"include_usage,omitempty"`
}

StreamOptions Options for streaming.

type SupportedParameters

type SupportedParameters struct {
	// FrequencyPenalty Supports frequency_penalty parameter.
	FrequencyPenalty *bool `json:"frequency_penalty,omitempty"`

	// LogitBias Supports logit_bias parameter.
	LogitBias *bool `json:"logit_bias,omitempty"`

	// Logprobs Supports logprobs output.
	Logprobs *bool `json:"logprobs,omitempty"`

	// MaxCompletionTokens Supports max_completion_tokens parameter.
	MaxCompletionTokens *bool `json:"max_completion_tokens,omitempty"`

	// PresencePenalty Supports presence_penalty parameter.
	PresencePenalty *bool `json:"presence_penalty,omitempty"`

	// RepetitionPenalty Supports repetition_penalty parameter.
	RepetitionPenalty *bool `json:"repetition_penalty,omitempty"`

	// Seed Supports seed for reproducible outputs.
	Seed *bool `json:"seed,omitempty"`

	// Stop Supports stop sequences parameter.
	Stop *bool `json:"stop,omitempty"`

	// Temperature Supports temperature sampling parameter.
	Temperature *bool `json:"temperature,omitempty"`

	// TopLogprobs Supports top_logprobs parameter.
	TopLogprobs *bool `json:"top_logprobs,omitempty"`

	// TopP Supports top_p (nucleus) sampling parameter.
	TopP *bool `json:"top_p,omitempty"`
}

SupportedParameters Sampling parameters supported by the model.

type SystemMessageRequest

type SystemMessageRequest struct {
	Content SystemMessageRequest_Content `json:"content"`
	Name    *string                      `json:"name,omitempty"`
	Role    *SystemMessageRequestRole    `json:"role,omitempty"`
}

SystemMessageRequest A message request from the system.

type SystemMessageRequestContent0

type SystemMessageRequestContent0 = string

SystemMessageRequestContent0 defines model for SystemMessageRequest.Content.0.

type SystemMessageRequestContent1

type SystemMessageRequestContent1 = []SystemMessageRequest_Content_1_Item

SystemMessageRequestContent1 defines model for SystemMessageRequest.Content.1.

type SystemMessageRequestRole

type SystemMessageRequestRole string

SystemMessageRequestRole defines model for SystemMessageRequest.Role.

const (
	SystemMessageRequestRoleSystem SystemMessageRequestRole = "system"
)

Defines values for SystemMessageRequestRole.

func (SystemMessageRequestRole) Valid

func (e SystemMessageRequestRole) Valid() bool

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

type SystemMessageRequest_Content

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

SystemMessageRequest_Content defines model for SystemMessageRequest.Content.

func (SystemMessageRequest_Content) AsSystemMessageRequestContent0

func (t SystemMessageRequest_Content) AsSystemMessageRequestContent0() (SystemMessageRequestContent0, error)

AsSystemMessageRequestContent0 returns the union data inside the SystemMessageRequest_Content as a SystemMessageRequestContent0

func (SystemMessageRequest_Content) AsSystemMessageRequestContent1

func (t SystemMessageRequest_Content) AsSystemMessageRequestContent1() (SystemMessageRequestContent1, error)

AsSystemMessageRequestContent1 returns the union data inside the SystemMessageRequest_Content as a SystemMessageRequestContent1

func (*SystemMessageRequest_Content) FromSystemMessageRequestContent0

func (t *SystemMessageRequest_Content) FromSystemMessageRequestContent0(v SystemMessageRequestContent0) error

FromSystemMessageRequestContent0 overwrites any union data inside the SystemMessageRequest_Content as the provided SystemMessageRequestContent0

func (*SystemMessageRequest_Content) FromSystemMessageRequestContent1

func (t *SystemMessageRequest_Content) FromSystemMessageRequestContent1(v SystemMessageRequestContent1) error

FromSystemMessageRequestContent1 overwrites any union data inside the SystemMessageRequest_Content as the provided SystemMessageRequestContent1

func (SystemMessageRequest_Content) MarshalJSON

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

func (*SystemMessageRequest_Content) MergeSystemMessageRequestContent0

func (t *SystemMessageRequest_Content) MergeSystemMessageRequestContent0(v SystemMessageRequestContent0) error

MergeSystemMessageRequestContent0 performs a merge with any union data inside the SystemMessageRequest_Content, using the provided SystemMessageRequestContent0

func (*SystemMessageRequest_Content) MergeSystemMessageRequestContent1

func (t *SystemMessageRequest_Content) MergeSystemMessageRequestContent1(v SystemMessageRequestContent1) error

MergeSystemMessageRequestContent1 performs a merge with any union data inside the SystemMessageRequest_Content, using the provided SystemMessageRequestContent1

func (*SystemMessageRequest_Content) UnmarshalJSON

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

type SystemMessageRequest_Content_1_Item

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

SystemMessageRequest_Content_1_Item defines model for SystemMessageRequest.Content.1.Item.

func (SystemMessageRequest_Content_1_Item) AsImageContent

AsImageContent returns the union data inside the SystemMessageRequest_Content_1_Item as a ImageContent

func (SystemMessageRequest_Content_1_Item) AsImageUrlContent

AsImageUrlContent returns the union data inside the SystemMessageRequest_Content_1_Item as a ImageUrlContent

func (SystemMessageRequest_Content_1_Item) AsTextContent

AsTextContent returns the union data inside the SystemMessageRequest_Content_1_Item as a TextContent

func (SystemMessageRequest_Content_1_Item) Discriminator

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

func (*SystemMessageRequest_Content_1_Item) FromImageContent

FromImageContent overwrites any union data inside the SystemMessageRequest_Content_1_Item as the provided ImageContent

func (*SystemMessageRequest_Content_1_Item) FromImageUrlContent

func (t *SystemMessageRequest_Content_1_Item) FromImageUrlContent(v ImageUrlContent) error

FromImageUrlContent overwrites any union data inside the SystemMessageRequest_Content_1_Item as the provided ImageUrlContent

func (*SystemMessageRequest_Content_1_Item) FromTextContent

FromTextContent overwrites any union data inside the SystemMessageRequest_Content_1_Item as the provided TextContent

func (SystemMessageRequest_Content_1_Item) MarshalJSON

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

func (*SystemMessageRequest_Content_1_Item) MergeImageContent

func (t *SystemMessageRequest_Content_1_Item) MergeImageContent(v ImageContent) error

MergeImageContent performs a merge with any union data inside the SystemMessageRequest_Content_1_Item, using the provided ImageContent

func (*SystemMessageRequest_Content_1_Item) MergeImageUrlContent

func (t *SystemMessageRequest_Content_1_Item) MergeImageUrlContent(v ImageUrlContent) error

MergeImageUrlContent performs a merge with any union data inside the SystemMessageRequest_Content_1_Item, using the provided ImageUrlContent

func (*SystemMessageRequest_Content_1_Item) MergeTextContent

func (t *SystemMessageRequest_Content_1_Item) MergeTextContent(v TextContent) error

MergeTextContent performs a merge with any union data inside the SystemMessageRequest_Content_1_Item, using the provided TextContent

func (*SystemMessageRequest_Content_1_Item) UnmarshalJSON

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

func (SystemMessageRequest_Content_1_Item) ValueByDiscriminator

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

type TcpWarmingV1TcpWarmingGetResponse

type TcpWarmingV1TcpWarmingGetResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *interface{}
}

func ParseTcpWarmingV1TcpWarmingGetResponse

func ParseTcpWarmingV1TcpWarmingGetResponse(rsp *http.Response) (*TcpWarmingV1TcpWarmingGetResponse, error)

ParseTcpWarmingV1TcpWarmingGetResponse parses an HTTP response from a TcpWarmingV1TcpWarmingGetWithResponse call

func (TcpWarmingV1TcpWarmingGetResponse) ContentType

func (r TcpWarmingV1TcpWarmingGetResponse) ContentType() string

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

func (TcpWarmingV1TcpWarmingGetResponse) GetBody

GetBody returns the raw response body bytes

func (TcpWarmingV1TcpWarmingGetResponse) GetJSON200

func (r TcpWarmingV1TcpWarmingGetResponse) GetJSON200() *interface{}

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

func (TcpWarmingV1TcpWarmingGetResponse) Status

Status returns HTTPResponse.Status

func (TcpWarmingV1TcpWarmingGetResponse) StatusCode

func (r TcpWarmingV1TcpWarmingGetResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type TextContent

type TextContent struct {
	Text string          `json:"text"`
	Type TextContentType `json:"type"`
}

TextContent Text content for a message.

type TextContentType

type TextContentType string

TextContentType defines model for TextContent.Type.

const (
	TextContentTypeText TextContentType = "text"
)

Defines values for TextContentType.

func (TextContentType) Valid

func (e TextContentType) Valid() bool

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

type TimeInfo

type TimeInfo struct {
	CompletionTime *float64 `json:"completion_time,omitempty"`
	Created        *float64 `json:"created,omitempty"`
	PromptTime     *float64 `json:"prompt_time,omitempty"`
	QueueTime      *float64 `json:"queue_time,omitempty"`
	TotalTime      *float64 `json:"total_time,omitempty"`
}

TimeInfo Time information for different phases of request processing.

All times are measured in seconds.

Examples: {"completion_time":0.44,"prompt_time":0.02,"queue_time":0,"total_time":0.46}

type Tool

type Tool struct {
	// Function A function object.
	Function FunctionObject `json:"function"`
	Type     string         `json:"type"`
}

Tool A tool object

type ToolChoice

type ToolChoice string

ToolChoice A tool choice object.

const (
	ToolChoiceAuto     ToolChoice = "auto"
	ToolChoiceNone     ToolChoice = "none"
	ToolChoiceRequired ToolChoice = "required"
)

Defines values for ToolChoice.

func (ToolChoice) Valid

func (e ToolChoice) Valid() bool

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

type ToolMessageRequest

type ToolMessageRequest struct {
	Content    ToolMessageRequest_Content `json:"content"`
	Name       *string                    `json:"name,omitempty"`
	Role       *ToolMessageRequestRole    `json:"role,omitempty"`
	ToolCallId string                     `json:"tool_call_id"`
}

ToolMessageRequest A message request from a tool.

type ToolMessageRequestContent0

type ToolMessageRequestContent0 = string

ToolMessageRequestContent0 defines model for ToolMessageRequest.Content.0.

type ToolMessageRequestContent1

type ToolMessageRequestContent1 = []TextContent

ToolMessageRequestContent1 defines model for ToolMessageRequest.Content.1.

type ToolMessageRequestRole

type ToolMessageRequestRole string

ToolMessageRequestRole defines model for ToolMessageRequest.Role.

const (
	ToolMessageRequestRoleTool ToolMessageRequestRole = "tool"
)

Defines values for ToolMessageRequestRole.

func (ToolMessageRequestRole) Valid

func (e ToolMessageRequestRole) Valid() bool

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

type ToolMessageRequest_Content

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

ToolMessageRequest_Content defines model for ToolMessageRequest.Content.

func (ToolMessageRequest_Content) AsToolMessageRequestContent0

func (t ToolMessageRequest_Content) AsToolMessageRequestContent0() (ToolMessageRequestContent0, error)

AsToolMessageRequestContent0 returns the union data inside the ToolMessageRequest_Content as a ToolMessageRequestContent0

func (ToolMessageRequest_Content) AsToolMessageRequestContent1

func (t ToolMessageRequest_Content) AsToolMessageRequestContent1() (ToolMessageRequestContent1, error)

AsToolMessageRequestContent1 returns the union data inside the ToolMessageRequest_Content as a ToolMessageRequestContent1

func (*ToolMessageRequest_Content) FromToolMessageRequestContent0

func (t *ToolMessageRequest_Content) FromToolMessageRequestContent0(v ToolMessageRequestContent0) error

FromToolMessageRequestContent0 overwrites any union data inside the ToolMessageRequest_Content as the provided ToolMessageRequestContent0

func (*ToolMessageRequest_Content) FromToolMessageRequestContent1

func (t *ToolMessageRequest_Content) FromToolMessageRequestContent1(v ToolMessageRequestContent1) error

FromToolMessageRequestContent1 overwrites any union data inside the ToolMessageRequest_Content as the provided ToolMessageRequestContent1

func (ToolMessageRequest_Content) MarshalJSON

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

func (*ToolMessageRequest_Content) MergeToolMessageRequestContent0

func (t *ToolMessageRequest_Content) MergeToolMessageRequestContent0(v ToolMessageRequestContent0) error

MergeToolMessageRequestContent0 performs a merge with any union data inside the ToolMessageRequest_Content, using the provided ToolMessageRequestContent0

func (*ToolMessageRequest_Content) MergeToolMessageRequestContent1

func (t *ToolMessageRequest_Content) MergeToolMessageRequestContent1(v ToolMessageRequestContent1) error

MergeToolMessageRequestContent1 performs a merge with any union data inside the ToolMessageRequest_Content, using the provided ToolMessageRequestContent1

func (*ToolMessageRequest_Content) UnmarshalJSON

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

type TopLogProbs

type TopLogProbs struct {
	Bytes   *[]int  `json:"bytes,omitempty"`
	Logprob float64 `json:"logprob"`
	Token   string  `json:"token"`
}

TopLogProbs defines model for TopLogProbs.

type Usage

type Usage struct {
	CompletionTokens        *int                     `json:"completion_tokens,omitempty"`
	CompletionTokensDetails *CompletionTokensDetails `json:"completion_tokens_details,omitempty"`
	ImageTokens             *int                     `json:"image_tokens,omitempty"`
	PromptTokens            *int                     `json:"prompt_tokens,omitempty"`
	PromptTokensDetails     *PromptTokensDetails     `json:"prompt_tokens_details,omitempty"`
	TotalTokens             *int                     `json:"total_tokens,omitempty"`
}

Usage Examples: {"completion_tokens":1020,"prompt_tokens":40,"prompt_tokens_details":{"cached_tokens":1020},"total_tokens":1060}

type UserMessageRequest

type UserMessageRequest struct {
	Content UserMessageRequest_Content `json:"content"`
	Name    *string                    `json:"name,omitempty"`
	Role    *UserMessageRequestRole    `json:"role,omitempty"`
}

UserMessageRequest A message request from the user.

type UserMessageRequestContent0

type UserMessageRequestContent0 = string

UserMessageRequestContent0 defines model for UserMessageRequest.Content.0.

type UserMessageRequestContent1

type UserMessageRequestContent1 = []UserMessageRequest_Content_1_Item

UserMessageRequestContent1 defines model for UserMessageRequest.Content.1.

type UserMessageRequestRole

type UserMessageRequestRole string

UserMessageRequestRole defines model for UserMessageRequest.Role.

const (
	UserMessageRequestRoleUser UserMessageRequestRole = "user"
)

Defines values for UserMessageRequestRole.

func (UserMessageRequestRole) Valid

func (e UserMessageRequestRole) Valid() bool

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

type UserMessageRequest_Content

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

UserMessageRequest_Content defines model for UserMessageRequest.Content.

func (UserMessageRequest_Content) AsUserMessageRequestContent0

func (t UserMessageRequest_Content) AsUserMessageRequestContent0() (UserMessageRequestContent0, error)

AsUserMessageRequestContent0 returns the union data inside the UserMessageRequest_Content as a UserMessageRequestContent0

func (UserMessageRequest_Content) AsUserMessageRequestContent1

func (t UserMessageRequest_Content) AsUserMessageRequestContent1() (UserMessageRequestContent1, error)

AsUserMessageRequestContent1 returns the union data inside the UserMessageRequest_Content as a UserMessageRequestContent1

func (*UserMessageRequest_Content) FromUserMessageRequestContent0

func (t *UserMessageRequest_Content) FromUserMessageRequestContent0(v UserMessageRequestContent0) error

FromUserMessageRequestContent0 overwrites any union data inside the UserMessageRequest_Content as the provided UserMessageRequestContent0

func (*UserMessageRequest_Content) FromUserMessageRequestContent1

func (t *UserMessageRequest_Content) FromUserMessageRequestContent1(v UserMessageRequestContent1) error

FromUserMessageRequestContent1 overwrites any union data inside the UserMessageRequest_Content as the provided UserMessageRequestContent1

func (UserMessageRequest_Content) MarshalJSON

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

func (*UserMessageRequest_Content) MergeUserMessageRequestContent0

func (t *UserMessageRequest_Content) MergeUserMessageRequestContent0(v UserMessageRequestContent0) error

MergeUserMessageRequestContent0 performs a merge with any union data inside the UserMessageRequest_Content, using the provided UserMessageRequestContent0

func (*UserMessageRequest_Content) MergeUserMessageRequestContent1

func (t *UserMessageRequest_Content) MergeUserMessageRequestContent1(v UserMessageRequestContent1) error

MergeUserMessageRequestContent1 performs a merge with any union data inside the UserMessageRequest_Content, using the provided UserMessageRequestContent1

func (*UserMessageRequest_Content) UnmarshalJSON

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

type UserMessageRequest_Content_1_Item

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

UserMessageRequest_Content_1_Item defines model for UserMessageRequest.Content.1.Item.

func (UserMessageRequest_Content_1_Item) AsImageContent

AsImageContent returns the union data inside the UserMessageRequest_Content_1_Item as a ImageContent

func (UserMessageRequest_Content_1_Item) AsImageUrlContent

func (t UserMessageRequest_Content_1_Item) AsImageUrlContent() (ImageUrlContent, error)

AsImageUrlContent returns the union data inside the UserMessageRequest_Content_1_Item as a ImageUrlContent

func (UserMessageRequest_Content_1_Item) AsTextContent

AsTextContent returns the union data inside the UserMessageRequest_Content_1_Item as a TextContent

func (UserMessageRequest_Content_1_Item) Discriminator

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

func (*UserMessageRequest_Content_1_Item) FromImageContent

func (t *UserMessageRequest_Content_1_Item) FromImageContent(v ImageContent) error

FromImageContent overwrites any union data inside the UserMessageRequest_Content_1_Item as the provided ImageContent

func (*UserMessageRequest_Content_1_Item) FromImageUrlContent

func (t *UserMessageRequest_Content_1_Item) FromImageUrlContent(v ImageUrlContent) error

FromImageUrlContent overwrites any union data inside the UserMessageRequest_Content_1_Item as the provided ImageUrlContent

func (*UserMessageRequest_Content_1_Item) FromTextContent

func (t *UserMessageRequest_Content_1_Item) FromTextContent(v TextContent) error

FromTextContent overwrites any union data inside the UserMessageRequest_Content_1_Item as the provided TextContent

func (UserMessageRequest_Content_1_Item) MarshalJSON

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

func (*UserMessageRequest_Content_1_Item) MergeImageContent

func (t *UserMessageRequest_Content_1_Item) MergeImageContent(v ImageContent) error

MergeImageContent performs a merge with any union data inside the UserMessageRequest_Content_1_Item, using the provided ImageContent

func (*UserMessageRequest_Content_1_Item) MergeImageUrlContent

func (t *UserMessageRequest_Content_1_Item) MergeImageUrlContent(v ImageUrlContent) error

MergeImageUrlContent performs a merge with any union data inside the UserMessageRequest_Content_1_Item, using the provided ImageUrlContent

func (*UserMessageRequest_Content_1_Item) MergeTextContent

func (t *UserMessageRequest_Content_1_Item) MergeTextContent(v TextContent) error

MergeTextContent performs a merge with any union data inside the UserMessageRequest_Content_1_Item, using the provided TextContent

func (*UserMessageRequest_Content_1_Item) UnmarshalJSON

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

func (UserMessageRequest_Content_1_Item) ValueByDiscriminator

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

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

Jump to

Keyboard shortcuts

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