Skip to content

Interface ZIF_LLM_CLIENT

AI Generated documentation.

Overview

The zif_llm_client interface defines a standardized contract for interacting with Large Language Model (LLM) clients. It provides methods for creating and executing chat requests with different role types.

Key features:

  • Defines constants for message roles: user, system, assistant, and tool
  • Supports client creation with configuration
  • Enables chat request generation and execution

Main methods:

  1. get_client():

  2. Static method to create a new LLM client

  3. Requires client and provider configurations
  4. Can raise validation or authorization exceptions

  5. chat():

  6. Executes a chat request

  7. Takes a chat request object
  8. Returns a response

  9. new_request():

  10. Creates a new chat request object

Dependencies

  • Custom exception classes:

  • zcx_llm_validation

  • zcx_llm_authorization
  • Custom types:

  • zllm_clnt_config

  • zllm_providers
  • zllm_response
  • zllm_role