gen_ai_hub.prompt_registry.models package¶
- class gen_ai_hub.prompt_registry.models.PromptTemplate(*, role: str, content: str | List[str | TextPart | ImagePart | ImageItem])¶
Bases:
BaseModelRepresents a prompt template.
- Parameters:
role – The role of the prompt template.
content – The content of the prompt template.
- classmethod content_validation(content)¶
Validates and maps the content field to the appropriate types.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- role: str¶
The role of the prompt template.
- class gen_ai_hub.prompt_registry.models.PromptTemplateSpec(*, template: ~typing.List[~gen_ai_hub.prompt_registry.models.prompt_template.PromptTemplate], defaults: dict | None = None, response_format: ~gen_ai_hub.orchestration_v2.models.response_format.ResponseFormatText | ~gen_ai_hub.orchestration_v2.models.response_format.ResponseFormatJsonObject | ~gen_ai_hub.orchestration_v2.models.response_format.ResponseFormatJsonSchema | None = None, tools: ~typing.List[dict | ~gen_ai_hub.orchestration_v2.models.tools.FunctionTool] | None = None, additional_fields: ~typing.Dict[~typing.Any, ~typing.Any] | None = <factory>)¶
Bases:
BaseModelRepresents a prompt template specification.
- Parameters:
Args
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.
additional_fields – Additional fields for the prompt template.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- template: List[PromptTemplate]¶
- defaults: dict | None¶
- response_format: ResponseFormatText | ResponseFormatJsonObject | ResponseFormatJsonSchema | None¶
- tools: List[dict | FunctionTool] | None¶
- additional_fields: Dict[Any, Any] | None¶
- class gen_ai_hub.prompt_registry.models.PromptTemplatePostRequest(*, name: str, version: str, scenario: str, spec: PromptTemplateSpec)¶
Bases:
BaseModelRepresents a request to create a prompt template.
- Parameters:
name – The name of the prompt template.
version – The version of the prompt template.
scenario – The scenario of the prompt template.
spec – The specification of the prompt template.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name: str¶
The name of the prompt template.
- version: str¶
The version of the prompt template.
- scenario: str¶
The scenario of the prompt template.
- spec: PromptTemplateSpec¶
The specification of the prompt template.
- class gen_ai_hub.prompt_registry.models.PromptTemplateSubstitutionRequest(*, inputParams: ~typing.Dict[~typing.Any, ~typing.Any] | None = <factory>)¶
Bases:
BaseModelRepresents a request to substitute a prompt template.
- Parameters:
input_params – User provided values to replace the placeholders of the prompt template.
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Pydantic configuration to allow population by field name.
- input_params: Dict[Any, Any] | None¶
User provided values to replace the placeholders of the prompt template.
- class gen_ai_hub.prompt_registry.models.PromptTemplateSubstitutionResponse(*, parsed_prompt: List[PromptTemplate], resource: PromptTemplateGetResponse | None = None)¶
Bases:
BaseModelRepresents a response to a request to substitute a prompt template.
- Parameters:
parsed_prompt – The parsed prompt.
resource – List of TemplateGetResponse objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- parsed_prompt: List[PromptTemplate]¶
The parsed prompt.
- resource: PromptTemplateGetResponse | None¶
List of TemplateGetResponse objects.
- class gen_ai_hub.prompt_registry.models.PromptTemplateGetResponse(*, id: str, name: str, version: str, scenario: str, creation_timestamp: str | None = None, managed_by: str | None = None, is_version_head: bool | None = None, spec: PromptTemplateSpec | None = None)¶
Bases:
BaseModelRepresents a response to a request to get a prompt template.
- Parameters:
id – The ID of the prompt template.
name – The name of the prompt template.
version – The version of the prompt template.
scenario – The scenario of the prompt template.
creation_timestamp – The creation timestamp of the prompt template.
managed_by – The manager of the prompt template.
is_version_head – Whether the version is the head version.
spec – The specification of the prompt template.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- id: str¶
The ID of the prompt template.
- name: str¶
The name of the prompt template.
- version: str¶
The version of the prompt template.
- scenario: str¶
The scenario of the prompt template.
- creation_timestamp: str | None¶
The creation timestamp of the prompt template.
- managed_by: str | None¶
The manager of the prompt template.
- is_version_head: bool | None¶
Whether the version is the head version.
- spec: PromptTemplateSpec | None¶
The specification of the prompt template.
- class gen_ai_hub.prompt_registry.models.PromptTemplatePostResponse(*, message: str, id: str, scenario: str, name: str, version: str)¶
Bases:
BaseModelRepresents a response to a request to create a prompt template.
- Parameters:
message – The message of the response.
id – The ID of the prompt template.
scenario – The scenario of the prompt template.
name – The name of the prompt template.
version – The version of the prompt template.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- message: str¶
The message of the response.
- id: str¶
The ID of the prompt template.
- scenario: str¶
The scenario of the prompt template.
- name: str¶
The name of the prompt template.
- version: str¶
The version of the prompt template.
- class gen_ai_hub.prompt_registry.models.PromptTemplateDeleteResponse(*, message: str)¶
Bases:
BaseModelRepresents a response to a request to delete a prompt template.
- Parameters:
message – The message of the response.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- message: str¶
The message of the response.
- class gen_ai_hub.prompt_registry.models.PromptTemplateListResponse(*, count: int, resources: List[PromptTemplateGetResponse])¶
Bases:
BaseModelRepresents a response to a request to list prompt templates.
- Parameters:
count – The number of prompt templates.
resources – The list of PromptGetResponse objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- count: int¶
The number of prompt templates.
- resources: List[PromptTemplateGetResponse]¶
The list of PromptGetResponse objects.
- class gen_ai_hub.prompt_registry.models.OrchestrationConfigPostRequest(*, name: Annotated[str, MaxLen(max_length=120)], version: Annotated[str, MaxLen(max_length=10)], scenario: Annotated[str, MaxLen(max_length=120)], spec: OrchestrationConfig)¶
Bases:
BaseModelRequest to create an orchestration config.
- Parameters:
name – The name of the orchestration config.
version – The version of the orchestration config.
scenario – The scenario of the orchestration config.
spec – The orchestration config specification.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_dump(**kwargs)¶
Dumps the model to a dictionary with default settings.
- name: str¶
- version: str¶
- scenario: str¶
- spec: OrchestrationConfig¶
- class gen_ai_hub.prompt_registry.models.OrchestrationConfigPostResponse(*, message: str, id: str, scenario: str, name: str, version: str)¶
Bases:
BaseModelResponse to the orchestration config post request.
- Parameters:
message – Response message.
id – UUID of the created/updated config.
scenario – The scenario name.
name – The config name.
version – The config version.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- message: str¶
- id: str¶
- scenario: str¶
- name: str¶
- version: str¶
- class gen_ai_hub.prompt_registry.models.OrchestrationConfigGetResponse(*, id: str | None = None, name: str | None = None, version: str | None = None, scenario: str | None = None, creation_timestamp: str | None = None, managed_by: str | None = None, is_version_head: bool | None = None, resource_group_id: str | None = None, spec: OrchestrationConfig | None = None)¶
Bases:
BaseModelResponse to a get orchestration config request.
- Parameters:
id – UUID of the config.
name – Config name.
version – Config version.
scenario – Scenario name.
creation_timestamp – When the config was created.
managed_by – Who manages the config.
is_version_head – Whether this is the head version.
spec – The orchestration config specification (optional).
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_dump(**kwargs)¶
Dumps the model to a dictionary with default settings.
- id: str | None¶
- name: str | None¶
- version: str | None¶
- scenario: str | None¶
- creation_timestamp: str | None¶
- managed_by: str | None¶
- is_version_head: bool | None¶
- resource_group_id: str | None¶
- spec: OrchestrationConfig | None¶
- class gen_ai_hub.prompt_registry.models.OrchestrationConfigListResponse(*, count: int, resources: List[OrchestrationConfigGetResponse])¶
Bases:
BaseModelResponse to list orchestration configs request.
- Parameters:
count – Number of configs returned.
resources – List of OrchestrationConfigGetResponse objects.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_dump(**kwargs)¶
Dumps the model to a dictionary with default settings.
- count: int¶
- resources: List[OrchestrationConfigGetResponse]¶
- class gen_ai_hub.prompt_registry.models.OrchestrationConfigDeleteResponse(*, message: str)¶
Bases:
BaseModelResponse to a delete orchestration config request.
- Parameters:
message – Response message.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- message: str¶
Submodules¶
- gen_ai_hub.prompt_registry.models.orchestration_config module
OrchestrationConfigPostRequestOrchestrationConfigPostResponseOrchestrationConfigGetResponseOrchestrationConfigGetResponse.idOrchestrationConfigGetResponse.nameOrchestrationConfigGetResponse.versionOrchestrationConfigGetResponse.scenarioOrchestrationConfigGetResponse.creation_timestampOrchestrationConfigGetResponse.managed_byOrchestrationConfigGetResponse.is_version_headOrchestrationConfigGetResponse.resource_group_idOrchestrationConfigGetResponse.specOrchestrationConfigGetResponse.model_dump()OrchestrationConfigGetResponse.model_config
OrchestrationConfigListResponseOrchestrationConfigDeleteResponse
- gen_ai_hub.prompt_registry.models.prompt_template module
PromptTemplatePromptTemplateSpecPromptTemplatePostRequestPromptTemplatePostResponsePromptTemplateGetResponsePromptTemplateGetResponse.idPromptTemplateGetResponse.namePromptTemplateGetResponse.versionPromptTemplateGetResponse.scenarioPromptTemplateGetResponse.model_configPromptTemplateGetResponse.creation_timestampPromptTemplateGetResponse.managed_byPromptTemplateGetResponse.is_version_headPromptTemplateGetResponse.spec
PromptTemplateListResponsePromptTemplateDeleteResponsePromptTemplateSubstitutionRequestPromptTemplateSubstitutionResponse