ai

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CertificateCADigicert = shared.CertificateCADigicert

This is an alias to an internal value.

View Source
const CertificateCAGoogle = shared.CertificateCAGoogle

This is an alias to an internal value.

View Source
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt

This is an alias to an internal value.

View Source
const CertificateCASSLCom = shared.CertificateCASSLCom

This is an alias to an internal value.

View Source
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeMagic = shared.CloudflareTunnelTunTypeMagic

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARP = shared.CloudflareTunnelTunTypeWARP

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

View Source
const MemberPoliciesAccessAllow = shared.MemberPoliciesAccessAllow

This is an alias to an internal value.

View Source
const MemberPoliciesAccessDeny = shared.MemberPoliciesAccessDeny

This is an alias to an internal value.

View Source
const MemberStatusAccepted = shared.MemberStatusAccepted

This is an alias to an internal value.

View Source
const MemberStatusPending = shared.MemberStatusPending

This is an alias to an internal value.

View Source
const RatePlanIDBusiness = shared.RatePlanIDBusiness

This is an alias to an internal value.

View Source
const RatePlanIDEnterprise = shared.RatePlanIDEnterprise

This is an alias to an internal value.

View Source
const RatePlanIDFree = shared.RatePlanIDFree

This is an alias to an internal value.

View Source
const RatePlanIDLite = shared.RatePlanIDLite

This is an alias to an internal value.

View Source
const RatePlanIDPartnersBusiness = shared.RatePlanIDPartnersBusiness

This is an alias to an internal value.

View Source
const RatePlanIDPartnersEnterprise = shared.RatePlanIDPartnersEnterprise

This is an alias to an internal value.

View Source
const RatePlanIDPartnersFree = shared.RatePlanIDPartnersFree

This is an alias to an internal value.

View Source
const RatePlanIDPartnersPro = shared.RatePlanIDPartnersPro

This is an alias to an internal value.

View Source
const RatePlanIDPro = shared.RatePlanIDPro

This is an alias to an internal value.

View Source
const RatePlanIDProPlus = shared.RatePlanIDProPlus

This is an alias to an internal value.

View Source
const SortDirectionAsc = shared.SortDirectionAsc

This is an alias to an internal value.

View Source
const SortDirectionDesc = shared.SortDirectionDesc

This is an alias to an internal value.

View Source
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly

This is an alias to an internal value.

View Source
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment

This is an alias to an internal value.

View Source
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled

This is an alias to an internal value.

View Source
const SubscriptionStateExpired = shared.SubscriptionStateExpired

This is an alias to an internal value.

View Source
const SubscriptionStateFailed = shared.SubscriptionStateFailed

This is an alias to an internal value.

View Source
const SubscriptionStatePaid = shared.SubscriptionStatePaid

This is an alias to an internal value.

View Source
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned

This is an alias to an internal value.

View Source
const SubscriptionStateTrial = shared.SubscriptionStateTrial

This is an alias to an internal value.

View Source
const TokenPolicyEffectAllow = shared.TokenPolicyEffectAllow

This is an alias to an internal value.

View Source
const TokenPolicyEffectDeny = shared.TokenPolicyEffectDeny

This is an alias to an internal value.

View Source
const TokenStatusActive = shared.TokenStatusActive

This is an alias to an internal value.

View Source
const TokenStatusDisabled = shared.TokenStatusDisabled

This is an alias to an internal value.

View Source
const TokenStatusExpired = shared.TokenStatusExpired

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type AIRunParams

type AIRunParams struct {
	AccountID param.Field[string]  `path:"account_id,required"`
	Body      AIRunParamsBodyUnion `json:"body"`
}

func (AIRunParams) MarshalJSON

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

type AIRunParamsBody

type AIRunParamsBody struct {
	Audio param.Field[interface{}] `json:"audio"`
	// Decreases the likelihood of the model repeating the same lines verbatim.
	FrequencyPenalty param.Field[float64]     `json:"frequency_penalty"`
	Functions        param.Field[interface{}] `json:"functions"`
	// Controls how closely the generated image should adhere to the prompt; higher
	// values make the image more aligned with the prompt
	Guidance param.Field[float64] `json:"guidance"`
	// The height of the generated image in pixels
	Height param.Field[int64] `json:"height"`
	// Whether to ignore the EOS token and continue generating tokens after the EOS
	// token is generated.
	IgnoreEos param.Field[bool]        `json:"ignore_eos"`
	Image     param.Field[interface{}] `json:"image"`
	// For use with img2img tasks. A base64-encoded string of the input image
	ImageB64 param.Field[string] `json:"image_b64"`
	// The text that you want the model to summarize
	InputText param.Field[string] `json:"input_text"`
	// The speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en'
	// if not specified
	Lang param.Field[string] `json:"lang"`
	// Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
	Lora param.Field[string]      `json:"lora"`
	Mask param.Field[interface{}] `json:"mask"`
	// The maximum length of the generated summary in tokens
	MaxLength param.Field[int64] `json:"max_length"`
	// The maximum number of tokens to generate in the response.
	MaxTokens param.Field[int64]       `json:"max_tokens"`
	Messages  param.Field[interface{}] `json:"messages"`
	// Text describing elements to avoid in the generated image
	NegativePrompt param.Field[string] `json:"negative_prompt"`
	// The number of diffusion steps; higher values can improve quality but take longer
	NumSteps param.Field[int64] `json:"num_steps"`
	// Increases the likelihood of the model introducing new topics.
	PresencePenalty param.Field[float64] `json:"presence_penalty"`
	// A text description of the image you want to generate
	Prompt param.Field[string] `json:"prompt"`
	// If true, a chat template is not applied and you must adhere to the specific
	// model's expected formatting.
	Raw param.Field[bool] `json:"raw"`
	// Penalty for repeated tokens; higher values discourage repetition.
	RepetitionPenalty param.Field[float64]     `json:"repetition_penalty"`
	ResponseFormat    param.Field[interface{}] `json:"response_format"`
	Seed              param.Field[interface{}] `json:"seed"`
	// The language of the recorded audio
	SourceLang param.Field[string] `json:"source_lang"`
	// If true, the response will be streamed back incrementally using SSE, Server Sent
	// Events.
	Stream param.Field[bool] `json:"stream"`
	// A value between 0 and 1 indicating how strongly to apply the transformation
	// during img2img tasks; lower values make the output closer to the input image
	Strength param.Field[float64] `json:"strength"`
	// The language to translate the transcription into. Currently only English is
	// supported.
	TargetLang param.Field[string] `json:"target_lang"`
	// Controls the randomness of the output; higher values produce more random
	// results.
	Temperature param.Field[float64]     `json:"temperature"`
	Text        param.Field[interface{}] `json:"text"`
	Tools       param.Field[interface{}] `json:"tools"`
	TopK        param.Field[interface{}] `json:"top_k"`
	// Adjusts the creativity of the AI's responses by controlling how many possible
	// words it considers. Lower values make outputs more predictable; higher values
	// allow for more varied and creative responses.
	TopP param.Field[float64] `json:"top_p"`
	// The width of the generated image in pixels
	Width param.Field[int64] `json:"width"`
}

func (AIRunParamsBody) MarshalJSON

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

