Interacts with a Large Language Model (LLM) to generate a text response based on a user-provided prompt.

Input: None

Returns: Text generated by the LLM based on the provided prompt and configuration.

Example: Using OpenAI's GPT-4 model to generate a joke.

{
"llmTask": {
"providerConfig": {
"openai": {
"model": "gpt-4",
"userPrompt": "Tell me a joke.",
"temperature": 0.7,
"secretNameApiKey": "${OPENAI_API_KEY}"
}
}
}

Implements

Constructors

  • Constructs a new LlmTask.

    Parameters

    • Optionalproperties: ILlmTask

      Properties to set

    Returns OracleJob.LlmTask

Properties

grokxai?: IGrokXAIConfig

LlmTask grokxai.

LlmTask groq.

openai?: IOpenAIConfig

LlmTask openai.

providerConfig?: "openai" | "groq" | "grokxai"

LlmTask providerConfig.

Methods

  • Converts this LlmTask to JSON.

    Returns { [k: string]: any }

    JSON object

  • Creates a new LlmTask instance using the specified properties.

    Parameters

    • Optionalproperties: ILlmTask

      Properties to set

    Returns OracleJob.LlmTask

    LlmTask instance

  • Decodes a LlmTask message from the specified reader or buffer.

    Parameters

    • reader: Uint8Array<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    • Optionallength: number

      Message length if known beforehand

    Returns OracleJob.LlmTask

    LlmTask

    If the payload is not a reader or valid buffer

    If required fields are missing

  • Decodes a LlmTask message from the specified reader or buffer, length delimited.

    Parameters

    • reader: Uint8Array<ArrayBufferLike> | Reader

      Reader or buffer to decode from

    Returns OracleJob.LlmTask

    LlmTask

    If the payload is not a reader or valid buffer

    If required fields are missing

  • Encodes the specified LlmTask message. Does not implicitly verify messages.

    Parameters

    • message: ILlmTask

      LlmTask message or plain object to encode

    • Optionalwriter: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Encodes the specified LlmTask message, length delimited. Does not implicitly verify messages.

    Parameters

    • message: ILlmTask

      LlmTask message or plain object to encode

    • Optionalwriter: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Creates a LlmTask message from a plain object. Also converts values to their respective internal types.

    Parameters

    • object: { [k: string]: any }

      Plain object

    Returns OracleJob.LlmTask

    LlmTask

  • Gets the default type url for LlmTask

    Parameters

    Returns string

    The default type url

  • Creates a plain object from a LlmTask message. Also converts values to other types if specified.

    Parameters

    • message: OracleJob.LlmTask

      LlmTask

    • Optionaloptions: IConversionOptions

      Conversion options

    Returns { [k: string]: any }

    Plain object

  • Verifies a LlmTask message.

    Parameters

    • message: { [k: string]: any }

      Plain object to verify

    Returns string

    null if valid, otherwise the reason why it is not