Helicone Community Page

Updated 3 months ago

Streaming with Assitants API issue

Hello,

New to helicone and using proxy integration via OpenAI’s JavaScript SDK but seeing weird metrics

Plain Text
import OpenAI from "openai";

const openai = new OpenAI({
  apiKey: request.env.OPENAI_API_KEY,
  baseURL: "https://oai.helicone.ai/v1",
  defaultHeaders: {
    "Helicone-Auth": `Bearer ${request.env.HELICONE_API_KEY}`,
  },
});
Attachment
Screenshot_2024-07-05_at_01.35.27.png
D
M
s
4 comments
To help you resolve the strange metrics you're encountering with Helicone's proxy integration, here are some steps and common issues to check:

Verify Your Setup

  1. Ensure Correct API Key Configuration:
    • Make sure your HELICONE_API_KEY is set as an environment variable:
      Plain Text
      export HELICONE_API_KEY=<your API key>
    • Include the Helicone-Auth header in your requests:
      Plain Text
      defaultHeaders: {
        "Helicone-Auth": `Bearer ${process.env.HELICONE_API_KEY}`,
      }
    source
  1. Check Base Path Configuration:
    • Ensure the base path is correctly set to Helicone's proxy URL:
      Plain Text
      baseURL: "https://oai.helicone.ai/v1",
    source

Common Issues and Resolutions

  1. Model Display Issues:
    • If the model displays differently than expected, use the Helicone-Model-Override header:
      Plain Text
      "Helicone-Model-Override": "[MODEL_NAME]"
    source
  1. Missing api-version Parameter:
    • Ensure the api-version parameter is included in your requests:
      Plain Text
      defaultQuery: { "api-version": "[API_VERSION]" }
    source

Test Your Setup

  1. Make a Test Request:
    • Verify your setup by making a test request:
      ```javascript
      const chatCompletion = await openai.chat.completion.create({
      model: "gpt-3.5-turbo",
      messages: [{ role: "user", content: "Hello world" }],
      });
console.log(chatCompletion.data.choices[0].message);
```
source
By following these steps and checking for common issues, you should be able to resolve the unusual metrics you're seeing. If the problem persists, double-check your environment variables and headers for any typos or misconfigurations.
is assitants api supported
Hi , We are currently not fully supporting the helper API. The default streaming request should work fine!
Add a reply
Sign up and join the conversation on Discord