Model
Model for defining the structure and behavior of AI agents. This model includes properties for specifying the model’s provider, connection details, and various options. It allows for flexible configuration of AI models to suit different use cases and requirements.
provider is the @dispatch discriminator for the Executor / Processor seams.
The string shorthand (model: "gpt-4") coerces to #{ id } only — it carries
no provider — so provider stays optional and absent/unknown providers are
resolved by the runtime registry (global defaults) out of band.
Class Diagram
Section titled “Class Diagram”---
title: Model
config:
look: handDrawn
theme: colorful
class:
hideEmptyMembersBox: true
---
classDiagram
class Model {
+string id
+string provider
+string apiType
+Connection connection
+ModelOptions options
}
class OpenAIModel {
+string provider
}
Model <|-- OpenAIModel
class AzureModel {
+string provider
}
Model <|-- AzureModel
class CustomModel {
+string provider
}
Model <|-- CustomModel
class Connection {
<<abstract>>
+string kind
+string authenticationMode
+string usageDescription
}
Model *-- Connection
class ModelOptions {
+float32 frequencyPenalty
+int32 maxOutputTokens
+float32 presencePenalty
+string reasoningEffort
+int32 seed
+float32 temperature
+int32 topK
+float32 topP
+string[] stopSequences
+boolean allowMultipleToolCalls
+dictionary additionalProperties
}
Model *-- ModelOptions
Yaml Example
Section titled “Yaml Example”id: gpt-35-turboprovider: foundryapiType: chatconnection: kind: key endpoint: https://{your-custom-endpoint}.openai.azure.com/ key: "{your-api-key}"options: type: chat temperature: 0.7 maxOutputTokens: 1000Properties
Section titled “Properties”| Name | Type | Description |
|---|---|---|
| id | string | The unique identifier of the model - can be used as the single property shorthand |
| provider | string | The provider of the model (e.g., ‘openai’, ‘foundry’, ‘anthropic’) |
| apiType | string | The type of API to use for the model (e.g., ‘chat’, ‘response’, etc.) |
| connection | Connection | The connection configuration for the model(Related Types: ReferenceConnection, RemoteConnection, ApiKeyConnection, AnonymousConnection, OAuthConnection, FoundryConnection) |
| options | ModelOptions | Additional options for the model |
Child Types
Section titled “Child Types”The following types extend Model:
Composed Types
Section titled “Composed Types”The following types are composed within Model:
Alternate Constructions
Section titled “Alternate Constructions”The following alternate constructions are available for Model.
These allow for simplified creation of instances using a single property.
string model
Section titled “string model”Simple construction with just an id
The following simplified representation can be used:
model: "example"This is equivalent to the full representation:
model: id: "example"