type AIRunParamsBodyAutomaticSpeechRecognition

type AIRunParamsBodyAutomaticSpeechRecognition struct {
	// An array of integers that represent the audio data constrained to 8-bit unsigned
	// integer values
	Audio param.Field[[]float64] `json:"audio,required"`
	// The language of the recorded audio
	SourceLang param.Field[string] `json:"source_lang"`
	// The language to translate the transcription into. Currently only English is
	// supported.
	TargetLang param.Field[string] `json:"target_lang"`
}

func (AIRunParamsBodyAutomaticSpeechRecognition) MarshalJSON

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

type AIRunParamsBodyImageClassification

type AIRunParamsBodyImageClassification struct {
	// An array of integers that represent the image data constrained to 8-bit unsigned
	// integer values
	Image param.Field[[]float64] `json:"image,required"`
}

func (AIRunParamsBodyImageClassification) MarshalJSON

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

type AIRunParamsBodyImageTextToText added in v4.5.0

type AIRunParamsBodyImageTextToText struct {
	// Image in base64 encoded format.
	Image param.Field[string] `json:"image,required"`
	// An array of message objects representing the conversation history.
	Messages param.Field[[]AIRunParamsBodyImageTextToTextMessage] `json:"messages,required"`
	// Decreases the likelihood of the model repeating the same lines verbatim.
	FrequencyPenalty param.Field[float64] `json:"frequency_penalty"`
	// Whether to ignore the EOS token and continue generating tokens after the EOS
	// token is generated.
	IgnoreEos param.Field[bool] `json:"ignore_eos"`
	// The maximum number of tokens to generate in the response.
	MaxTokens param.Field[int64] `json:"max_tokens"`
	// Increases the likelihood of the model introducing new topics.
	PresencePenalty param.Field[float64] `json:"presence_penalty"`
	// Penalty for repeated tokens; higher values discourage repetition.
	RepetitionPenalty param.Field[float64] `json:"repetition_penalty"`
	// Random seed for reproducibility of the generation.
	Seed param.Field[float64] `json:"seed"`
	// Controls the randomness of the output; higher values produce more random
	// results.
	Temperature param.Field[float64] `json:"temperature"`
	// Limits the AI to choose from the top 'k' most probable words. Lower values make
	// responses more focused; higher values introduce more variety and potential
	// surprises.
	TopK param.Field[float64] `json:"top_k"`
	// Controls the creativity of the AI's responses by adjusting how many possible
	// words it considers. Lower values make outputs more predictable; higher values
	// allow for more varied and creative responses.
	TopP param.Field[float64] `json:"top_p"`
}

func (AIRunParamsBodyImageTextToText) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyImageTextToTextMessage added in v4.5.0

type AIRunParamsBodyImageTextToTextMessage struct {
	// The content of the message as a string.
	Content param.Field[string] `json:"content,required"`
	// The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
	Role param.Field[string] `json:"role,required"`
}

func (AIRunParamsBodyImageTextToTextMessage) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyImageToText

type AIRunParamsBodyImageToText struct {
	// An array of integers that represent the image data constrained to 8-bit unsigned
	// integer values
	Image param.Field[[]float64] `json:"image,required"`
	// Decreases the likelihood of the model repeating the same lines verbatim.
	FrequencyPenalty param.Field[float64] `json:"frequency_penalty"`
	// The maximum number of tokens to generate in the response.
	MaxTokens param.Field[int64] `json:"max_tokens"`
	// Increases the likelihood of the model introducing new topics.
	PresencePenalty param.Field[float64] `json:"presence_penalty"`
	// The input text prompt for the model to generate a response.
	Prompt param.Field[string] `json:"prompt"`
	// If true, a chat template is not applied and you must adhere to the specific
	// model's expected formatting.
	Raw param.Field[bool] `json:"raw"`
	// Penalty for repeated tokens; higher values discourage repetition.
	RepetitionPenalty param.Field[float64] `json:"repetition_penalty"`
	// Random seed for reproducibility of the generation.
	Seed param.Field[float64] `json:"seed"`
	// Controls the randomness of the output; higher values produce more random
	// results.
	Temperature param.Field[float64] `json:"temperature"`
	// Limits the AI to choose from the top 'k' most probable words. Lower values make
	// responses more focused; higher values introduce more variety and potential
	// surprises.
	TopK param.Field[float64] `json:"top_k"`
	// Controls the creativity of the AI's responses by adjusting how many possible
	// words it considers. Lower values make outputs more predictable; higher values
	// allow for more varied and creative responses.
	TopP param.Field[float64] `json:"top_p"`
}

func (AIRunParamsBodyImageToText) MarshalJSON

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

type AIRunParamsBodyObject added in v4.3.0

type AIRunParamsBodyObject struct {
	// Image in base64 encoded format.
	Image param.Field[string] `json:"image,required"`
	// The input text prompt for the model to generate a response.
	Prompt param.Field[string] `json:"prompt,required"`
	// Decreases the likelihood of the model repeating the same lines verbatim.
	FrequencyPenalty param.Field[float64] `json:"frequency_penalty"`
	// Whether to ignore the EOS token and continue generating tokens after the EOS
	// token is generated.
	IgnoreEos param.Field[bool] `json:"ignore_eos"`
	// The maximum number of tokens to generate in the response.
	MaxTokens param.Field[int64] `json:"max_tokens"`
	// Increases the likelihood of the model introducing new topics.
	PresencePenalty param.Field[float64] `json:"presence_penalty"`
	// Penalty for repeated tokens; higher values discourage repetition.
	RepetitionPenalty param.Field[float64] `json:"repetition_penalty"`
	// Random seed for reproducibility of the generation.
	Seed param.Field[float64] `json:"seed"`
	// Controls the randomness of the output; higher values produce more random
	// results.
	Temperature param.Field[float64] `json:"temperature"`
	// Limits the AI to choose from the top 'k' most probable words. Lower values make
	// responses more focused; higher values introduce more variety and potential
	// surprises.
	TopK param.Field[float64] `json:"top_k"`
	// Controls the creativity of the AI's responses by adjusting how many possible
	// words it considers. Lower values make outputs more predictable; higher values
	// allow for more varied and creative responses.
	TopP param.Field[float64] `json:"top_p"`
}

func (AIRunParamsBodyObject) MarshalJSON added in v4.3.0

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

type AIRunParamsBodyObjectDetection

type AIRunParamsBodyObjectDetection struct {
	// An array of integers that represent the image data constrained to 8-bit unsigned
	// integer values
	Image param.Field[[]float64] `json:"image"`
}

func (AIRunParamsBodyObjectDetection) MarshalJSON

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

type AIRunParamsBodyPrompt

