Documentation
¶
Index ¶
- Variables
- func EffortFrom(s string) wire.Effort
- func FinishReasonFrom(stop string) string
- func OpaqueFrom(blocks []wire.Block) []json.RawMessage
- type ChatChunk
- type ChatMessage
- type ChatRequest
- type ChatResponse
- type Choice
- type ChunkChoice
- type ContentPart
- type Delta
- type ErrorBody
- type ErrorResponse
- type FilePart
- type FunctionCall
- type FunctionDef
- type ImageURLPart
- type MemcodeExt
- type MessageContent
- type ModelEntry
- type ModelList
- type ModelMeta
- type ModelsExt
- type PromptTokensDetails
- type ResponseMessage
- type RoleEntry
- type StreamOptions
- type Tool
- type ToolCall
- type ToolCallDelta
- type Turn
- type Usage
Constants ¶
This section is empty.
Variables ¶
var ( StringContent = compat.StringContent PartsContent = compat.PartsContent TextPart = compat.TextPart )
Constructors re-exported for the translation layer + tests.
Functions ¶
func EffortFrom ¶
EffortFrom maps the standard reasoning_effort vocabulary onto the abstract Effort. Unknown values degrade to off rather than erroring (reasoning controls are an OPTIONAL capability, never a request-killer).
func FinishReasonFrom ¶
FinishReasonFrom maps internal stop reasons onto the standard vocabulary.
func OpaqueFrom ¶
func OpaqueFrom(blocks []wire.Block) []json.RawMessage
OpaqueFrom extracts the response's reasoning blocks as the memcode_opaque array (each element the block's wire JSON, re-expandable verbatim).
Types ¶
type ChatMessage ¶
type ChatMessage = compat.ChatMessage
type ChatRequest ¶
type ChatRequest = compat.ChatRequest
type ChatResponse ¶
type ChatResponse = compat.ChatResponse
func ResponseFrom ¶
func ResponseFrom(resp wire.Response, id string, created int64) ChatResponse
ResponseFrom renders a (sanitized) internal response as a chat completion.
type ChunkChoice ¶
type ChunkChoice = compat.ChunkChoice
type ContentPart ¶
type ContentPart = compat.ContentPart
type ErrorResponse ¶
type ErrorResponse = compat.ErrorResponse
func ErrorFrom ¶
func ErrorFrom(msg, typ, code string) ErrorResponse
ErrorFrom wraps a message in the standard {"error":{message,type,code}} envelope — the one shape both the HTTP error writer and the mid-stream error event emit.
type FunctionCall ¶
type FunctionCall = compat.FunctionCall
type FunctionDef ¶
type FunctionDef = compat.FunctionDef
type ImageURLPart ¶
type ImageURLPart = compat.ImageURLPart
type MemcodeExt ¶
type MemcodeExt = compat.MemcodeExt
func ExtFrom ¶
func ExtFrom(resp wire.Response) *MemcodeExt
ExtFrom builds the memcode extension object from a (sanitized) response.
type MessageContent ¶
type MessageContent = compat.MessageContent
type ModelEntry ¶
type ModelEntry = compat.ModelEntry
func ModelEntryFrom ¶
func ModelEntryFrom(label string, meta ModelMeta) ModelEntry
ModelEntryFrom wraps one catalog label + its selection facts in the standard model-list entry shape.
type ModelList ¶
func ModelListFrom ¶
func ModelListFrom(entries []ModelEntry, ext *ModelsExt) ModelList
ModelListFrom wraps entries + the list-level extension in the standard list shape. Data is never null on the wire (clients range over it).
type PromptTokensDetails ¶
type PromptTokensDetails = compat.PromptTokensDetails
type ResponseMessage ¶
type ResponseMessage = compat.ResponseMessage
type StreamOptions ¶
type StreamOptions = compat.StreamOptions
type ToolCall ¶
func ToolCallsFrom ¶
ToolCallsFrom renders tool_use blocks as standard tool calls. Empty inputs become "{}" so clients can always json-parse arguments.
type ToolCallDelta ¶
type ToolCallDelta = compat.ToolCallDelta
type Turn ¶
type Turn struct {
System string // first system message → the cacheable stable prefix
SystemVolatile string // second system message (3+ concatenate) → the volatile suffix
Messages []wire.Message
Tools []wire.ToolDef
ToolChoice string
Effort wire.Effort
MaxTokens int
}
Turn is the translated body of one inbound chat-completions request — the pieces that slot straight into wire.Request. The caller stamps Model, BillingLane, Session, and the ops SystemPrefix.
func ToTurn ¶
func ToTurn(req ChatRequest) (Turn, error)
ToTurn translates one inbound ChatRequest body into a Turn. Errors are client errors (400): unsupported roles/parts, malformed data URLs, a forced tool_choice naming an undefined tool, and so on.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package conformance is the Phase A0 compat-subset contract, executable: a test suite that exercises ANY OpenAI-compatible base URL and reports where it sits against the two-tier contract (plans/flickering-soaring-falcon).
|
Package conformance is the Phase A0 compat-subset contract, executable: a test suite that exercises ANY OpenAI-compatible base URL and reports where it sits against the two-tier contract (plans/flickering-soaring-falcon). |