langchain.js
    Preparing search index...

    Class responsible for managing the interaction with the Replicate API. It handles the API key and model details, makes the actual API calls, and converts the API response into a format usable by the rest of the LangChain framework.

    const model = new Replicate({
    model: "replicate/flan-t5-xl:3ae0799123a1fe11f8c89fd99632f843fc5f7a761630160521c4253149754523",
    });

    const res = await model.invoke(
    "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
    );
    console.log({ res });

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Parameters

      • fields: any

      Returns Replicate

    Properties

    apiKey: string
    input: undefined | { [key: string]: string | number | boolean }
    lc_serializable: boolean = true
    model: `${string}/${string}:${string}`
    promptKey?: string

    The key used to pass prompts to the model.

    Accessors

    • get lc_secrets(): undefined | { [key: string]: string }

      Returns undefined | { [key: string]: string }

    Methods

    • Returns string

    • Parameters

      • prompt: string
      • options: unknown
      • OptionalrunManager: any

      Returns AsyncGenerator<GenerationChunk>

    • Returns string