type AIRunParamsBodyPrompt struct {
	// The input text prompt for the model to generate a response.
	Prompt param.Field[string] `json:"prompt,required"`
	// Decreases the likelihood of the model repeating the same lines verbatim.
	FrequencyPenalty param.Field[float64] `json:"frequency_penalty"`
	// Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base model.
	Lora param.Field[string] `json:"lora"`
	// The maximum number of tokens to generate in the response.
	MaxTokens param.Field[int64] `json:"max_tokens"`
	// Increases the likelihood of the model introducing new topics.
	PresencePenalty param.Field[float64] `json:"presence_penalty"`
	// If true, a chat template is not applied and you must adhere to the specific
	// model's expected formatting.
	Raw param.Field[bool] `json:"raw"`
	// Penalty for repeated tokens; higher values discourage repetition.
	RepetitionPenalty param.Field[float64]                             `json:"repetition_penalty"`
	ResponseFormat    param.Field[AIRunParamsBodyPromptResponseFormat] `json:"response_format"`
	// Random seed for reproducibility of the generation.
	Seed param.Field[int64] `json:"seed"`
	// If true, the response will be streamed back incrementally using SSE, Server Sent
	// Events.
	Stream param.Field[bool] `json:"stream"`
	// Controls the randomness of the output; higher values produce more random
	// results.
	Temperature param.Field[float64] `json:"temperature"`
	// Limits the AI to choose from the top 'k' most probable words. Lower values make
	// responses more focused; higher values introduce more variety and potential
	// surprises.
	TopK param.Field[int64] `json:"top_k"`
	// Adjusts the creativity of the AI's responses by controlling how many possible
	// words it considers. Lower values make outputs more predictable; higher values
	// allow for more varied and creative responses.
	TopP param.Field[float64] `json:"top_p"`
}

func (AIRunParamsBodyPrompt) MarshalJSON

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

type AIRunParamsBodyPromptResponseFormat added in v4.2.0

type AIRunParamsBodyPromptResponseFormat struct {
	JsonSchema param.Field[interface{}]                             `json:"json_schema"`
	Type       param.Field[AIRunParamsBodyPromptResponseFormatType] `json:"type"`
}

func (AIRunParamsBodyPromptResponseFormat) MarshalJSON added in v4.2.0

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

type AIRunParamsBodyPromptResponseFormatType added in v4.2.0

type AIRunParamsBodyPromptResponseFormatType string
const (
	AIRunParamsBodyPromptResponseFormatTypeJsonObject AIRunParamsBodyPromptResponseFormatType = "json_object"
	AIRunParamsBodyPromptResponseFormatTypeJsonSchema AIRunParamsBodyPromptResponseFormatType = "json_schema"
)

func (AIRunParamsBodyPromptResponseFormatType) IsKnown added in v4.2.0

type AIRunParamsBodySummarization

type AIRunParamsBodySummarization struct {
	// The text that you want the model to summarize
	InputText param.Field[string] `json:"input_text,required"`
	// The maximum length of the generated summary in tokens
	MaxLength param.Field[int64] `json:"max_length"`
}

func (AIRunParamsBodySummarization) MarshalJSON

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

type AIRunParamsBodyTextClassification

type AIRunParamsBodyTextClassification struct {
	// The text that you want to classify
	Text param.Field[string] `json:"text,required"`
}

func (AIRunParamsBodyTextClassification) MarshalJSON

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

type AIRunParamsBodyTextEmbeddings

type AIRunParamsBodyTextEmbeddings struct {
	// The text to embed
	Text param.Field[AIRunParamsBodyTextEmbeddingsTextUnion] `json:"text,required"`
}

func (AIRunParamsBodyTextEmbeddings) MarshalJSON

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

type AIRunParamsBodyTextEmbeddingsTextArray

type AIRunParamsBodyTextEmbeddingsTextArray []string

func (AIRunParamsBodyTextEmbeddingsTextArray) ImplementsAIRunParamsBodyTextEmbeddingsTextUnion added in v4.1.0

func (r AIRunParamsBodyTextEmbeddingsTextArray) ImplementsAIRunParamsBodyTextEmbeddingsTextUnion()

type AIRunParamsBodyTextEmbeddingsTextUnion

type AIRunParamsBodyTextEmbeddingsTextUnion interface {
	ImplementsAIRunParamsBodyTextEmbeddingsTextUnion()
}

The text to embed

Satisfied by shared.UnionString, ai.AIRunParamsBodyTextEmbeddingsTextArray.

type AIRunParamsBodyTextGeneration added in v4.5.0

type AIRunParamsBodyTextGeneration struct {
	// An array of message objects representing the conversation history.
	Messages param.Field[[]AIRunParamsBodyTextGenerationMessage] `json:"messages,required"`
	// Decreases the likelihood of the model repeating the same lines verbatim.
	FrequencyPenalty param.Field[float64]                                 `json:"frequency_penalty"`
	Functions        param.Field[[]AIRunParamsBodyTextGenerationFunction] `json:"functions"`
	// The maximum number of tokens to generate in the response.
	MaxTokens param.Field[int64] `json:"max_tokens"`
	// Increases the likelihood of the model introducing new topics.
	PresencePenalty param.Field[float64] `json:"presence_penalty"`
	// If true, a chat template is not applied and you must adhere to the specific
	// model's expected formatting.
	Raw param.Field[bool] `json:"raw"`
	// Penalty for repeated tokens; higher values discourage repetition.
	RepetitionPenalty param.Field[float64]                                     `json:"repetition_penalty"`
	ResponseFormat    param.Field[AIRunParamsBodyTextGenerationResponseFormat] `json:"response_format"`
	// Random seed for reproducibility of the generation.
	Seed param.Field[int64] `json:"seed"`
	// If true, the response will be streamed back incrementally using SSE, Server Sent
	// Events.
	Stream param.Field[bool] `json:"stream"`
	// Controls the randomness of the output; higher values produce more random
	// results.
	Temperature param.Field[float64] `json:"temperature"`
	// A list of tools available for the assistant to use.
	Tools param.Field[[]AIRunParamsBodyTextGenerationToolUnion] `json:"tools"`
	// Limits the AI to choose from the top 'k' most probable words. Lower values make
	// responses more focused; higher values introduce more variety and potential
	// surprises.
	TopK param.Field[int64] `json:"top_k"`
	// Adjusts the creativity of the AI's responses by controlling how many possible
	// words it considers. Lower values make outputs more predictable; higher values
	// allow for more varied and creative responses.
	TopP param.Field[float64] `json:"top_p"`
}

func (AIRunParamsBodyTextGeneration) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyTextGenerationFunction added in v4.5.0

type AIRunParamsBodyTextGenerationFunction struct {
	Code param.Field[string] `json:"code,required"`
	Name param.Field[string] `json:"name,required"`
}

func (AIRunParamsBodyTextGenerationFunction) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyTextGenerationMessage added in v4.5.0

type AIRunParamsBodyTextGenerationMessage struct {
	// The content of the message as a string.
	Content param.Field[string] `json:"content,required"`
	// The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
	Role param.Field[string] `json:"role,required"`
}

func (AIRunParamsBodyTextGenerationMessage) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyTextGenerationResponseFormat added in v4.5.0

type AIRunParamsBodyTextGenerationResponseFormat struct {
	JsonSchema param.Field[interface{}]                                     `json:"json_schema"`
	Type       param.Field[AIRunParamsBodyTextGenerationResponseFormatType] `json:"type"`
}

func (AIRunParamsBodyTextGenerationResponseFormat) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyTextGenerationResponseFormatType added in v4.5.0

