common

package
v0.8.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

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

Documentation

Index

Constants

View Source
const (
	MetadataDisplayName            = "display_name" // legacy fallback
	MetadataConsoleDisplayName     = "aibrix.console.display_name"
	MetadataConsoleCreatedBy       = "aibrix.console.created_by"
	MetadataConsoleTemplateName    = "aibrix.console.template_name"
	MetadataConsoleTemplateVersion = "aibrix.console.template_version"
	MetadataConsoleProviderConfig  = "aibrix.console.provider_config"
	BatchExtraBodyField            = "extra_body"
	AIBrixExtraBodyField           = "aibrix"
	JsonNullLiteral                = "null"
)

Console-owned fields we stash on the OpenAI batch.metadata map. Namespaced to keep them out of user-supplied metadata's key space. The bare "display_name" key is kept for backwards compatibility with batches created by older console builds.

Variables

This section is empty.

Functions

func IncludeDeploymentFromCtx added in v0.8.0

func IncludeDeploymentFromCtx(ctx context.Context) bool

IncludeDeploymentFromCtx returns whether deployment detail should be fetched.

func InjectExtraBodyToBatch

func InjectExtraBodyToBatch(batch *openai.Batch, extraBody json.RawMessage) *openai.Batch

InjectExtraBodyToBatch injects AIBrixExtraBody into the batch's raw JSON. The extraBody parameter is the raw AIBrixExtraBody JSON, which will be wrapped under extra_body.aibrix in the batch. Uses fast path (direct byte manipulation) when possible, falls back to map-based approach.

func ParseBatchExtraBody

func ParseBatchExtraBody(b *openai.Batch) map[string]json.RawMessage

func WithIncludeDeployment added in v0.8.0

func WithIncludeDeployment(ctx context.Context, val bool) context.Context

WithIncludeDeployment attaches the include_deployment flag to the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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