Protected
Optional
accountProtected
Optional
appProtected
environmentProtected
Optional
heliconeProtected
Readonly
heliconeProtected
Readonly
heliconeProtected
nvmProtected
returnProtected
Optional
versionHelper function to calculate usage for dummy song operations
Optional
completion_Optional
prompt_Helper function to calculate usage for image operations based on pixels
Optional
completion_Optional
prompt_Helper function to calculate usage for song operations based on tokens/quota
Optional
completion_Optional
prompt_Helper function to calculate usage for video operations (typically 1 token)
Optional
completion_Optional
prompt_Creates a standardized Helicone payload for API logging
Creates a standardized Helicone response for API logging
Protected
getProtected
parseCreates a ChatOpenAI configuration with Helicone logging enabled
Usage: const llm = new ChatOpenAI(observability.withHeliconeLangchain("gpt-4o-mini", apiKey, customProperties));
The OpenAI model to use (e.g., "gpt-4o-mini", "gpt-4")
The OpenAI API key
Custom properties to add as Helicone headers (should include agentid and sessionid)
Configuration object for ChatOpenAI constructor with Helicone enabled
Wraps an async operation with Helicone logging
Name of the agent for logging purposes
Configuration for the Helicone payload
The async operation to execute (returns internal result with extra data)
Function to extract the user-facing result from internal result
Function to calculate usage metrics from the internal result
Optional
completion_Optional
prompt_Prefix for the response ID
Custom properties to add as Helicone headers (should include agentid and sessionid)
Promise that resolves to the extracted user result
Creates an OpenAI client configuration with Helicone logging enabled
Usage: const openai = new OpenAI(observability.withHeliconeOpenAI(apiKey, heliconeApiKey, customProperties));
The OpenAI API key
Custom properties to add as Helicone headers (should include agentid and sessionid)
Configuration object for OpenAI constructor with Helicone enabled
Static
getThis method is used to create a singleton instance of the ObservabilityAPI class.
The options to initialize the payments class.
The instance of the ObservabilityAPI class.
The ObservabilityAPI class provides methods to wrap API calls with Helicone logging