type AIRunParamsBodyTextGenerationResponseFormatType string
const (
	AIRunParamsBodyTextGenerationResponseFormatTypeJsonObject AIRunParamsBodyTextGenerationResponseFormatType = "json_object"
	AIRunParamsBodyTextGenerationResponseFormatTypeJsonSchema AIRunParamsBodyTextGenerationResponseFormatType = "json_schema"
)

func (AIRunParamsBodyTextGenerationResponseFormatType) IsKnown added in v4.5.0

type AIRunParamsBodyTextGenerationTool added in v4.5.0

type AIRunParamsBodyTextGenerationTool struct {
	// A brief description of what the tool does.
	Description param.Field[string]      `json:"description"`
	Function    param.Field[interface{}] `json:"function"`
	// The name of the tool. More descriptive the better.
	Name       param.Field[string]      `json:"name"`
	Parameters param.Field[interface{}] `json:"parameters"`
	// Specifies the type of tool (e.g., 'function').
	Type param.Field[string] `json:"type"`
}

func (AIRunParamsBodyTextGenerationTool) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyTextGenerationToolUnion added in v4.5.0

type AIRunParamsBodyTextGenerationToolUnion interface {
	// contains filtered or unexported methods
}

Satisfied by ai.AIRunParamsBodyTextGenerationToolsObject, ai.AIRunParamsBodyTextGenerationToolsFunction, AIRunParamsBodyTextGenerationTool.

type AIRunParamsBodyTextGenerationToolsFunction added in v4.5.0

type AIRunParamsBodyTextGenerationToolsFunction struct {
	// Details of the function tool.
	Function param.Field[AIRunParamsBodyTextGenerationToolsFunctionFunction] `json:"function,required"`
	// Specifies the type of tool (e.g., 'function').
	Type param.Field[string] `json:"type,required"`
}

func (AIRunParamsBodyTextGenerationToolsFunction) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyTextGenerationToolsFunctionFunction added in v4.5.0

type AIRunParamsBodyTextGenerationToolsFunctionFunction struct {
	// A brief description of what the function does.
	Description param.Field[string] `json:"description,required"`
	// The name of the function.
	Name param.Field[string] `json:"name,required"`
	// Schema defining the parameters accepted by the function.
	Parameters param.Field[AIRunParamsBodyTextGenerationToolsFunctionFunctionParameters] `json:"parameters,required"`
}

Details of the function tool.

func (AIRunParamsBodyTextGenerationToolsFunctionFunction) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyTextGenerationToolsFunctionFunctionParameters added in v4.5.0

type AIRunParamsBodyTextGenerationToolsFunctionFunctionParameters struct {
	// Definitions of each parameter.
	Properties param.Field[map[string]AIRunParamsBodyTextGenerationToolsFunctionFunctionParametersProperties] `json:"properties,required"`
	// The type of the parameters object (usually 'object').
	Type param.Field[string] `json:"type,required"`
	// List of required parameter names.
	Required param.Field[[]string] `json:"required"`
}

Schema defining the parameters accepted by the function.

func (AIRunParamsBodyTextGenerationToolsFunctionFunctionParameters) MarshalJSON added in v4.5.0

type AIRunParamsBodyTextGenerationToolsFunctionFunctionParametersProperties added in v4.5.0

type AIRunParamsBodyTextGenerationToolsFunctionFunctionParametersProperties struct {
	// A description of the expected parameter.
	Description param.Field[string] `json:"description,required"`
	// The data type of the parameter.
	Type param.Field[string] `json:"type,required"`
}

func (AIRunParamsBodyTextGenerationToolsFunctionFunctionParametersProperties) MarshalJSON added in v4.5.0

type AIRunParamsBodyTextGenerationToolsObject added in v4.5.0

type AIRunParamsBodyTextGenerationToolsObject struct {
	// A brief description of what the tool does.
	Description param.Field[string] `json:"description,required"`
	// The name of the tool. More descriptive the better.
	Name param.Field[string] `json:"name,required"`
	// Schema defining the parameters accepted by the tool.
	Parameters param.Field[AIRunParamsBodyTextGenerationToolsObjectParameters] `json:"parameters,required"`
}

func (AIRunParamsBodyTextGenerationToolsObject) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyTextGenerationToolsObjectParameters added in v4.5.0

type AIRunParamsBodyTextGenerationToolsObjectParameters struct {
	// Definitions of each parameter.
	Properties param.Field[map[string]AIRunParamsBodyTextGenerationToolsObjectParametersProperties] `json:"properties,required"`
	// The type of the parameters object (usually 'object').
	Type param.Field[string] `json:"type,required"`
	// List of required parameter names.
	Required param.Field[[]string] `json:"required"`
}

Schema defining the parameters accepted by the tool.

func (AIRunParamsBodyTextGenerationToolsObjectParameters) MarshalJSON added in v4.5.0

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

type AIRunParamsBodyTextGenerationToolsObjectParametersProperties added in v4.5.0

type AIRunParamsBodyTextGenerationToolsObjectParametersProperties struct {
	// A description of the expected parameter.
	Description param.Field[string] `json:"description,required"`
	// The data type of the parameter.
	Type param.Field[string] `json:"type,required"`
}

func (AIRunParamsBodyTextGenerationToolsObjectParametersProperties) MarshalJSON added in v4.5.0

type AIRunParamsBodyTextToImage

type AIRunParamsBodyTextToImage struct {
	// A text description of the image you want to generate
	Prompt param.Field[string] `json:"prompt,required"`
	// Controls how closely the generated image should adhere to the prompt; higher
	// values make the image more aligned with the prompt
	Guidance param.Field[float64] `json:"guidance"`
	// The height of the generated image in pixels
	Height param.Field[int64] `json:"height"`
	// For use with img2img tasks. An array of integers that represent the image data
	// constrained to 8-bit unsigned integer values
	Image param.Field[[]float64] `json:"image"`
	// For use with img2img tasks. A base64-encoded string of the input image
	ImageB64 param.Field[string] `json:"image_b64"`
	// An array representing An array of integers that represent mask image data for
	// inpainting constrained to 8-bit unsigned integer values
	Mask param.Field[[]float64] `json:"mask"`
	// Text describing elements to avoid in the generated image
	NegativePrompt param.Field[string] `json:"negative_prompt"`
	// The number of diffusion steps; higher values can improve quality but take longer
	NumSteps param.Field[int64] `json:"num_steps"`
	// Random seed for reproducibility of the image generation
	Seed param.Field[int64] `json:"seed"`
	// A value between 0 and 1 indicating how strongly to apply the transformation
	// during img2img tasks; lower values make the output closer to the input image
	Strength param.Field[float64] `json:"strength"`
	// The width of the generated image in pixels
	Width param.Field[int64] `json:"width"`
}

func (AIRunParamsBodyTextToImage) MarshalJSON

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

type AIRunParamsBodyTextToSpeech

type AIRunParamsBodyTextToSpeech struct {
	// A text description of the audio you want to generate
	Prompt param.Field[string] `json:"prompt,required"`
	// The speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en'
	// if not specified
	Lang param.Field[string] `json:"lang"`
}

func (AIRunParamsBodyTextToSpeech) MarshalJSON

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

type AIRunParamsBodyTranslation

