Function withHeliconeLangchain

  • Creates a ChatOpenAI configuration with Helicone logging enabled

    Usage: const llm = new ChatOpenAI(withHeliconeLangchain("gpt-4o-mini", apiKey, heliconeApiKey, heliconeBaseLoggingUrl, accountAddress, customProperties));

    Parameters

    • model: string

      The OpenAI model to use (e.g., "gpt-4o-mini", "gpt-4")

    • apiKey: string

      The OpenAI API key

    • heliconeApiKey: string

      The Helicone API key for logging

    • heliconeBaseLoggingUrl: string

      The Helicone base logging endpoint URL

    • accountAddress: string

      The account address for logging purposes

    • customProperties: CustomProperties

      Custom properties to add as Helicone headers (should include agentid and sessionid)

    Returns ChatOpenAIConfiguration

    Configuration object for ChatOpenAI constructor with Helicone enabled