Helicone Community Page

Updated 3 months ago

Support: Need help with Async implementation

Hello we have been using the proxy integration so far without any issue, now we would like to explore the async integration. going through the documentation provided in the page : https://docs.helicone.ai/getting-started/integration-method/openai

We are using the curl method, however we were not able to to make it work for some reason. most likely we are doing something wrong in terms of passing the data in format expected. i will really appreciate if you can assist and give me a sample curl format that we need to pass to helicone end
point to make it work using the following request and response body from chatgpt API. πŸ™
{ "model": "gpt-3.5-turbo-0125", "messages": [ { "role": "system", "content": "you are helpful assistant." }, { "role": "user", "content": "what is AI" } ], "temperature": 0.2, "max_tokens": 4095, "top_p": 1, "frequency_penalty": 0, "presence_penalty": 0, "user": "9" }



{ "id": "chatcmpl-98fzFsC4tezpBQFfoHpNKJus90suy", "object": "chat.completion", "created": 1711855049, "model": "gpt-3.5-turbo-0125", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Ai stands for artificial intelligence, which refers to the simulation of human intelligence processes by machines, especially computer systems. This includes learning, reasoning, problem-solving, perception, and language understanding. Ai is used in a wide range of applications, from virtual assistants like Siri and Alexa to self-driving cars and medical diagnosis systems." }, "logprobs": null, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 127, "completion_tokens": 60, "total_tokens": 187 }, "system_fingerprint": "fp_3bc1b5746c" }
z
C
10 comments
and this is the example CURL format from the documentation:

curl -X POST https://api.hconeai.com/oai/v1/log \ -H 'Authorization: Bearer your_api_key' \ -H 'Content-Type: application/json' \ -d '{ "providerRequest": { "url": "https://example.com", "json": { "key1": "value1", "key2": "value2" }, "meta": { "metaKey1": "metaValue1", "metaKey2": "metaValue2" } }, "providerResponse": { "json": { "responseKey1": "responseValue1", "responseKey2": "responseValue2" }, "status": 200, "headers": { "headerKey1": "headerValue1", "headerKey2": "headerValue2" } }, "timing": { "startTime": { "seconds": 1625686222, "milliseconds": 500 }, "endTime": { "seconds": 1625686244, "milliseconds": 750 } } }'
here is the sample CURL i tried, the response is OK but i cant find the log in helicone dashboard
Attachment
image.png
attached is the curl request i submitted
Hi . The request is likely logging, the problem is that the timing you have there is not recent, so you will only see the request if you click the All tab.

If you update the unix time to be recent, you should see it:

Plain Text
"timing": {
        "startTime": {
            "seconds": 1711947513,
            "milliseconds": 0
        },
        "endTime": {
            "seconds": 1711947513,
            "milliseconds": 0
        }
    }
thanks, yeah that worked. can you please check how to pass the custom parameters ? in above example we passed the user parameter but its not reflected in the helicone log
Attachment
image.png
Hi, please include that in the meta:


Plain Text
"meta": {
            "Helicone-User-Id": "1234",
            "Helicone-Property-daf": "TEST"
        }
Plain Text
"providerRequest": {
        "url": "openai.com",
        "json": {
            "model": "gpt-3",
            "prompt": "how are you"
        },
        "meta": {
            "Helicone-User-Id": "1234",
            "Helicone-Property-daf": "TEST"
        }
    }
We tend to wrap Helicone specific things inside meta tags. This is to differentiate it from the provider (openai/anthropic/etc) fields.
thanks for support, it works one.
Add a reply
Sign up and join the conversation on Discord