type AIRunParamsBodyTranslation struct {
	// The language code to translate the text into (e.g., 'es' for Spanish)
	TargetLang param.Field[string] `json:"target_lang,required"`
	// The text to be translated
	Text param.Field[string] `json:"text,required"`
	// The language code of the source text (e.g., 'en' for English). Defaults to 'en'
	// if not specified
	SourceLang param.Field[string] `json:"source_lang"`
}

func (AIRunParamsBodyTranslation) MarshalJSON

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

type AIRunResponseAudio

type AIRunResponseAudio struct {
	// The generated audio in MP3 format, base64-encoded
	Audio string                 `json:"audio"`
	JSON  aiRunResponseAudioJSON `json:"-"`
}

func (AIRunResponseAudio) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseAudio) ImplementsAIRunResponseUnion()

func (*AIRunResponseAudio) UnmarshalJSON

func (r *AIRunResponseAudio) UnmarshalJSON(data []byte) (err error)

type AIRunResponseAutomaticSpeechRecognition

type AIRunResponseAutomaticSpeechRecognition struct {
	// The transcription
	Text      string                                        `json:"text,required"`
	Vtt       string                                        `json:"vtt"`
	WordCount float64                                       `json:"word_count"`
	Words     []AIRunResponseAutomaticSpeechRecognitionWord `json:"words"`
	JSON      aiRunResponseAutomaticSpeechRecognitionJSON   `json:"-"`
}

func (AIRunResponseAutomaticSpeechRecognition) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseAutomaticSpeechRecognition) ImplementsAIRunResponseUnion()

func (*AIRunResponseAutomaticSpeechRecognition) UnmarshalJSON

func (r *AIRunResponseAutomaticSpeechRecognition) UnmarshalJSON(data []byte) (err error)

type AIRunResponseAutomaticSpeechRecognitionWord

type AIRunResponseAutomaticSpeechRecognitionWord struct {
	// The ending second when the word completes
	End float64 `json:"end"`
	// The second this word begins in the recording
	Start float64                                         `json:"start"`
	Word  string                                          `json:"word"`
	JSON  aiRunResponseAutomaticSpeechRecognitionWordJSON `json:"-"`
}

func (*AIRunResponseAutomaticSpeechRecognitionWord) UnmarshalJSON

func (r *AIRunResponseAutomaticSpeechRecognitionWord) UnmarshalJSON(data []byte) (err error)

type AIRunResponseEnvelope

type AIRunResponseEnvelope struct {
	// An array of classification results for the input text
	Result AIRunResponseUnion        `json:"result" format:"binary"`
	JSON   aiRunResponseEnvelopeJSON `json:"-"`
}

func (*AIRunResponseEnvelope) UnmarshalJSON

func (r *AIRunResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type AIRunResponseImageClassification

type AIRunResponseImageClassification []AIRunResponseImageClassificationItem

func (AIRunResponseImageClassification) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseImageClassification) ImplementsAIRunResponseUnion()

type AIRunResponseImageClassificationItem

type AIRunResponseImageClassificationItem struct {
	// The predicted category or class for the input image based on analysis
	Label string `json:"label"`
	// A confidence value, between 0 and 1, indicating how certain the model is about
	// the predicted label
	Score float64                                  `json:"score"`
	JSON  aiRunResponseImageClassificationItemJSON `json:"-"`
}

func (*AIRunResponseImageClassificationItem) UnmarshalJSON

func (r *AIRunResponseImageClassificationItem) UnmarshalJSON(data []byte) (err error)

type AIRunResponseImageTextToText added in v4.3.0

type AIRunResponseImageTextToText struct {
	Description string                           `json:"description"`
	JSON        aiRunResponseImageTextToTextJSON `json:"-"`
}

func (AIRunResponseImageTextToText) ImplementsAIRunResponseUnion added in v4.3.0

func (r AIRunResponseImageTextToText) ImplementsAIRunResponseUnion()

func (*AIRunResponseImageTextToText) UnmarshalJSON added in v4.3.0

func (r *AIRunResponseImageTextToText) UnmarshalJSON(data []byte) (err error)

type AIRunResponseImageToText

type AIRunResponseImageToText struct {
	Description string                       `json:"description"`
	JSON        aiRunResponseImageToTextJSON `json:"-"`
}

func (AIRunResponseImageToText) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseImageToText) ImplementsAIRunResponseUnion()

func (*AIRunResponseImageToText) UnmarshalJSON

func (r *AIRunResponseImageToText) UnmarshalJSON(data []byte) (err error)

type AIRunResponseObject

type AIRunResponseObject struct {
	// The generated text response from the model
	Response string `json:"response,required"`
	// An array of tool calls requests made during the response generation
	ToolCalls []AIRunResponseObjectToolCall `json:"tool_calls"`
	// Usage statistics for the inference request
	Usage AIRunResponseObjectUsage `json:"usage"`
	JSON  aiRunResponseObjectJSON  `json:"-"`
}

func (AIRunResponseObject) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseObject) ImplementsAIRunResponseUnion()

func (*AIRunResponseObject) UnmarshalJSON

func (r *AIRunResponseObject) UnmarshalJSON(data []byte) (err error)

type AIRunResponseObjectDetection

type AIRunResponseObjectDetection []AIRunResponseObjectDetectionItem

func (AIRunResponseObjectDetection) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseObjectDetection) ImplementsAIRunResponseUnion()

type AIRunResponseObjectDetectionBox

type AIRunResponseObjectDetectionBox struct {
	// The x-coordinate of the bottom-right corner of the bounding box
	Xmax float64 `json:"xmax"`
	// The x-coordinate of the top-left corner of the bounding box
	Xmin float64 `json:"xmin"`
	// The y-coordinate of the bottom-right corner of the bounding box
	Ymax float64 `json:"ymax"`
	// The y-coordinate of the top-left corner of the bounding box
	Ymin float64                             `json:"ymin"`
	JSON aiRunResponseObjectDetectionBoxJSON `json:"-"`
}

Coordinates defining the bounding box around the detected object

func (*AIRunResponseObjectDetectionBox) UnmarshalJSON

func (r *AIRunResponseObjectDetectionBox) UnmarshalJSON(data []byte) (err error)

type AIRunResponseObjectDetectionItem

type AIRunResponseObjectDetectionItem struct {
	// Coordinates defining the bounding box around the detected object
	Box AIRunResponseObjectDetectionBox `json:"box"`
	// The class label or name of the detected object
	Label string `json:"label"`
	// Confidence score indicating the likelihood that the detection is correct
	Score float64                              `json:"score"`
	JSON  aiRunResponseObjectDetectionItemJSON `json:"-"`
}

func (*AIRunResponseObjectDetectionItem) UnmarshalJSON

func (r *AIRunResponseObjectDetectionItem) UnmarshalJSON(data []byte) (err error)

type AIRunResponseObjectToolCall

type AIRunResponseObjectToolCall struct {
	// The arguments passed to be passed to the tool call request
	Arguments interface{} `json:"arguments"`
	// The name of the tool to be called
	Name string                          `json:"name"`
	JSON aiRunResponseObjectToolCallJSON `json:"-"`
}

func (*AIRunResponseObjectToolCall) UnmarshalJSON

func (r *AIRunResponseObjectToolCall) UnmarshalJSON(data []byte) (err error)

