Helicone Community Page

Updated 4 months ago

Custom properties, what am i missing?

Hey folks,

I've tried to get custom properties working a couple different ways... but either i don't know where to look or they don't show up on the Helicone console. What am i missing?

Jamming em in in both spots below and don't see them anywhere on the requests.
Plain Text
import { HeliconeAsyncOpenAI as OpenAI } from '@helicone/helicone';

describe('helicone params test', () => {
  it('basic test to see if headers are going through', async () => {
    const apiKey = process.env['OPENAI_API_KEY'];

    const openai = new OpenAI({
      apiKey,
      heliconeMeta: {
        apiKey: process.env['HELICONE_API_KEY'],
      },
      defaultHeaders: {
        'Helicone-Property-Environment': 'TEST',
        'Helicone-Property-Feature': 'general',
      },
    });

    const response = await openai.completions.create(
      {
        model: 'gpt-3.5-turbo-instruct',
        prompt: 'Once upon a time',
      },
      {
        headers: {
          'Helicone-Property-Environment': 'TEST2',
          'Helicone-Property-Feature': 'general2',
        },
      },
    );

    console.log(`response: `, response);
  });
});


Let me know, i'm sure this is user error πŸ™‚
3
C
m
c
24 comments
Hi! At this moment, we don't pull out those headers when logging. This seems like something we should do and I will take a look into adding this.

Right now, to add properties, you will have to set them in the Helicone Meta when instantiating the HeliconeAsyncOpenAI:

Plain Text
const openai = new OpenAI({
      apiKey,
      heliconeMeta: {
        apiKey: process.env['HELICONE_API_KEY'],
        properties: {
          "Environment": "TEST",
          ...
        }
      },
      defaultHeaders: {
        'Helicone-Property-Environment': 'TEST',
        'Helicone-Property-Feature': 'general',
      },
    });
Thanks for this. Tried it - where should i see the properties for that? They're not showing up there, maybe i'm just looking in the wrong spot?
Attachment
Screenshot_2024-02-12_at_9.42.36_PM.png
Updated code exactly as you added with Environment: TEST
Can you show me the code?
Of course, only minorly edited - here!

Plain Text
import { HeliconeAsyncOpenAI as OpenAI } from '@helicone/helicone';

describe('helicone params test', () => {
  it('basic test to see if headers are going through', async () => {
    const apiKey = process.env['OPENAI_API_KEY'];

    const openai = new OpenAI({
      apiKey,
      heliconeMeta: {
        apiKey: process.env['HELICONE_API_KEY'],
        properties: {
          Environment: 'TEST',
        },
      },
      defaultHeaders: {
        'Helicone-Property-Environment': 'TEST',
        'Helicone-Property-Feature': 'general',
      },
    });

    const response = await openai.completions.create(
      {
        model: 'gpt-3.5-turbo-instruct',
        prompt: 'Once upon a time',
      },
      {
        headers: {
          'Helicone-Property-Environment': 'TEST2',
          'Helicone-Property-Feature': 'general2',
        },
      },
    );

    console.log(`response: `, response);
  });
});
i literally just added that properties field in...
Weird that is not working. Let's hop on a call and try to debug it! https://cal.com/cole-gottdank/15min
Did you ever get to the bottom of this? I'm hitting the exact same issue
You are having this issue with the helicone async logger?
could you share code snippets?
not the async one, just regular
Attachment
Screenshot_2024-05-14_at_2.30.19_PM.png
what's odd is if I just do the conversation-id one it shows up on Helicone site but the other 2 properties don't. Even if I comment out conversation-id, the other ones never show up
I've tried renaming the variable name after Helicone-Property- and it never works
I feel like it's something really dumb
Let's look into this together. Feel free to schedule a meeting with me! https://cal.com/cole-gottdank/15min

We can debug together
I tried adding a new custom property to my headers yesterday, and it didn't show either. My old ones still show though
hi, is it working for you now? If not, let's hop on a call and chat
it's working now for me all of a sudden
we pushed out a fix!
Hey - I am having an issue with custom properties - when I add them to my headers and make a request (I am using OAI wrapped Helicone client) I hit a header encoding error:

File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/httpx/_utils.py", line 53, in normalize_header_value
return value.encode(encoding or "ascii")

I have narrowed down the extra params for Helicone custom properties at the root cause. Is this on your radar as a bug?
Hi are you able to hop on a call and show me this issue or share a code snippet?
Add a reply
Sign up and join the conversation on Discord