Macro llm_chain::executor

source ·
macro_rules! executor {
    () => { ... };
    (chatgpt) => { ... };
    (chatgpt, $options:expr) => { ... };
    (llama) => { ... };
    (llama, $options:expr) => { ... };
    (local, $options:expr) => { ... };
    (mock) => { ... };
    (sagemaker_endpoint, $options:expr) => { ... };
}
Expand description

A macro that creates a new executor for a specified model.

This macro makes it easy to create a new executor for a specific model without having to directly call the constructor functions of the respective executor structs. The macro supports creating executors for ChatGPT and LLaMA models.

Usage

executor!(); // Creates a ChatGPT executor with default options.

Examples

// Create a ChatGPT executor with default options.
let chatgpt_executor = executor!();

// Create a ChatGPT executor with custom per-executor options.
let chatgpt_executor_with_options = executor!(chatgpt, per_executor_options);

// Create a ChatGPT executor with custom per-executor and per-invocation options.
let chatgpt_executor_with_both_options = executor!(chatgpt, per_executor_options, per_invocation_options);

// Create a LLaMA executor with default options.
let llama_executor = executor!(llama);

// Create a LLaMA executor with custom per-executor options.
let llama_executor_with_options = executor!(llama, per_executor_options);

// Create a LLaMA executor with custom per-executor and per-invocation options.
let llama_executor_with_both_options = executor!(llama, per_executor_options, per_invocation_options);

Parameters

  • () or chatgpt: Creates a ChatGPT executor with default options.
  • chatgpt, per_executor_options: Creates a ChatGPT executor with custom per-executor options.
  • chatgpt, per_executor_options, per_invocation_options: Creates a ChatGPT executor with custom per-executor and per-invocation options.
  • llama: Creates a LLaMA executor with default options.
  • llama, per_executor_options: Creates a LLaMA executor with custom per-executor options.
  • llama, per_executor_options, per_invocation_options: Creates a LLaMA executor with custom per-executor and per-invocation options.s