type AIRunResponseObjectUsage added in v4.1.0

type AIRunResponseObjectUsage struct {
	// Total number of tokens in output
	CompletionTokens float64 `json:"completion_tokens"`
	// Total number of tokens in input
	PromptTokens float64 `json:"prompt_tokens"`
	// Total number of input and output tokens
	TotalTokens float64                      `json:"total_tokens"`
	JSON        aiRunResponseObjectUsageJSON `json:"-"`
}

Usage statistics for the inference request

func (*AIRunResponseObjectUsage) UnmarshalJSON added in v4.1.0

func (r *AIRunResponseObjectUsage) UnmarshalJSON(data []byte) (err error)

type AIRunResponseSummarization

type AIRunResponseSummarization struct {
	// The summarized version of the input text
	Summary string                         `json:"summary"`
	JSON    aiRunResponseSummarizationJSON `json:"-"`
}

func (AIRunResponseSummarization) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseSummarization) ImplementsAIRunResponseUnion()

func (*AIRunResponseSummarization) UnmarshalJSON

func (r *AIRunResponseSummarization) UnmarshalJSON(data []byte) (err error)

type AIRunResponseTextClassification

type AIRunResponseTextClassification []AIRunResponseTextClassificationItem

func (AIRunResponseTextClassification) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseTextClassification) ImplementsAIRunResponseUnion()

type AIRunResponseTextClassificationItem

type AIRunResponseTextClassificationItem struct {
	// The classification label assigned to the text (e.g., 'POSITIVE' or 'NEGATIVE')
	Label string `json:"label"`
	// Confidence score indicating the likelihood that the text belongs to the
	// specified label
	Score float64                                 `json:"score"`
	JSON  aiRunResponseTextClassificationItemJSON `json:"-"`
}

func (*AIRunResponseTextClassificationItem) UnmarshalJSON

func (r *AIRunResponseTextClassificationItem) UnmarshalJSON(data []byte) (err error)

type AIRunResponseTextEmbeddings

type AIRunResponseTextEmbeddings struct {
	// Embeddings of the requested text values
	Data  [][]float64                     `json:"data"`
	Shape []float64                       `json:"shape"`
	JSON  aiRunResponseTextEmbeddingsJSON `json:"-"`
}

func (AIRunResponseTextEmbeddings) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseTextEmbeddings) ImplementsAIRunResponseUnion()

func (*AIRunResponseTextEmbeddings) UnmarshalJSON

func (r *AIRunResponseTextEmbeddings) UnmarshalJSON(data []byte) (err error)

type AIRunResponseTranslation

type AIRunResponseTranslation struct {
	// The translated text in the target language
	TranslatedText string                       `json:"translated_text"`
	JSON           aiRunResponseTranslationJSON `json:"-"`
}

func (AIRunResponseTranslation) ImplementsAIRunResponseUnion added in v4.1.0

func (r AIRunResponseTranslation) ImplementsAIRunResponseUnion()

func (*AIRunResponseTranslation) UnmarshalJSON

func (r *AIRunResponseTranslation) UnmarshalJSON(data []byte) (err error)

type AIService

type AIService struct {
	Options   []option.RequestOption
	Finetunes *FinetuneService
	Authors   *AuthorService
	Tasks     *TaskService
	Models    *ModelService
}

AIService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAIService method instead.

func NewAIService

func NewAIService(opts ...option.RequestOption) (r *AIService)

NewAIService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AIService) Run

func (r *AIService) Run(ctx context.Context, modelName string, params AIRunParams, opts ...option.RequestOption) (res *AIRunResponseUnion, err error)

This endpoint provides users with the capability to run specific AI models on-demand.

By submitting the required input data, users can receive real-time predictions or results generated by the chosen AI model. The endpoint supports various AI model types, ensuring flexibility and adaptability for diverse use cases.

Model specific inputs available in [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).

type ASN

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

type AuditLogAction

type AuditLogAction = shared.AuditLogAction

This is an alias to an internal type.

type AuditLogActor

type AuditLogActor = shared.AuditLogActor

This is an alias to an internal type.

type AuditLogActorType

type AuditLogActorType = shared.AuditLogActorType

The type of actor, whether a User, Cloudflare Admin, or an Automated System.

This is an alias to an internal type.

type AuditLogOwner

type AuditLogOwner = shared.AuditLogOwner

This is an alias to an internal type.

type AuditLogResource

type AuditLogResource = shared.AuditLogResource

This is an alias to an internal type.

type AuthorListParams

type AuthorListParams struct {
	AccountID param.Field[string] `path:"account_id,required"`
}

type AuthorListResponse

type AuthorListResponse = interface{}

type AuthorService

type AuthorService struct {
	Options []option.RequestOption
}

AuthorService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAuthorService method instead.

func NewAuthorService

func NewAuthorService(opts ...option.RequestOption) (r *AuthorService)

NewAuthorService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AuthorService) List

Author Search

func (*AuthorService) ListAutoPaging

Author Search

type CertificateCA

type CertificateCA = shared.CertificateCA

The Certificate Authority that will issue the certificate

This is an alias to an internal type.

type CertificateRequestType

type CertificateRequestType = shared.CertificateRequestType

Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).

This is an alias to an internal type.

type CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

A Cloudflare Tunnel that connects your origin to Cloudflare's edge.

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelStatus

type CloudflareTunnelStatus = shared.CloudflareTunnelStatus

The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type Error

type Error = apierror.Error

type ErrorData

type ErrorData = shared.ErrorData

This is an alias to an internal type.

type ErrorDataSource added in v4.2.0

type ErrorDataSource = shared.ErrorDataSource

This is an alias to an internal type.

type FinetuneAssetNewParams

type FinetuneAssetNewParams struct {
	AccountID param.Field[string]    `path:"account_id,required"`
	File      param.Field[io.Reader] `json:"file" format:"binary"`
	FileName  param.Field[string]    `json:"file_name"`
}

func (FinetuneAssetNewParams) MarshalMultipart

