snowflake.core.cortex.embed_service.EmbedRequest

class snowflake.core.cortex.embed_service.EmbedRequest(*, model: Annotated[str, Strict(strict=True)], text: Annotated[List[Annotated[str, Strict(strict=True)]], MinLen(min_length=1)])

Bases: BaseModel

A model object representing the EmbedRequest resource.

Constructs an object of type EmbedRequest with the provided properties.

Parameters:
  • model (str) –

    Identifier of the model to use for generating embeddings. Refer to Snowflake documentation for the list of supported models. Examples:

    • snowflake-arctic-embed-m

    • snowflake-arctic-embed-m-v1.5

  • text (List[str]) – An array of input texts for which vector embeddings will be calculated. Example: [“Hello world”, “Machine learning is fascinating”]

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Methods

classmethod from_dict(obj: dict) EmbedRequest

Create an instance of EmbedRequest from a dict.

classmethod from_json(json_str: str) EmbedRequest

Create an instance of EmbedRequest from a JSON string.

to_dict(hide_readonly_properties: bool = False) dict[str, Any]

Returns the dictionary representation of the model using alias.

to_dict_without_readonly_properties() dict[str, Any]

Return the dictionary representation of the model without readonly properties.

to_json() str

Returns the JSON representation of the model using alias.

to_str() str

Returns the string representation of the model using alias.