Skip to documentation
Documentation navigation

Documentation navigation

Documentation / guides

Resolved model

Attribute a response to the provider model selected by the serving path.

developer

Response.Model is the provider model name associated with the completed response. It is a string because the response may come from a resolver or retrying decorator that resolved a model name at invocation time.

API surface

type Response struct {
	// ...
	Model string
}
response, err := client.Invoke(ctx, request)
if err != nil {
	return err
}
if response.Model != "" {
	log.Printf("served by %s", response.Model)
}

The request-side Model is the full descriptor and stable identity source. The response-side string is reporting metadata, not a new routing target. Do not use an untrusted response model string to override a configured endpoint or credentials.

Proof

Related: Model identity, Model selection.

← back to documentation