func (r FinetuneAssetNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type FinetuneAssetNewResponse

type FinetuneAssetNewResponse struct {
	ID         string                       `json:"id,required" format:"uuid"`
	BucketName string                       `json:"bucket_name,required"`
	CreatedAt  time.Time                    `json:"created_at,required" format:"date-time"`
	FileName   string                       `json:"file_name,required"`
	FinetuneID string                       `json:"finetune_id,required"`
	ModifiedAt time.Time                    `json:"modified_at,required" format:"date-time"`
	JSON       finetuneAssetNewResponseJSON `json:"-"`
}

func (*FinetuneAssetNewResponse) UnmarshalJSON

func (r *FinetuneAssetNewResponse) UnmarshalJSON(data []byte) (err error)

type FinetuneAssetNewResponseEnvelope

type FinetuneAssetNewResponseEnvelope struct {
	Result  FinetuneAssetNewResponse             `json:"result,required"`
	Success bool                                 `json:"success,required"`
	JSON    finetuneAssetNewResponseEnvelopeJSON `json:"-"`
}

func (*FinetuneAssetNewResponseEnvelope) UnmarshalJSON

func (r *FinetuneAssetNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type FinetuneAssetService

type FinetuneAssetService struct {
	Options []option.RequestOption
}

FinetuneAssetService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFinetuneAssetService method instead.

func NewFinetuneAssetService

func NewFinetuneAssetService(opts ...option.RequestOption) (r *FinetuneAssetService)

NewFinetuneAssetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FinetuneAssetService) New

Upload a Finetune Asset

type FinetuneListParams

type FinetuneListParams struct {
	AccountID param.Field[string] `path:"account_id,required"`
}

type FinetuneListResponse

type FinetuneListResponse struct {
	ID          string                   `json:"id,required" format:"uuid"`
	CreatedAt   time.Time                `json:"created_at,required" format:"date-time"`
	Model       string                   `json:"model,required"`
	ModifiedAt  time.Time                `json:"modified_at,required" format:"date-time"`
	Name        string                   `json:"name,required"`
	Description string                   `json:"description"`
	JSON        finetuneListResponseJSON `json:"-"`
}

func (*FinetuneListResponse) UnmarshalJSON

func (r *FinetuneListResponse) UnmarshalJSON(data []byte) (err error)

type FinetuneListResponseEnvelope

type FinetuneListResponseEnvelope struct {
	Result  FinetuneListResponse             `json:"result,required"`
	Success bool                             `json:"success,required"`
	JSON    finetuneListResponseEnvelopeJSON `json:"-"`
}

func (*FinetuneListResponseEnvelope) UnmarshalJSON

func (r *FinetuneListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type FinetuneNewParams

type FinetuneNewParams struct {
	AccountID   param.Field[string] `path:"account_id,required"`
	Model       param.Field[string] `json:"model,required"`
	Name        param.Field[string] `json:"name,required"`
	Description param.Field[string] `json:"description"`
	Public      param.Field[bool]   `json:"public"`
}

func (FinetuneNewParams) MarshalJSON

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

type FinetuneNewResponse

type FinetuneNewResponse struct {
	ID          string                  `json:"id,required" format:"uuid"`
	CreatedAt   time.Time               `json:"created_at,required" format:"date-time"`
	Model       string                  `json:"model,required"`
	ModifiedAt  time.Time               `json:"modified_at,required" format:"date-time"`
	Name        string                  `json:"name,required"`
	Public      bool                    `json:"public,required"`
	Description string                  `json:"description"`
	JSON        finetuneNewResponseJSON `json:"-"`
}

func (*FinetuneNewResponse) UnmarshalJSON

func (r *FinetuneNewResponse) UnmarshalJSON(data []byte) (err error)

type FinetuneNewResponseEnvelope

type FinetuneNewResponseEnvelope struct {
	Result  FinetuneNewResponse             `json:"result,required"`
	Success bool                            `json:"success,required"`
	JSON    finetuneNewResponseEnvelopeJSON `json:"-"`
}

func (*FinetuneNewResponseEnvelope) UnmarshalJSON

func (r *FinetuneNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type FinetunePublicListParams

type FinetunePublicListParams struct {
	AccountID param.Field[string] `path:"account_id,required"`
	// Pagination Limit
	Limit param.Field[float64] `query:"limit"`
	// Pagination Offset
	Offset param.Field[float64] `query:"offset"`
	// Order By Column Name
	OrderBy param.Field[string] `query:"orderBy"`
}

func (FinetunePublicListParams) URLQuery

func (r FinetunePublicListParams) URLQuery() (v url.Values)

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

type FinetunePublicListResponse

type FinetunePublicListResponse struct {
	ID          string                         `json:"id,required" format:"uuid"`
	CreatedAt   time.Time                      `json:"created_at,required" format:"date-time"`
	Model       string                         `json:"model,required"`
	ModifiedAt  time.Time                      `json:"modified_at,required" format:"date-time"`
	Name        string                         `json:"name,required"`
	Public      bool                           `json:"public,required"`
	Description string                         `json:"description"`
	JSON        finetunePublicListResponseJSON `json:"-"`
}

func (*FinetunePublicListResponse) UnmarshalJSON

func (r *FinetunePublicListResponse) UnmarshalJSON(data []byte) (err error)

type FinetunePublicService

type FinetunePublicService struct {
	Options []option.RequestOption
}

FinetunePublicService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFinetunePublicService method instead.

func NewFinetunePublicService

func NewFinetunePublicService(opts ...option.RequestOption) (r *FinetunePublicService)

NewFinetunePublicService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FinetunePublicService) List

List Public Finetunes

func (*FinetunePublicService) ListAutoPaging

List Public Finetunes

type FinetuneService

type FinetuneService struct {
	Options []option.RequestOption
	Assets  *FinetuneAssetService
	Public  *FinetunePublicService
}

FinetuneService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFinetuneService method instead.

func NewFinetuneService

func NewFinetuneService(opts ...option.RequestOption) (r *FinetuneService)

NewFinetuneService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FinetuneService) List

List Finetunes

func (*FinetuneService) New

Create a new Finetune

type Member

type Member = shared.Member

This is an alias to an internal type.

type MemberPoliciesAccess

type MemberPoliciesAccess = shared.MemberPoliciesAccess

Allow or deny operations against the resources.

This is an alias to an internal type.

type MemberPoliciesPermissionGroup

type MemberPoliciesPermissionGroup = shared.MemberPoliciesPermissionGroup

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type MemberPoliciesPermissionGroupsMeta

type MemberPoliciesPermissionGroupsMeta = shared.MemberPoliciesPermissionGroupsMeta

Attributes associated to the permission group.

This is an alias to an internal type.

type MemberPoliciesResourceGroup

type MemberPoliciesResourceGroup = shared.MemberPoliciesResourceGroup

A group of scoped resources.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsMeta

type MemberPoliciesResourceGroupsMeta = shared.MemberPoliciesResourceGroupsMeta

Attributes associated to the resource group.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsScope

type MemberPoliciesResourceGroupsScope = shared.MemberPoliciesResourceGroupsScope

A scope is a combination of scope objects which provides additional context.

This is an alias to an internal type.

type MemberPoliciesResourceGroupsScopeObject

type MemberPoliciesResourceGroupsScopeObject = shared.MemberPoliciesResourceGroupsScopeObject

A scope object represents any resource that can have actions applied against invite.

This is an alias to an internal type.

type MemberPolicy

type MemberPolicy = shared.MemberPolicy

This is an alias to an internal type.

type MemberStatus

type MemberStatus = shared.MemberStatus

A member's status in the account.

This is an alias to an internal type.

type MemberUser

type MemberUser = shared.MemberUser

Details of the user associated to the membership.

This is an alias to an internal type.

type ModelListParams

type ModelListParams struct {
	AccountID param.Field[string] `path:"account_id,required"`
	// Filter by Author
	Author param.Field[string] `query:"author"`
	// Filter to hide experimental models
	HideExperimental param.Field[bool]  `query:"hide_experimental"`
	Page             param.Field[int64] `query:"page"`
	PerPage          param.Field[int64] `query:"per_page"`
	// Search
	Search param.Field[string] `query:"search"`
	// Filter by Source Id
	Source param.Field[float64] `query:"source"`
	// Filter by Task Name
	Task param.Field[string] `query:"task"`
}

func (ModelListParams) URLQuery

func (r ModelListParams) URLQuery() (v url.Values)

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

type ModelListResponse

type ModelListResponse = interface{}

type ModelSchemaGetParams

type ModelSchemaGetParams struct {
	AccountID param.Field[string] `path:"account_id,required"`
	// Model Name
	Model param.Field[string] `query:"model,required"`
}

func (ModelSchemaGetParams) URLQuery

func (r ModelSchemaGetParams) URLQuery() (v url.Values)

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

type ModelSchemaGetResponse

type ModelSchemaGetResponse = interface{}

type ModelSchemaGetResponseEnvelope

type ModelSchemaGetResponseEnvelope struct {
	Result  ModelSchemaGetResponse             `json:"result,required"`
	Success bool                               `json:"success,required"`
	JSON    modelSchemaGetResponseEnvelopeJSON `json:"-"`
}

func (*ModelSchemaGetResponseEnvelope) UnmarshalJSON

func (r *ModelSchemaGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type ModelSchemaService

type ModelSchemaService struct {
	Options []option.RequestOption
}

ModelSchemaService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelSchemaService method instead.

func NewModelSchemaService

func NewModelSchemaService(opts ...option.RequestOption) (r *ModelSchemaService)

NewModelSchemaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ModelSchemaService) Get

Get Model Schema

type ModelService

type ModelService struct {
	Options []option.RequestOption
	Schema  *ModelSchemaService
}

ModelService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewModelService method instead.

func NewModelService

func NewModelService(opts ...option.RequestOption) (r *ModelService)

NewModelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ModelService) List

