genai.prompt.prompt_service module#

class genai.prompt.prompt_service.PromptService[source]#

Bases: BaseService[BaseServiceConfig, BaseServiceServices]

create(*, name, model_id, prompt_id=None, messages=None, task_id=None, description=None, moderations=None, data=None, type=None, input=None, output=None, parameters=None, folder_id=None)[source]#
Raises:
Parameters:
  • name (str) –

  • model_id (str) –

  • prompt_id (str | None) –

  • messages (list[dict | BaseMessage] | None) –

  • task_id (str | None) –

  • description (str | None) –

  • moderations (dict | ModerationParameters | None) –

  • data (dict | PromptTemplateData | None) –

  • type (str | PromptType | None) –

  • input (str | None) –

  • output (str | None) –

  • parameters (dict | TextGenerationParameters | None) –

  • folder_id (str | None) –

Return type:

PromptCreateResponse

delete(id)[source]#
Raises:
Parameters:

id (str) –

Return type:

None

list(*, limit=None, offset=None, sort_by=None, direction=None, search=None, task_id=None, model_id=None, source=None, model_family_id=None, industry_id=None, prompt_language_id=None, model_type_id=None, avg_time_min=None, avg_time_max=None, context_window_min=None, context_window_max=None, folder_id=None)[source]#
Raises:
Parameters:
  • limit (int | None) –

  • offset (int | None) –

  • sort_by (str | PromptListSortBy | None) –

  • direction (str | SortDirection | None) –

  • search (str | None) –

  • task_id (str | list[str] | None) –

  • model_id (str | list[str] | None) –

  • source (str | PromptListSource | list[str | PromptListSource] | None) –

  • model_family_id (float | None) –

  • industry_id (str | list[str] | None) –

  • prompt_language_id (str | list[str] | None) –

  • model_type_id (str | list[str] | None) –

  • avg_time_min (int | None) –

  • avg_time_max (int | None) –

  • context_window_min (int | None) –

  • context_window_max (int | None) –

  • folder_id (str | None) –

Return type:

PromptRetrieveResponse

retrieve(id)[source]#
Raises:
Parameters:

id (str) –

Return type:

PromptIdRetrieveResponse

update(id, *, name, model_id, folder_id=None, industry_id=None, language_id=None, description=None, input=None, output=None, task_id=None, type=None, messages=None, moderations=None, parameters=None, data=None)[source]#
Raises:
Parameters:
  • id (str) –

  • name (str) –

  • model_id (str) –

  • folder_id (str | None) –

  • industry_id (str | None) –

  • language_id (str | None) –

  • description (str | None) –

  • input (str | None) –

  • output (str | None) –

  • task_id (str | None) –

  • type (str | PromptType | None) –

  • messages (list[dict | BaseMessage] | None) –

  • moderations (dict | ModerationParameters | None) –

  • parameters (dict | TextGenerationParameters | None) –

  • data (dict | PromptTemplateData | None) –

Return type:

PromptIdUpdateResponse