Wrapper around Fireworks API for large language models fine-tuned for chat

Fireworks API is compatible to the OpenAI API with some limitations described in https://readme.fireworks.ai/docs/openai-compatibility.

To use, you should have the openai package installed and the FIREWORKS_API_KEY environment variable set.

Example

const model = new ChatFireworks({
temperature: 0.9,
fireworksApiKey: "YOUR-API-KEY",
});

const response = await model.invoke("Hello, how are you?");
console.log(response);

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

fireworksApiKey?: string

Methods

  • Calls the Fireworks API with retry logic in case of failures.

    Parameters

    • request: ChatCompletionCreateParamsStreaming

      The request to send to the Fireworks API.

    • Optional options: any

      Optional configuration for the API call.

    Returns Promise<AsyncIterable<ChatCompletionChunk>>

    The response from the Fireworks API.

  • Calls the Fireworks API with retry logic in case of failures.

    Parameters

    • request: ChatCompletionCreateParamsNonStreaming

      The request to send to the Fireworks API.

    • Optional options: any

      Optional configuration for the API call.

    Returns Promise<ChatCompletion>

    The response from the Fireworks API.

Generated using TypeDoc