Model Search

func (*ModelService) ListAutoPaging

Model Search

type Permission

type Permission = shared.Permission

This is an alias to an internal type.

type PermissionGrant

type PermissionGrant = shared.PermissionGrant

This is an alias to an internal type.

type PermissionGrantParam

type PermissionGrantParam = shared.PermissionGrantParam

This is an alias to an internal type.

type RatePlan

type RatePlan = shared.RatePlan

The rate plan applied to the subscription.

This is an alias to an internal type.

type RatePlanID added in v4.1.0

type RatePlanID = shared.RatePlanID

The ID of the rate plan.

This is an alias to an internal type.

type RatePlanParam

type RatePlanParam = shared.RatePlanParam

The rate plan applied to the subscription.

This is an alias to an internal type.

type ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type ResponseInfoSource added in v4.3.0

type ResponseInfoSource = shared.ResponseInfoSource

This is an alias to an internal type.

type Role

type Role = shared.Role

This is an alias to an internal type.

type RoleParam

type RoleParam = shared.RoleParam

This is an alias to an internal type.

type RolePermissions

type RolePermissions = shared.RolePermissions

This is an alias to an internal type.

type RolePermissionsParam

type RolePermissionsParam = shared.RolePermissionsParam

This is an alias to an internal type.

type SortDirection

type SortDirection = shared.SortDirection

Direction to order DNS records in.

This is an alias to an internal type.

type Subscription

type Subscription = shared.Subscription

This is an alias to an internal type.

type SubscriptionFrequency

type SubscriptionFrequency = shared.SubscriptionFrequency

How often the subscription is renewed automatically.

This is an alias to an internal type.

type SubscriptionParam

type SubscriptionParam = shared.SubscriptionParam

This is an alias to an internal type.

type SubscriptionState

type SubscriptionState = shared.SubscriptionState

The state that the subscription is in.

This is an alias to an internal type.

type TaskListParams

type TaskListParams struct {
	AccountID param.Field[string] `path:"account_id,required"`
}

type TaskListResponse

type TaskListResponse = interface{}

type TaskService

type TaskService struct {
	Options []option.RequestOption
}

TaskService contains methods and other services that help with interacting with the cloudflare API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTaskService method instead.

func NewTaskService

func NewTaskService(opts ...option.RequestOption) (r *TaskService)

NewTaskService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TaskService) List

Task Search

func (*TaskService) ListAutoPaging

Task Search

type Token

type Token = shared.Token

This is an alias to an internal type.

type TokenCondition

type TokenCondition = shared.TokenCondition

This is an alias to an internal type.

type TokenConditionCIDRList

type TokenConditionCIDRList = shared.TokenConditionCIDRList

IPv4/IPv6 CIDR.

This is an alias to an internal type.

type TokenConditionCIDRListParam

type TokenConditionCIDRListParam = shared.TokenConditionCIDRListParam

IPv4/IPv6 CIDR.

This is an alias to an internal type.

type TokenConditionParam

type TokenConditionParam = shared.TokenConditionParam

This is an alias to an internal type.

type TokenConditionRequestIP

type TokenConditionRequestIP = shared.TokenConditionRequestIP

Client IP restrictions.

This is an alias to an internal type.

type TokenConditionRequestIPParam

type TokenConditionRequestIPParam = shared.TokenConditionRequestIPParam

Client IP restrictions.

This is an alias to an internal type.

type TokenParam

type TokenParam = shared.TokenParam

This is an alias to an internal type.

type TokenPolicy

type TokenPolicy = shared.TokenPolicy

This is an alias to an internal type.

type TokenPolicyEffect

type TokenPolicyEffect = shared.TokenPolicyEffect

Allow or deny operations against the resources.

This is an alias to an internal type.

type TokenPolicyParam

type TokenPolicyParam = shared.TokenPolicyParam

This is an alias to an internal type.

type TokenPolicyPermissionGroup

type TokenPolicyPermissionGroup = shared.TokenPolicyPermissionGroup

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type TokenPolicyPermissionGroupParam

type TokenPolicyPermissionGroupParam = shared.TokenPolicyPermissionGroupParam

A named group of permissions that map to a group of operations against resources.

This is an alias to an internal type.

type TokenPolicyPermissionGroupsMeta

type TokenPolicyPermissionGroupsMeta = shared.TokenPolicyPermissionGroupsMeta

Attributes associated to the permission group.

This is an alias to an internal type.

type TokenPolicyPermissionGroupsMetaParam

type TokenPolicyPermissionGroupsMetaParam = shared.TokenPolicyPermissionGroupsMetaParam

Attributes associated to the permission group.

This is an alias to an internal type.

type TokenPolicyResourcesMap added in v4.6.0

type TokenPolicyResourcesMap = shared.TokenPolicyResourcesMap

A nested permission grant for further scoping.

This is an alias to an internal type.

type TokenPolicyResourcesMapParam added in v4.6.0

type TokenPolicyResourcesMapParam = shared.TokenPolicyResourcesMapParam

A nested permission grant for further scoping.

This is an alias to an internal type.

type TokenPolicyResourcesUnion added in v4.6.0

type TokenPolicyResourcesUnion = shared.TokenPolicyResourcesUnion

A simple wildcard permission, e.g., "\*".

This is an alias to an internal type.

type TokenPolicyResourcesUnionParam added in v4.6.0

type TokenPolicyResourcesUnionParam = shared.TokenPolicyResourcesUnionParam

A simple wildcard permission, e.g., "\*".

This is an alias to an internal type.

type TokenStatus

type TokenStatus = shared.TokenStatus

Status of the token.

This is an alias to an internal type.

type TokenValue

type TokenValue = shared.TokenValue

The token value.

This is an alias to an internal type.

Jump to

Keyboard shortcuts

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