textgrad.model#

Classes

BlackboxLLM([engine, system_prompt])

Initialize the LLM module.

class textgrad.model.BlackboxLLM(engine=None, system_prompt=None)#

Bases: Module

Initialize the LLM module.

Parameters:
  • engine (EngineLM) – The language model engine to use.

  • system_prompt (Variable, optional) – The system prompt variable, defaults to None.

forward(x)#

Perform an LLM call.

Parameters:

x (Variable) – The input variable.

Returns:

The output variable.

Return type:

Variable

parameters()#

Get the parameters of the blackbox LLM.

Returns:

A list of parameters.

Return type:

list