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 ¶
- func NewChatV1ChatCompletionsPostRequest(server string, params *ChatV1ChatCompletionsPostParams, ...) (*http.Request, error)
- func NewChatV1ChatCompletionsPostRequestWithBody(server string, params *ChatV1ChatCompletionsPostParams, contentType string, ...) (*http.Request, error)
- func NewCompletionsV1CompletionsPostRequest(server string, params *CompletionsV1CompletionsPostParams, ...) (*http.Request, error)
- func NewCompletionsV1CompletionsPostRequestWithBody(server string, params *CompletionsV1CompletionsPostParams, contentType string, ...) (*http.Request, error)
- func NewGetModelV1ModelsModelIdGetRequest(server string, modelId string, params *GetModelV1ModelsModelIdGetParams) (*http.Request, error)
- func NewGetPublicModelPublicV1ModelsModelIdGetRequest(server string, modelId string, ...) (*http.Request, error)
- func NewListModelsV1ModelsGetRequest(server string, params *ListModelsV1ModelsGetParams) (*http.Request, error)
- func NewListPublicModelsEndpointPublicV1ModelsGetRequest(server string, params *ListPublicModelsEndpointPublicV1ModelsGetParams) (*http.Request, error)
- func NewTcpWarmingV1TcpWarmingGetRequest(server string) (*http.Request, error)
- type AssistantMessageRequest
- type AssistantMessageRequestContent0
- type AssistantMessageRequestContent1
- type AssistantMessageRequestReasoning0
- type AssistantMessageRequestReasoning1
- type AssistantMessageRequestRole
- type AssistantMessageRequest_Content
- func (t AssistantMessageRequest_Content) AsAssistantMessageRequestContent0() (AssistantMessageRequestContent0, error)
- func (t AssistantMessageRequest_Content) AsAssistantMessageRequestContent1() (AssistantMessageRequestContent1, error)
- func (t *AssistantMessageRequest_Content) FromAssistantMessageRequestContent0(v AssistantMessageRequestContent0) error
- func (t *AssistantMessageRequest_Content) FromAssistantMessageRequestContent1(v AssistantMessageRequestContent1) error
- func (t AssistantMessageRequest_Content) MarshalJSON() ([]byte, error)
- func (t *AssistantMessageRequest_Content) MergeAssistantMessageRequestContent0(v AssistantMessageRequestContent0) error
- func (t *AssistantMessageRequest_Content) MergeAssistantMessageRequestContent1(v AssistantMessageRequestContent1) error
- func (t *AssistantMessageRequest_Content) UnmarshalJSON(b []byte) error
- type AssistantMessageRequest_Reasoning
- func (t AssistantMessageRequest_Reasoning) AsAssistantMessageRequestReasoning0() (AssistantMessageRequestReasoning0, error)
- func (t AssistantMessageRequest_Reasoning) AsAssistantMessageRequestReasoning1() (AssistantMessageRequestReasoning1, error)
- func (t *AssistantMessageRequest_Reasoning) FromAssistantMessageRequestReasoning0(v AssistantMessageRequestReasoning0) error
- func (t *AssistantMessageRequest_Reasoning) FromAssistantMessageRequestReasoning1(v AssistantMessageRequestReasoning1) error
- func (t AssistantMessageRequest_Reasoning) MarshalJSON() ([]byte, error)
- func (t *AssistantMessageRequest_Reasoning) MergeAssistantMessageRequestReasoning0(v AssistantMessageRequestReasoning0) error
- func (t *AssistantMessageRequest_Reasoning) MergeAssistantMessageRequestReasoning1(v AssistantMessageRequestReasoning1) error
- func (t *AssistantMessageRequest_Reasoning) UnmarshalJSON(b []byte) error
- type AssistantToolCall
- type AssistantToolCallFunction
- type AssistantToolCallType
- type ChatChunkChoice
- type ChatChunkChoiceFinishReason
- type ChatChunkResponse
- type ChatChunkResponseObject
- type ChatCompletionChoice
- type ChatCompletionChoiceFinishReason
- type ChatCompletionLogProbs
- type ChatCompletionRequest
- type ChatCompletionRequestStop0
- type ChatCompletionRequestStop1
- type ChatCompletionRequest_Messages_Item
- func (t ChatCompletionRequest_Messages_Item) AsAssistantMessageRequest() (AssistantMessageRequest, error)
- func (t ChatCompletionRequest_Messages_Item) AsDeveloperMessageRequest() (DeveloperMessageRequest, error)
- func (t ChatCompletionRequest_Messages_Item) AsSystemMessageRequest() (SystemMessageRequest, error)
- func (t ChatCompletionRequest_Messages_Item) AsToolMessageRequest() (ToolMessageRequest, error)
- func (t ChatCompletionRequest_Messages_Item) AsUserMessageRequest() (UserMessageRequest, error)
- func (t ChatCompletionRequest_Messages_Item) Discriminator() (string, error)
- func (t *ChatCompletionRequest_Messages_Item) FromAssistantMessageRequest(v AssistantMessageRequest) error
- func (t *ChatCompletionRequest_Messages_Item) FromDeveloperMessageRequest(v DeveloperMessageRequest) error
- func (t *ChatCompletionRequest_Messages_Item) FromSystemMessageRequest(v SystemMessageRequest) error
- func (t *ChatCompletionRequest_Messages_Item) FromToolMessageRequest(v ToolMessageRequest) error
- func (t *ChatCompletionRequest_Messages_Item) FromUserMessageRequest(v UserMessageRequest) error
- func (t ChatCompletionRequest_Messages_Item) MarshalJSON() ([]byte, error)
- func (t *ChatCompletionRequest_Messages_Item) MergeAssistantMessageRequest(v AssistantMessageRequest) error
- func (t *ChatCompletionRequest_Messages_Item) MergeDeveloperMessageRequest(v DeveloperMessageRequest) error
- func (t *ChatCompletionRequest_Messages_Item) MergeSystemMessageRequest(v SystemMessageRequest) error
- func (t *ChatCompletionRequest_Messages_Item) MergeToolMessageRequest(v ToolMessageRequest) error
- func (t *ChatCompletionRequest_Messages_Item) MergeUserMessageRequest(v UserMessageRequest) error
- func (t *ChatCompletionRequest_Messages_Item) UnmarshalJSON(b []byte) error
- func (t ChatCompletionRequest_Messages_Item) ValueByDiscriminator() (interface{}, error)
- type ChatCompletionRequest_Stop
- func (t ChatCompletionRequest_Stop) AsChatCompletionRequestStop0() (ChatCompletionRequestStop0, error)
- func (t ChatCompletionRequest_Stop) AsChatCompletionRequestStop1() (ChatCompletionRequestStop1, error)
- func (t *ChatCompletionRequest_Stop) FromChatCompletionRequestStop0(v ChatCompletionRequestStop0) error
- func (t *ChatCompletionRequest_Stop) FromChatCompletionRequestStop1(v ChatCompletionRequestStop1) error
- func (t ChatCompletionRequest_Stop) MarshalJSON() ([]byte, error)
- func (t *ChatCompletionRequest_Stop) MergeChatCompletionRequestStop0(v ChatCompletionRequestStop0) error
- func (t *ChatCompletionRequest_Stop) MergeChatCompletionRequestStop1(v ChatCompletionRequestStop1) error
- func (t *ChatCompletionRequest_Stop) UnmarshalJSON(b []byte) error
- type ChatCompletionRequest_ToolChoice
- func (t ChatCompletionRequest_ToolChoice) AsChoiceObject() (ChoiceObject, error)
- func (t ChatCompletionRequest_ToolChoice) AsToolChoice() (ToolChoice, error)
- func (t *ChatCompletionRequest_ToolChoice) FromChoiceObject(v ChoiceObject) error
- func (t *ChatCompletionRequest_ToolChoice) FromToolChoice(v ToolChoice) error
- func (t ChatCompletionRequest_ToolChoice) MarshalJSON() ([]byte, error)
- func (t *ChatCompletionRequest_ToolChoice) MergeChoiceObject(v ChoiceObject) error
- func (t *ChatCompletionRequest_ToolChoice) MergeToolChoice(v ToolChoice) error
- func (t *ChatCompletionRequest_ToolChoice) UnmarshalJSON(b []byte) error
- type ChatCompletionResponse
- type ChatCompletionResponseMessage
- type ChatCompletionResponseMessageRole
- type ChatCompletionResponseObject
- type ChatV1ChatCompletionsPostJSONRequestBody
- type ChatV1ChatCompletionsPostParams
- type ChatV1ChatCompletionsPostResponse
- func (r ChatV1ChatCompletionsPostResponse) ContentType() string
- func (r ChatV1ChatCompletionsPostResponse) GetBody() []byte
- func (r ChatV1ChatCompletionsPostResponse) GetJSON200() *CreateChatCompletionResponse
- func (r ChatV1ChatCompletionsPostResponse) GetJSON422() *HTTPValidationError
- func (r ChatV1ChatCompletionsPostResponse) Status() string
- func (r ChatV1ChatCompletionsPostResponse) StatusCode() int
- type ChoiceObject
- type ChoiceObjectFunction
- type ChunkAssistantToolCall
- type ChunkAssistantToolCallFunction
- type ChunkAssistantToolCallType
- type ChunkResponseMessage
- type ChunkResponseMessageRole
- type Client
- func (c *Client) ChatV1ChatCompletionsPost(ctx context.Context, params *ChatV1ChatCompletionsPostParams, ...) (*http.Response, error)
- func (c *Client) ChatV1ChatCompletionsPostWithBody(ctx context.Context, params *ChatV1ChatCompletionsPostParams, ...) (*http.Response, error)
- func (c *Client) CompletionsV1CompletionsPost(ctx context.Context, params *CompletionsV1CompletionsPostParams, ...) (*http.Response, error)
- func (c *Client) CompletionsV1CompletionsPostWithBody(ctx context.Context, params *CompletionsV1CompletionsPostParams, ...) (*http.Response, error)
- func (c *Client) GetModelV1ModelsModelIdGet(ctx context.Context, modelId string, params *GetModelV1ModelsModelIdGetParams, ...) (*http.Response, error)
- func (c *Client) GetPublicModelPublicV1ModelsModelIdGet(ctx context.Context, modelId string, ...) (*http.Response, error)
- func (c *Client) ListModelsV1ModelsGet(ctx context.Context, params *ListModelsV1ModelsGetParams, ...) (*http.Response, error)
- func (c *Client) ListPublicModelsEndpointPublicV1ModelsGet(ctx context.Context, params *ListPublicModelsEndpointPublicV1ModelsGetParams, ...) (*http.Response, error)
- func (c *Client) TcpWarmingV1TcpWarmingGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) ChatV1ChatCompletionsPostWithBodyWithResponse(ctx context.Context, params *ChatV1ChatCompletionsPostParams, ...) (*ChatV1ChatCompletionsPostResponse, error)
- func (c *ClientWithResponses) ChatV1ChatCompletionsPostWithResponse(ctx context.Context, params *ChatV1ChatCompletionsPostParams, ...) (*ChatV1ChatCompletionsPostResponse, error)
- func (c *ClientWithResponses) CompletionsV1CompletionsPostWithBodyWithResponse(ctx context.Context, params *CompletionsV1CompletionsPostParams, ...) (*CompletionsV1CompletionsPostResponse, error)
- func (c *ClientWithResponses) CompletionsV1CompletionsPostWithResponse(ctx context.Context, params *CompletionsV1CompletionsPostParams, ...) (*CompletionsV1CompletionsPostResponse, error)
- func (c *ClientWithResponses) GetModelV1ModelsModelIdGetWithResponse(ctx context.Context, modelId string, params *GetModelV1ModelsModelIdGetParams, ...) (*GetModelV1ModelsModelIdGetResponse, error)
- func (c *ClientWithResponses) GetPublicModelPublicV1ModelsModelIdGetWithResponse(ctx context.Context, modelId string, ...) (*GetPublicModelPublicV1ModelsModelIdGetResponse, error)
- func (c *ClientWithResponses) ListModelsV1ModelsGetWithResponse(ctx context.Context, params *ListModelsV1ModelsGetParams, ...) (*ListModelsV1ModelsGetResponse, error)
- func (c *ClientWithResponses) ListPublicModelsEndpointPublicV1ModelsGetWithResponse(ctx context.Context, params *ListPublicModelsEndpointPublicV1ModelsGetParams, ...) (*ListPublicModelsEndpointPublicV1ModelsGetResponse, error)
- func (c *ClientWithResponses) TcpWarmingV1TcpWarmingGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TcpWarmingV1TcpWarmingGetResponse, error)
- type ClientWithResponsesInterface
- type CompletionChoice
- type CompletionChoiceFinishReason
- type CompletionLogProbs
- type CompletionRequest
- type CompletionRequestPrompt0
- type CompletionRequestPrompt1
- type CompletionRequestPrompt2
- type CompletionRequestPrompt3
- type CompletionRequestStop0
- type CompletionRequestStop1
- type CompletionRequest_Prompt
- func (t CompletionRequest_Prompt) AsCompletionRequestPrompt0() (CompletionRequestPrompt0, error)
- func (t CompletionRequest_Prompt) AsCompletionRequestPrompt1() (CompletionRequestPrompt1, error)
- func (t CompletionRequest_Prompt) AsCompletionRequestPrompt2() (CompletionRequestPrompt2, error)
- func (t CompletionRequest_Prompt) AsCompletionRequestPrompt3() (CompletionRequestPrompt3, error)
- func (t *CompletionRequest_Prompt) FromCompletionRequestPrompt0(v CompletionRequestPrompt0) error
- func (t *CompletionRequest_Prompt) FromCompletionRequestPrompt1(v CompletionRequestPrompt1) error
- func (t *CompletionRequest_Prompt) FromCompletionRequestPrompt2(v CompletionRequestPrompt2) error
- func (t *CompletionRequest_Prompt) FromCompletionRequestPrompt3(v CompletionRequestPrompt3) error
- func (t CompletionRequest_Prompt) MarshalJSON() ([]byte, error)
- func (t *CompletionRequest_Prompt) MergeCompletionRequestPrompt0(v CompletionRequestPrompt0) error
- func (t *CompletionRequest_Prompt) MergeCompletionRequestPrompt1(v CompletionRequestPrompt1) error
- func (t *CompletionRequest_Prompt) MergeCompletionRequestPrompt2(v CompletionRequestPrompt2) error
- func (t *CompletionRequest_Prompt) MergeCompletionRequestPrompt3(v CompletionRequestPrompt3) error
- func (t *CompletionRequest_Prompt) UnmarshalJSON(b []byte) error
- type CompletionRequest_Stop
- func (t CompletionRequest_Stop) AsCompletionRequestStop0() (CompletionRequestStop0, error)
- func (t CompletionRequest_Stop) AsCompletionRequestStop1() (CompletionRequestStop1, error)
- func (t *CompletionRequest_Stop) FromCompletionRequestStop0(v CompletionRequestStop0) error
- func (t *CompletionRequest_Stop) FromCompletionRequestStop1(v CompletionRequestStop1) error
- func (t CompletionRequest_Stop) MarshalJSON() ([]byte, error)
- func (t *CompletionRequest_Stop) MergeCompletionRequestStop0(v CompletionRequestStop0) error
- func (t *CompletionRequest_Stop) MergeCompletionRequestStop1(v CompletionRequestStop1) error
- func (t *CompletionRequest_Stop) UnmarshalJSON(b []byte) error
- type CompletionResponse
- type CompletionResponseObject
- type CompletionTokensDetails
- type CompletionsV1CompletionsPostJSONRequestBody
- type CompletionsV1CompletionsPostParams
- type CompletionsV1CompletionsPostResponse
- func (r CompletionsV1CompletionsPostResponse) ContentType() string
- func (r CompletionsV1CompletionsPostResponse) GetBody() []byte
- func (r CompletionsV1CompletionsPostResponse) GetJSON200() *CreateCompletionResponse
- func (r CompletionsV1CompletionsPostResponse) GetJSON422() *HTTPValidationError
- func (r CompletionsV1CompletionsPostResponse) Status() string
- func (r CompletionsV1CompletionsPostResponse) StatusCode() int
- type CreateChatCompletionResponse
- func (t CreateChatCompletionResponse) AsChatChunkResponse() (ChatChunkResponse, error)
- func (t CreateChatCompletionResponse) AsChatCompletionResponse() (ChatCompletionResponse, error)
- func (t CreateChatCompletionResponse) AsErrorChunkResponse() (ErrorChunkResponse, error)
- func (t *CreateChatCompletionResponse) FromChatChunkResponse(v ChatChunkResponse) error
- func (t *CreateChatCompletionResponse) FromChatCompletionResponse(v ChatCompletionResponse) error
- func (t *CreateChatCompletionResponse) FromErrorChunkResponse(v ErrorChunkResponse) error
- func (t CreateChatCompletionResponse) MarshalJSON() ([]byte, error)
- func (t *CreateChatCompletionResponse) MergeChatChunkResponse(v ChatChunkResponse) error
- func (t *CreateChatCompletionResponse) MergeChatCompletionResponse(v ChatCompletionResponse) error
- func (t *CreateChatCompletionResponse) MergeErrorChunkResponse(v ErrorChunkResponse) error
- func (t *CreateChatCompletionResponse) UnmarshalJSON(b []byte) error
- type CreateCompletionResponse
- func (t CreateCompletionResponse) AsCompletionResponse() (CompletionResponse, error)
- func (t CreateCompletionResponse) AsErrorChunkResponse() (ErrorChunkResponse, error)
- func (t *CreateCompletionResponse) FromCompletionResponse(v CompletionResponse) error
- func (t *CreateCompletionResponse) FromErrorChunkResponse(v ErrorChunkResponse) error
- func (t CreateCompletionResponse) MarshalJSON() ([]byte, error)
- func (t *CreateCompletionResponse) MergeCompletionResponse(v CompletionResponse) error
- func (t *CreateCompletionResponse) MergeErrorChunkResponse(v ErrorChunkResponse) error
- func (t *CreateCompletionResponse) UnmarshalJSON(b []byte) error
- type DatacenterLocation
- type DeveloperMessageRequest
- type DeveloperMessageRequestContent0
- type DeveloperMessageRequestContent1
- type DeveloperMessageRequestRole
- type DeveloperMessageRequest_Content
- func (t DeveloperMessageRequest_Content) AsDeveloperMessageRequestContent0() (DeveloperMessageRequestContent0, error)
- func (t DeveloperMessageRequest_Content) AsDeveloperMessageRequestContent1() (DeveloperMessageRequestContent1, error)
- func (t *DeveloperMessageRequest_Content) FromDeveloperMessageRequestContent0(v DeveloperMessageRequestContent0) error
- func (t *DeveloperMessageRequest_Content) FromDeveloperMessageRequestContent1(v DeveloperMessageRequestContent1) error
- func (t DeveloperMessageRequest_Content) MarshalJSON() ([]byte, error)
- func (t *DeveloperMessageRequest_Content) MergeDeveloperMessageRequestContent0(v DeveloperMessageRequestContent0) error
- func (t *DeveloperMessageRequest_Content) MergeDeveloperMessageRequestContent1(v DeveloperMessageRequestContent1) error
- func (t *DeveloperMessageRequest_Content) UnmarshalJSON(b []byte) error
- type DeveloperMessageRequest_Content_1_Item
- func (t DeveloperMessageRequest_Content_1_Item) AsImageContent() (ImageContent, error)
- func (t DeveloperMessageRequest_Content_1_Item) AsImageUrlContent() (ImageUrlContent, error)
- func (t DeveloperMessageRequest_Content_1_Item) AsTextContent() (TextContent, error)
- func (t DeveloperMessageRequest_Content_1_Item) Discriminator() (string, error)
- func (t *DeveloperMessageRequest_Content_1_Item) FromImageContent(v ImageContent) error
- func (t *DeveloperMessageRequest_Content_1_Item) FromImageUrlContent(v ImageUrlContent) error
- func (t *DeveloperMessageRequest_Content_1_Item) FromTextContent(v TextContent) error
- func (t DeveloperMessageRequest_Content_1_Item) MarshalJSON() ([]byte, error)
- func (t *DeveloperMessageRequest_Content_1_Item) MergeImageContent(v ImageContent) error
- func (t *DeveloperMessageRequest_Content_1_Item) MergeImageUrlContent(v ImageUrlContent) error
- func (t *DeveloperMessageRequest_Content_1_Item) MergeTextContent(v TextContent) error
- func (t *DeveloperMessageRequest_Content_1_Item) UnmarshalJSON(b []byte) error
- func (t DeveloperMessageRequest_Content_1_Item) ValueByDiscriminator() (interface{}, error)
- type ErrorChunkContent
- type ErrorChunkResponse
- type FunctionObject
- type GetModelV1ModelsModelIdGet200JSONResponseBody
- func (t GetModelV1ModelsModelIdGet200JSONResponseBody) AsHuggingFaceModel() (HuggingFaceModel, error)
- func (t GetModelV1ModelsModelIdGet200JSONResponseBody) AsModelMetadata() (ModelMetadata, error)
- func (t GetModelV1ModelsModelIdGet200JSONResponseBody) AsOpenRouterModel() (OpenRouterModel, error)
- func (t GetModelV1ModelsModelIdGet200JSONResponseBody) AsPublicModel() (PublicModel, error)
- func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) FromHuggingFaceModel(v HuggingFaceModel) error
- func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) FromModelMetadata(v ModelMetadata) error
- func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) FromOpenRouterModel(v OpenRouterModel) error
- func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) FromPublicModel(v PublicModel) error
- func (t GetModelV1ModelsModelIdGet200JSONResponseBody) MarshalJSON() ([]byte, error)
- func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) MergeHuggingFaceModel(v HuggingFaceModel) error
- func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) MergeModelMetadata(v ModelMetadata) error
- func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) MergeOpenRouterModel(v OpenRouterModel) error
- func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) MergePublicModel(v PublicModel) error
- func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) UnmarshalJSON(b []byte) error
- type GetModelV1ModelsModelIdGetParams
- type GetModelV1ModelsModelIdGetResponse
- func (r GetModelV1ModelsModelIdGetResponse) ContentType() string
- func (r GetModelV1ModelsModelIdGetResponse) GetBody() []byte
- func (r GetModelV1ModelsModelIdGetResponse) GetJSON200() *GetModelV1ModelsModelIdGet200JSONResponseBody
- func (r GetModelV1ModelsModelIdGetResponse) GetJSON422() *HTTPValidationError
- func (r GetModelV1ModelsModelIdGetResponse) Status() string
- func (r GetModelV1ModelsModelIdGetResponse) StatusCode() int
- type GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody
- func (t GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsHuggingFaceModel() (HuggingFaceModel, error)
- func (t GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsOpenRouterModel() (OpenRouterModel, error)
- func (t GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsPublicModel() (PublicModel, error)
- func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromHuggingFaceModel(v HuggingFaceModel) error
- func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromOpenRouterModel(v OpenRouterModel) error
- func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromPublicModel(v PublicModel) error
- func (t GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MarshalJSON() ([]byte, error)
- func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergeHuggingFaceModel(v HuggingFaceModel) error
- func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergeOpenRouterModel(v OpenRouterModel) error
- func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergePublicModel(v PublicModel) error
- func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) UnmarshalJSON(b []byte) error
- type GetPublicModelPublicV1ModelsModelIdGetParams
- type GetPublicModelPublicV1ModelsModelIdGetResponse
- func (r GetPublicModelPublicV1ModelsModelIdGetResponse) ContentType() string
- func (r GetPublicModelPublicV1ModelsModelIdGetResponse) GetBody() []byte
- func (r GetPublicModelPublicV1ModelsModelIdGetResponse) GetJSON200() *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody
- func (r GetPublicModelPublicV1ModelsModelIdGetResponse) GetJSON422() *HTTPValidationError
- func (r GetPublicModelPublicV1ModelsModelIdGetResponse) Status() string
- func (r GetPublicModelPublicV1ModelsModelIdGetResponse) StatusCode() int
- type HTTPValidationError
- type HttpRequestDoer
- type HuggingFaceCapabilities
- type HuggingFaceModel
- type HuggingFaceModelObject
- type HuggingFaceModelsResponse
- type HuggingFaceModelsResponseObject
- type HuggingFacePricing
- type ImageContent
- type ImageContentType
- type ImageUrl
- type ImageUrlContent
- type ImageUrlContentType
- type JSONSchema
- type ListModelsV1ModelsGet200JSONResponseBody
- func (t ListModelsV1ModelsGet200JSONResponseBody) AsHuggingFaceModelsResponse() (HuggingFaceModelsResponse, error)
- func (t ListModelsV1ModelsGet200JSONResponseBody) AsModelMetadataList() (ModelMetadataList, error)
- func (t ListModelsV1ModelsGet200JSONResponseBody) AsOpenRouterModelsResponse() (OpenRouterModelsResponse, error)
- func (t *ListModelsV1ModelsGet200JSONResponseBody) FromHuggingFaceModelsResponse(v HuggingFaceModelsResponse) error
- func (t *ListModelsV1ModelsGet200JSONResponseBody) FromModelMetadataList(v ModelMetadataList) error
- func (t *ListModelsV1ModelsGet200JSONResponseBody) FromOpenRouterModelsResponse(v OpenRouterModelsResponse) error
- func (t ListModelsV1ModelsGet200JSONResponseBody) MarshalJSON() ([]byte, error)
- func (t *ListModelsV1ModelsGet200JSONResponseBody) MergeHuggingFaceModelsResponse(v HuggingFaceModelsResponse) error
- func (t *ListModelsV1ModelsGet200JSONResponseBody) MergeModelMetadataList(v ModelMetadataList) error
- func (t *ListModelsV1ModelsGet200JSONResponseBody) MergeOpenRouterModelsResponse(v OpenRouterModelsResponse) error
- func (t *ListModelsV1ModelsGet200JSONResponseBody) UnmarshalJSON(b []byte) error
- type ListModelsV1ModelsGetParams
- type ListModelsV1ModelsGetResponse
- func (r ListModelsV1ModelsGetResponse) ContentType() string
- func (r ListModelsV1ModelsGetResponse) GetBody() []byte
- func (r ListModelsV1ModelsGetResponse) GetJSON200() *ListModelsV1ModelsGet200JSONResponseBody
- func (r ListModelsV1ModelsGetResponse) GetJSON422() *HTTPValidationError
- func (r ListModelsV1ModelsGetResponse) Status() string
- func (r ListModelsV1ModelsGetResponse) StatusCode() int
- type ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody
- func (t ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsHuggingFaceModelsResponse() (HuggingFaceModelsResponse, error)
- func (t ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsOpenRouterModelsResponse() (OpenRouterModelsResponse, error)
- func (t ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsPublicModelsListResponse() (PublicModelsListResponse, error)
- func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromHuggingFaceModelsResponse(v HuggingFaceModelsResponse) error
- func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromOpenRouterModelsResponse(v OpenRouterModelsResponse) error
- func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromPublicModelsListResponse(v PublicModelsListResponse) error
- func (t ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MarshalJSON() ([]byte, error)
- func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergeHuggingFaceModelsResponse(v HuggingFaceModelsResponse) error
- func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergeOpenRouterModelsResponse(v OpenRouterModelsResponse) error
- func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergePublicModelsListResponse(v PublicModelsListResponse) error
- func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) UnmarshalJSON(b []byte) error
- type ListPublicModelsEndpointPublicV1ModelsGetParams
- type ListPublicModelsEndpointPublicV1ModelsGetResponse
- func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) ContentType() string
- func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) GetBody() []byte
- func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) GetJSON200() *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody
- func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) GetJSON422() *HTTPValidationError
- func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) Status() string
- func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) StatusCode() int
- type LogProbsContent
- type ModelArchitecture
- type ModelArchitectureModality
- type ModelCapabilities
- type ModelFormat
- type ModelLimits
- type ModelMetadata
- type ModelMetadataList
- type ModelMetadataListObject
- type ModelMetadataObject
- type ModelPricing
- type OpenRouterInfo
- type OpenRouterModel
- type OpenRouterModelsResponse
- type OpenRouterPricing
- type Parameters
- type Prediction
- type PredictionContent0
- type PredictionContent1
- type PredictionType
- type Prediction_Content
- func (t Prediction_Content) AsPredictionContent0() (PredictionContent0, error)
- func (t Prediction_Content) AsPredictionContent1() (PredictionContent1, error)
- func (t *Prediction_Content) FromPredictionContent0(v PredictionContent0) error
- func (t *Prediction_Content) FromPredictionContent1(v PredictionContent1) error
- func (t Prediction_Content) MarshalJSON() ([]byte, error)
- func (t *Prediction_Content) MergePredictionContent0(v PredictionContent0) error
- func (t *Prediction_Content) MergePredictionContent1(v PredictionContent1) error
- func (t *Prediction_Content) UnmarshalJSON(b []byte) error
- type PromptTokensDetails
- type PublicModel
- type PublicModelObject
- type PublicModelsListResponse
- type PublicModelsListResponseObject
- type ReasoningEffort
- type ReasoningFormat
- type RequestEditorFn
- type ResponseFormatJSONObject
- type ResponseFormatJSONObjectType
- type ResponseFormatJSONSchema
- type ResponseFormatJSONSchemaType
- type ResponseFormatText
- type ResponseFormatTextType
- type ServiceTier
- type StreamOptions
- type SupportedParameters
- type SystemMessageRequest
- type SystemMessageRequestContent0
- type SystemMessageRequestContent1
- type SystemMessageRequestRole
- type SystemMessageRequest_Content
- func (t SystemMessageRequest_Content) AsSystemMessageRequestContent0() (SystemMessageRequestContent0, error)
- func (t SystemMessageRequest_Content) AsSystemMessageRequestContent1() (SystemMessageRequestContent1, error)
- func (t *SystemMessageRequest_Content) FromSystemMessageRequestContent0(v SystemMessageRequestContent0) error
- func (t *SystemMessageRequest_Content) FromSystemMessageRequestContent1(v SystemMessageRequestContent1) error
- func (t SystemMessageRequest_Content) MarshalJSON() ([]byte, error)
- func (t *SystemMessageRequest_Content) MergeSystemMessageRequestContent0(v SystemMessageRequestContent0) error
- func (t *SystemMessageRequest_Content) MergeSystemMessageRequestContent1(v SystemMessageRequestContent1) error
- func (t *SystemMessageRequest_Content) UnmarshalJSON(b []byte) error
- type SystemMessageRequest_Content_1_Item
- func (t SystemMessageRequest_Content_1_Item) AsImageContent() (ImageContent, error)
- func (t SystemMessageRequest_Content_1_Item) AsImageUrlContent() (ImageUrlContent, error)
- func (t SystemMessageRequest_Content_1_Item) AsTextContent() (TextContent, error)
- func (t SystemMessageRequest_Content_1_Item) Discriminator() (string, error)
- func (t *SystemMessageRequest_Content_1_Item) FromImageContent(v ImageContent) error
- func (t *SystemMessageRequest_Content_1_Item) FromImageUrlContent(v ImageUrlContent) error
- func (t *SystemMessageRequest_Content_1_Item) FromTextContent(v TextContent) error
- func (t SystemMessageRequest_Content_1_Item) MarshalJSON() ([]byte, error)
- func (t *SystemMessageRequest_Content_1_Item) MergeImageContent(v ImageContent) error
- func (t *SystemMessageRequest_Content_1_Item) MergeImageUrlContent(v ImageUrlContent) error
- func (t *SystemMessageRequest_Content_1_Item) MergeTextContent(v TextContent) error
- func (t *SystemMessageRequest_Content_1_Item) UnmarshalJSON(b []byte) error
- func (t SystemMessageRequest_Content_1_Item) ValueByDiscriminator() (interface{}, error)
- type TcpWarmingV1TcpWarmingGetResponse
- func (r TcpWarmingV1TcpWarmingGetResponse) ContentType() string
- func (r TcpWarmingV1TcpWarmingGetResponse) GetBody() []byte
- func (r TcpWarmingV1TcpWarmingGetResponse) GetJSON200() *interface{}
- func (r TcpWarmingV1TcpWarmingGetResponse) Status() string
- func (r TcpWarmingV1TcpWarmingGetResponse) StatusCode() int
- type TextContent
- type TextContentType
- type TimeInfo
- type Tool
- type ToolChoice
- type ToolMessageRequest
- type ToolMessageRequestContent0
- type ToolMessageRequestContent1
- type ToolMessageRequestRole
- type ToolMessageRequest_Content
- func (t ToolMessageRequest_Content) AsToolMessageRequestContent0() (ToolMessageRequestContent0, error)
- func (t ToolMessageRequest_Content) AsToolMessageRequestContent1() (ToolMessageRequestContent1, error)
- func (t *ToolMessageRequest_Content) FromToolMessageRequestContent0(v ToolMessageRequestContent0) error
- func (t *ToolMessageRequest_Content) FromToolMessageRequestContent1(v ToolMessageRequestContent1) error
- func (t ToolMessageRequest_Content) MarshalJSON() ([]byte, error)
- func (t *ToolMessageRequest_Content) MergeToolMessageRequestContent0(v ToolMessageRequestContent0) error
- func (t *ToolMessageRequest_Content) MergeToolMessageRequestContent1(v ToolMessageRequestContent1) error
- func (t *ToolMessageRequest_Content) UnmarshalJSON(b []byte) error
- type TopLogProbs
- type Usage
- type UserMessageRequest
- type UserMessageRequestContent0
- type UserMessageRequestContent1
- type UserMessageRequestRole
- type UserMessageRequest_Content
- func (t UserMessageRequest_Content) AsUserMessageRequestContent0() (UserMessageRequestContent0, error)
- func (t UserMessageRequest_Content) AsUserMessageRequestContent1() (UserMessageRequestContent1, error)
- func (t *UserMessageRequest_Content) FromUserMessageRequestContent0(v UserMessageRequestContent0) error
- func (t *UserMessageRequest_Content) FromUserMessageRequestContent1(v UserMessageRequestContent1) error
- func (t UserMessageRequest_Content) MarshalJSON() ([]byte, error)
- func (t *UserMessageRequest_Content) MergeUserMessageRequestContent0(v UserMessageRequestContent0) error
- func (t *UserMessageRequest_Content) MergeUserMessageRequestContent1(v UserMessageRequestContent1) error
- func (t *UserMessageRequest_Content) UnmarshalJSON(b []byte) error
- type UserMessageRequest_Content_1_Item
- func (t UserMessageRequest_Content_1_Item) AsImageContent() (ImageContent, error)
- func (t UserMessageRequest_Content_1_Item) AsImageUrlContent() (ImageUrlContent, error)
- func (t UserMessageRequest_Content_1_Item) AsTextContent() (TextContent, error)
- func (t UserMessageRequest_Content_1_Item) Discriminator() (string, error)
- func (t *UserMessageRequest_Content_1_Item) FromImageContent(v ImageContent) error
- func (t *UserMessageRequest_Content_1_Item) FromImageUrlContent(v ImageUrlContent) error
- func (t *UserMessageRequest_Content_1_Item) FromTextContent(v TextContent) error
- func (t UserMessageRequest_Content_1_Item) MarshalJSON() ([]byte, error)
- func (t *UserMessageRequest_Content_1_Item) MergeImageContent(v ImageContent) error
- func (t *UserMessageRequest_Content_1_Item) MergeImageUrlContent(v ImageUrlContent) error
- func (t *UserMessageRequest_Content_1_Item) MergeTextContent(v TextContent) error
- func (t *UserMessageRequest_Content_1_Item) UnmarshalJSON(b []byte) error
- func (t UserMessageRequest_Content_1_Item) ValueByDiscriminator() (interface{}, error)
- type ValidationError
- type ValidationErrorLoc0
- type ValidationErrorLoc1
- type ValidationError_Loc_Item
- func (t ValidationError_Loc_Item) AsValidationErrorLoc0() (ValidationErrorLoc0, error)
- func (t ValidationError_Loc_Item) AsValidationErrorLoc1() (ValidationErrorLoc1, error)
- func (t *ValidationError_Loc_Item) FromValidationErrorLoc0(v ValidationErrorLoc0) error
- func (t *ValidationError_Loc_Item) FromValidationErrorLoc1(v ValidationErrorLoc1) error
- func (t ValidationError_Loc_Item) MarshalJSON() ([]byte, error)
- func (t *ValidationError_Loc_Item) MergeValidationErrorLoc0(v ValidationErrorLoc0) error
- func (t *ValidationError_Loc_Item) MergeValidationErrorLoc1(v ValidationErrorLoc1) error
- func (t *ValidationError_Loc_Item) UnmarshalJSON(b []byte) error
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
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 ¶
func (e AssistantMessageRequestRole) Valid() bool
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 ¶
func (e ChatChunkChoiceFinishReason) Valid() bool
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 ¶
func (e ChatCompletionChoiceFinishReason) Valid() bool
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 ¶
func (t ChatCompletionRequest_ToolChoice) AsToolChoice() (ToolChoice, error)
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 ¶
func (e ChatCompletionResponseMessageRole) Valid() bool
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 ¶
func (e ChatCompletionResponseObject) Valid() bool
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 ¶
func (r ChatV1ChatCompletionsPostResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (ChatV1ChatCompletionsPostResponse) GetJSON200 ¶
func (r ChatV1ChatCompletionsPostResponse) GetJSON200() *CreateChatCompletionResponse
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (ChatV1ChatCompletionsPostResponse) GetJSON422 ¶
func (r ChatV1ChatCompletionsPostResponse) GetJSON422() *HTTPValidationError
GetJSON422 returns the response for an HTTP 422 `application/json` response
func (ChatV1ChatCompletionsPostResponse) Status ¶
func (r ChatV1ChatCompletionsPostResponse) Status() string
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 ¶
ClientOption allows setting custom parameters during construction
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 ¶
func (c *ClientWithResponses) ChatV1ChatCompletionsPostWithResponse(ctx context.Context, params *ChatV1ChatCompletionsPostParams, body ChatV1ChatCompletionsPostJSONRequestBody, 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).
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 ¶
func (c *ClientWithResponses) CompletionsV1CompletionsPostWithResponse(ctx context.Context, params *CompletionsV1CompletionsPostParams, body CompletionsV1CompletionsPostJSONRequestBody, 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).
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 ¶
func (e CompletionChoiceFinishReason) Valid() bool
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 ¶
func (r CompletionsV1CompletionsPostResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (CompletionsV1CompletionsPostResponse) GetBody ¶
func (r CompletionsV1CompletionsPostResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (CompletionsV1CompletionsPostResponse) GetJSON200 ¶
func (r CompletionsV1CompletionsPostResponse) GetJSON200() *CreateCompletionResponse
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (CompletionsV1CompletionsPostResponse) GetJSON422 ¶
func (r CompletionsV1CompletionsPostResponse) GetJSON422() *HTTPValidationError
GetJSON422 returns the response for an HTTP 422 `application/json` response
func (CompletionsV1CompletionsPostResponse) Status ¶
func (r CompletionsV1CompletionsPostResponse) Status() string
Status returns HTTPResponse.Status
func (CompletionsV1CompletionsPostResponse) StatusCode ¶
func (r CompletionsV1CompletionsPostResponse) StatusCode() int
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 ¶
func (e DeveloperMessageRequestRole) Valid() bool
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 ¶
func (t DeveloperMessageRequest_Content_1_Item) AsImageContent() (ImageContent, error)
AsImageContent returns the union data inside the DeveloperMessageRequest_Content_1_Item as a ImageContent
func (DeveloperMessageRequest_Content_1_Item) AsImageUrlContent ¶
func (t DeveloperMessageRequest_Content_1_Item) AsImageUrlContent() (ImageUrlContent, error)
AsImageUrlContent returns the union data inside the DeveloperMessageRequest_Content_1_Item as a ImageUrlContent
func (DeveloperMessageRequest_Content_1_Item) AsTextContent ¶
func (t DeveloperMessageRequest_Content_1_Item) AsTextContent() (TextContent, error)
AsTextContent returns the union data inside the DeveloperMessageRequest_Content_1_Item as a TextContent
func (DeveloperMessageRequest_Content_1_Item) Discriminator ¶
func (t DeveloperMessageRequest_Content_1_Item) Discriminator() (string, error)
func (*DeveloperMessageRequest_Content_1_Item) FromImageContent ¶
func (t *DeveloperMessageRequest_Content_1_Item) FromImageContent(v ImageContent) error
FromImageContent overwrites any union data inside the DeveloperMessageRequest_Content_1_Item as the provided ImageContent
func (*DeveloperMessageRequest_Content_1_Item) FromImageUrlContent ¶
func (t *DeveloperMessageRequest_Content_1_Item) FromImageUrlContent(v ImageUrlContent) error
FromImageUrlContent overwrites any union data inside the DeveloperMessageRequest_Content_1_Item as the provided ImageUrlContent
func (*DeveloperMessageRequest_Content_1_Item) FromTextContent ¶
func (t *DeveloperMessageRequest_Content_1_Item) FromTextContent(v TextContent) error
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 ¶
func (t *DeveloperMessageRequest_Content_1_Item) MergeImageContent(v ImageContent) error
MergeImageContent performs a merge with any union data inside the DeveloperMessageRequest_Content_1_Item, using the provided ImageContent
func (*DeveloperMessageRequest_Content_1_Item) MergeImageUrlContent ¶
func (t *DeveloperMessageRequest_Content_1_Item) MergeImageUrlContent(v ImageUrlContent) error
MergeImageUrlContent performs a merge with any union data inside the DeveloperMessageRequest_Content_1_Item, using the provided ImageUrlContent
func (*DeveloperMessageRequest_Content_1_Item) MergeTextContent ¶
func (t *DeveloperMessageRequest_Content_1_Item) MergeTextContent(v TextContent) error
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 ¶
func (t GetModelV1ModelsModelIdGet200JSONResponseBody) AsHuggingFaceModel() (HuggingFaceModel, error)
AsHuggingFaceModel returns the union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as a HuggingFaceModel
func (GetModelV1ModelsModelIdGet200JSONResponseBody) AsModelMetadata ¶
func (t GetModelV1ModelsModelIdGet200JSONResponseBody) AsModelMetadata() (ModelMetadata, error)
AsModelMetadata returns the union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as a ModelMetadata
func (GetModelV1ModelsModelIdGet200JSONResponseBody) AsOpenRouterModel ¶
func (t GetModelV1ModelsModelIdGet200JSONResponseBody) AsOpenRouterModel() (OpenRouterModel, error)
AsOpenRouterModel returns the union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as a OpenRouterModel
func (GetModelV1ModelsModelIdGet200JSONResponseBody) AsPublicModel ¶
func (t GetModelV1ModelsModelIdGet200JSONResponseBody) AsPublicModel() (PublicModel, error)
AsPublicModel returns the union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as a PublicModel
func (*GetModelV1ModelsModelIdGet200JSONResponseBody) FromHuggingFaceModel ¶
func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) FromHuggingFaceModel(v HuggingFaceModel) error
FromHuggingFaceModel overwrites any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as the provided HuggingFaceModel
func (*GetModelV1ModelsModelIdGet200JSONResponseBody) FromModelMetadata ¶
func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) FromModelMetadata(v ModelMetadata) error
FromModelMetadata overwrites any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as the provided ModelMetadata
func (*GetModelV1ModelsModelIdGet200JSONResponseBody) FromOpenRouterModel ¶
func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) FromOpenRouterModel(v OpenRouterModel) error
FromOpenRouterModel overwrites any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as the provided OpenRouterModel
func (*GetModelV1ModelsModelIdGet200JSONResponseBody) FromPublicModel ¶
func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) FromPublicModel(v PublicModel) error
FromPublicModel overwrites any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody as the provided PublicModel
func (GetModelV1ModelsModelIdGet200JSONResponseBody) MarshalJSON ¶
func (t GetModelV1ModelsModelIdGet200JSONResponseBody) MarshalJSON() ([]byte, error)
func (*GetModelV1ModelsModelIdGet200JSONResponseBody) MergeHuggingFaceModel ¶
func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) MergeHuggingFaceModel(v HuggingFaceModel) error
MergeHuggingFaceModel performs a merge with any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody, using the provided HuggingFaceModel
func (*GetModelV1ModelsModelIdGet200JSONResponseBody) MergeModelMetadata ¶
func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) MergeModelMetadata(v ModelMetadata) error
MergeModelMetadata performs a merge with any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody, using the provided ModelMetadata
func (*GetModelV1ModelsModelIdGet200JSONResponseBody) MergeOpenRouterModel ¶
func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) MergeOpenRouterModel(v OpenRouterModel) error
MergeOpenRouterModel performs a merge with any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody, using the provided OpenRouterModel
func (*GetModelV1ModelsModelIdGet200JSONResponseBody) MergePublicModel ¶
func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) MergePublicModel(v PublicModel) error
MergePublicModel performs a merge with any union data inside the GetModelV1ModelsModelIdGet200JSONResponseBody, using the provided PublicModel
func (*GetModelV1ModelsModelIdGet200JSONResponseBody) UnmarshalJSON ¶
func (t *GetModelV1ModelsModelIdGet200JSONResponseBody) UnmarshalJSON(b []byte) error
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 ¶
func (r GetModelV1ModelsModelIdGetResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetModelV1ModelsModelIdGetResponse) GetBody ¶
func (r GetModelV1ModelsModelIdGetResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetModelV1ModelsModelIdGetResponse) GetJSON200 ¶
func (r GetModelV1ModelsModelIdGetResponse) GetJSON200() *GetModelV1ModelsModelIdGet200JSONResponseBody
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetModelV1ModelsModelIdGetResponse) GetJSON422 ¶
func (r GetModelV1ModelsModelIdGetResponse) GetJSON422() *HTTPValidationError
GetJSON422 returns the response for an HTTP 422 `application/json` response
func (GetModelV1ModelsModelIdGetResponse) Status ¶
func (r GetModelV1ModelsModelIdGetResponse) Status() string
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 ¶
func (t GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsHuggingFaceModel() (HuggingFaceModel, error)
AsHuggingFaceModel returns the union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as a HuggingFaceModel
func (GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsOpenRouterModel ¶
func (t GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsOpenRouterModel() (OpenRouterModel, error)
AsOpenRouterModel returns the union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as a OpenRouterModel
func (GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsPublicModel ¶
func (t GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) AsPublicModel() (PublicModel, error)
AsPublicModel returns the union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as a PublicModel
func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromHuggingFaceModel ¶
func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromHuggingFaceModel(v HuggingFaceModel) error
FromHuggingFaceModel overwrites any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as the provided HuggingFaceModel
func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromOpenRouterModel ¶
func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromOpenRouterModel(v OpenRouterModel) error
FromOpenRouterModel overwrites any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as the provided OpenRouterModel
func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromPublicModel ¶
func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) FromPublicModel(v PublicModel) error
FromPublicModel overwrites any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody as the provided PublicModel
func (GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MarshalJSON ¶
func (t GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MarshalJSON() ([]byte, error)
func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergeHuggingFaceModel ¶
func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergeHuggingFaceModel(v HuggingFaceModel) error
MergeHuggingFaceModel performs a merge with any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody, using the provided HuggingFaceModel
func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergeOpenRouterModel ¶
func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergeOpenRouterModel(v OpenRouterModel) error
MergeOpenRouterModel performs a merge with any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody, using the provided OpenRouterModel
func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergePublicModel ¶
func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) MergePublicModel(v PublicModel) error
MergePublicModel performs a merge with any union data inside the GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody, using the provided PublicModel
func (*GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) UnmarshalJSON ¶
func (t *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody) UnmarshalJSON(b []byte) error
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 ¶
func (r GetPublicModelPublicV1ModelsModelIdGetResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetPublicModelPublicV1ModelsModelIdGetResponse) GetBody ¶
func (r GetPublicModelPublicV1ModelsModelIdGetResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetPublicModelPublicV1ModelsModelIdGetResponse) GetJSON200 ¶
func (r GetPublicModelPublicV1ModelsModelIdGetResponse) GetJSON200() *GetPublicModelPublicV1ModelsModelIdGet200JSONResponseBody
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetPublicModelPublicV1ModelsModelIdGetResponse) GetJSON422 ¶
func (r GetPublicModelPublicV1ModelsModelIdGetResponse) GetJSON422() *HTTPValidationError
GetJSON422 returns the response for an HTTP 422 `application/json` response
func (GetPublicModelPublicV1ModelsModelIdGetResponse) Status ¶
func (r GetPublicModelPublicV1ModelsModelIdGetResponse) Status() string
Status returns HTTPResponse.Status
func (GetPublicModelPublicV1ModelsModelIdGetResponse) StatusCode ¶
func (r GetPublicModelPublicV1ModelsModelIdGetResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type HTTPValidationError ¶
type HTTPValidationError struct {
Detail *[]ValidationError `json:"detail,omitempty"`
}
HTTPValidationError defines model for HTTPValidationError.
type HttpRequestDoer ¶
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 ¶
func (e HuggingFaceModelsResponseObject) Valid() bool
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 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 ¶
func (t ListModelsV1ModelsGet200JSONResponseBody) AsHuggingFaceModelsResponse() (HuggingFaceModelsResponse, error)
AsHuggingFaceModelsResponse returns the union data inside the ListModelsV1ModelsGet200JSONResponseBody as a HuggingFaceModelsResponse
func (ListModelsV1ModelsGet200JSONResponseBody) AsModelMetadataList ¶
func (t ListModelsV1ModelsGet200JSONResponseBody) AsModelMetadataList() (ModelMetadataList, error)
AsModelMetadataList returns the union data inside the ListModelsV1ModelsGet200JSONResponseBody as a ModelMetadataList
func (ListModelsV1ModelsGet200JSONResponseBody) AsOpenRouterModelsResponse ¶
func (t ListModelsV1ModelsGet200JSONResponseBody) AsOpenRouterModelsResponse() (OpenRouterModelsResponse, error)
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 ¶
func (t *ListModelsV1ModelsGet200JSONResponseBody) FromModelMetadataList(v ModelMetadataList) error
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 (t ListModelsV1ModelsGet200JSONResponseBody) MarshalJSON() ([]byte, error)
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 ¶
func (t *ListModelsV1ModelsGet200JSONResponseBody) MergeModelMetadataList(v ModelMetadataList) error
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 ¶
func (r ListModelsV1ModelsGetResponse) GetJSON200() *ListModelsV1ModelsGet200JSONResponseBody
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (ListModelsV1ModelsGetResponse) GetJSON422 ¶
func (r ListModelsV1ModelsGetResponse) GetJSON422() *HTTPValidationError
GetJSON422 returns the response for an HTTP 422 `application/json` response
func (ListModelsV1ModelsGetResponse) Status ¶
func (r ListModelsV1ModelsGetResponse) Status() string
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 ¶
func (t ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsHuggingFaceModelsResponse() (HuggingFaceModelsResponse, error)
AsHuggingFaceModelsResponse returns the union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as a HuggingFaceModelsResponse
func (ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsOpenRouterModelsResponse ¶
func (t ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsOpenRouterModelsResponse() (OpenRouterModelsResponse, error)
AsOpenRouterModelsResponse returns the union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as a OpenRouterModelsResponse
func (ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsPublicModelsListResponse ¶
func (t ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) AsPublicModelsListResponse() (PublicModelsListResponse, error)
AsPublicModelsListResponse returns the union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as a PublicModelsListResponse
func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromHuggingFaceModelsResponse ¶
func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromHuggingFaceModelsResponse(v HuggingFaceModelsResponse) error
FromHuggingFaceModelsResponse overwrites any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as the provided HuggingFaceModelsResponse
func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromOpenRouterModelsResponse ¶
func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromOpenRouterModelsResponse(v OpenRouterModelsResponse) error
FromOpenRouterModelsResponse overwrites any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as the provided OpenRouterModelsResponse
func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromPublicModelsListResponse ¶
func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) FromPublicModelsListResponse(v PublicModelsListResponse) error
FromPublicModelsListResponse overwrites any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody as the provided PublicModelsListResponse
func (ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MarshalJSON ¶
func (t ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MarshalJSON() ([]byte, error)
func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergeHuggingFaceModelsResponse ¶
func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergeHuggingFaceModelsResponse(v HuggingFaceModelsResponse) error
MergeHuggingFaceModelsResponse performs a merge with any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody, using the provided HuggingFaceModelsResponse
func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergeOpenRouterModelsResponse ¶
func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergeOpenRouterModelsResponse(v OpenRouterModelsResponse) error
MergeOpenRouterModelsResponse performs a merge with any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody, using the provided OpenRouterModelsResponse
func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergePublicModelsListResponse ¶
func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) MergePublicModelsListResponse(v PublicModelsListResponse) error
MergePublicModelsListResponse performs a merge with any union data inside the ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody, using the provided PublicModelsListResponse
func (*ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) UnmarshalJSON ¶
func (t *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody) UnmarshalJSON(b []byte) error
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 ¶
func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (ListPublicModelsEndpointPublicV1ModelsGetResponse) GetBody ¶
func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (ListPublicModelsEndpointPublicV1ModelsGetResponse) GetJSON200 ¶
func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) GetJSON200() *ListPublicModelsEndpointPublicV1ModelsGet200JSONResponseBody
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (ListPublicModelsEndpointPublicV1ModelsGetResponse) GetJSON422 ¶
func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) GetJSON422() *HTTPValidationError
GetJSON422 returns the response for an HTTP 422 `application/json` response
func (ListPublicModelsEndpointPublicV1ModelsGetResponse) Status ¶
func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) Status() string
Status returns HTTPResponse.Status
func (ListPublicModelsEndpointPublicV1ModelsGetResponse) StatusCode ¶
func (r ListPublicModelsEndpointPublicV1ModelsGetResponse) StatusCode() int
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 ¶
func (e PublicModelsListResponseObject) Valid() bool
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 ¶
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 ¶
func (e ResponseFormatJSONObjectType) Valid() bool
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 ¶
func (e ResponseFormatJSONSchemaType) Valid() bool
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 ¶
func (t SystemMessageRequest_Content_1_Item) AsImageContent() (ImageContent, error)
AsImageContent returns the union data inside the SystemMessageRequest_Content_1_Item as a ImageContent
func (SystemMessageRequest_Content_1_Item) AsImageUrlContent ¶
func (t SystemMessageRequest_Content_1_Item) AsImageUrlContent() (ImageUrlContent, error)
AsImageUrlContent returns the union data inside the SystemMessageRequest_Content_1_Item as a ImageUrlContent
func (SystemMessageRequest_Content_1_Item) AsTextContent ¶
func (t SystemMessageRequest_Content_1_Item) AsTextContent() (TextContent, error)
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 ¶
func (t *SystemMessageRequest_Content_1_Item) FromImageContent(v ImageContent) error
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 ¶
func (t *SystemMessageRequest_Content_1_Item) FromTextContent(v TextContent) error
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 ¶
func (r TcpWarmingV1TcpWarmingGetResponse) GetBody() []byte
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 ¶
func (r TcpWarmingV1TcpWarmingGetResponse) Status() string
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 ¶
func (t UserMessageRequest_Content_1_Item) AsImageContent() (ImageContent, error)
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 ¶
func (t UserMessageRequest_Content_1_Item) AsTextContent() (TextContent, error)
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