gen_ai_hub.orchestration_v2.models.template module

Defines data models for prompt templating in the orchestration module.

class gen_ai_hub.orchestration_v2.models.template.Template(*, template: List[SystemMessage | UserMessage | AssistantMessage | ToolChatMessage | DeveloperChatMessage | ResponseChatMessage], defaults: dict | None = None, response_format: ResponseFormatText | ResponseFormatJsonObject | ResponseFormatJsonSchema | None = None, tools: List[dict | FunctionTool] | None = None)

Bases: ABCBaseModel

Represents a configurable template for generating prompts or conversations.

Parameters:
  • template – A list of prompt messages that form the template.

  • defaults – A dict of default values for template variables.

  • tools – A list of tool definitions.

  • response_format – A response format that the model output should adhere to.

template: List[SystemMessage | UserMessage | AssistantMessage | ToolChatMessage | DeveloperChatMessage | ResponseChatMessage]
defaults: dict | None
response_format: ResponseFormatText | ResponseFormatJsonObject | ResponseFormatJsonSchema | None
tools: List[dict | FunctionTool] | None
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': False}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class gen_ai_hub.orchestration_v2.models.template.PromptTemplatingModuleConfig(*, prompt: Template | TemplateRef, model: LLMModelDetails)

Bases: ABCBaseModel

prompt: Template | TemplateRef
model: LLMModelDetails
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': False}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].