genai.request.request_service module

pydantic model genai.request.request_service.BaseServices[source]

Bases: BaseServiceServices

Config:
  • extra: str = forbid

  • validate_assignment: bool = True

  • validate_default: bool = True

field FeedbackService: type[FeedbackService] = <class 'genai.request.feedback.feedback_service.FeedbackService'>
class genai.request.request_service.RequestService[source]

Bases: BaseService[BaseServiceConfig, BaseServices]

Services

alias of BaseServices

__init__(*, api_client, services=None, config=None)[source]
Parameters:
chat(conversation_id)[source]
Parameters:

conversation_id (str) – The ID of the conversation to retrieve.

Raises:
  • ValueError – If the ID is an empty string.

  • ApiResponseException – If target feedback/generation does not exist or cannot be updated.

  • ApiNetworkException – In case of unhandled network error.

Return type:

RequestChatConversationIdRetrieveResponse

chat_delete(conversation_id)[source]
Parameters:

conversation_id (str) – The ID of the conversation to delete.

Raises:
  • ValueError – If the ID is an empty string.

  • ApiResponseException – If target feedback/generation does not exist or cannot be updated.

  • ApiNetworkException – In case of unhandled network error.

Return type:

None

delete(id)[source]

Deletes request with the given ID.

Raises:
  • ValueError – If the ID is an empty string.

  • ApiResponseException – If target feedback/generation does not exist or cannot be updated.

  • ApiNetworkException – In case of unhandled network error.

Parameters:

id (str)

Return type:

None

list(*, api=None, limit=None, offset=None, status=None, origin=None, before=None, after=None, endpoint=None, date=None)[source]

Lists requests based on the given parameters.

Raises:
  • ValueError – If the ID is an empty string.

  • ApiResponseException – If target feedback/generation does not exist or cannot be updated.

  • ApiNetworkException – In case of unhandled network error.

Parameters:
  • api (RequestApiVersion | None)

  • limit (int | None)

  • offset (int | None)

  • status (str | RequestStatus | None)

  • origin (str | RequestOrigin | None)

  • before (datetime | None)

  • after (datetime | None)

  • endpoint (RequestEndpoint | list[RequestEndpoint] | None)

  • date (datetime | None)

Return type:

RequestRetrieveResponse