Helicone Community Page

Updated 2 years ago

Querying Helicone GraphQL API

Hi,
We are trying to query the data we are sending to Helicone as we want to store it in our own DB's. However, I'm not seeing any data being returned when I query for the latest response in the playground (basically copied and pasted the sample code and put in my API key per the documentation instructions. I'm not sure what I'm doing wrong here...

The second issue I'm hitting is that we are using LangchainJS to power our API calls via a ConversationalRetrievalQAChain. However I'm seeing that our history isn't being stored in the Helicone requests (i.e. each API call is coming through as a request / response and the history isn't being tracked which used to be the case if I query from OpenAI directly). Wondering if there's any ways to get around this as the conversation history is very important for us to store in our DB.

Thanks,
Veronica
Attachment
Screenshot_2023-05-22_at_9.01.04_PM.png
1
b
J
h
19 comments
Hey ! We have a known bug with the graphql API that will be fixed tomorrow, apologies there!

Can you elaborate on what you mean by "our history isn't being stored in the request"? Is this previous messages in the chat completion?

In the requests table, the request and response columns show the latest message sent and latest message received. If you click into the row, you'll see all the messages in that conversation. Is this the history you are referring to?
Attachments
Screen_Shot_2023-05-22_at_11.18.02_PM.png
Screen_Shot_2023-05-22_at_11.17.50_PM.png
Hi sorry for the issues you were facing.

Everything should be functional now πŸ™‚
https://www.helicone.ai/graphql

Please let us know if you run into any other issues or have any other questions
Filter seems not working πŸ˜ƒ
Attachment
Screenshot_2023-05-23_at_11.52.30.png
Oh no! I’ll take a look asap
yup thats the history I'm referring to. when we save the responses back in our DB we'd likely want to know which chat history it came from. We are able to see the message history in the API call on our end so I'm not sure why its not showing up on the Helicone side
I am also seeing the GraphQL returning results for me now yay! So mainly the history issue I'm worried about now^
Awesome glad that's fixed! I'm following up in a dm to debug the history issue
great! wondering if its just an issue with how we integrated with Langchain πŸ€”
Helicone doesn't truncate any of the message history when it logs, so if you're missing some history the truncation might come from the langchain side, yeah
its weird bc this is our API call and I see the history but in Helicone I only see the last item in the history array and the question πŸ˜“
Attachment
Screenshot_2023-05-23_at_12.07.49_PM.png
It looks like there is context there beyond just what went into the prompt. Helicone doesn't log anything in addition to the prompt at the moment. Where is that request payload going to?
We have it setup as an API route call in NextJS 13. We then make a chain and have Helicone integrated there. The chain then uses ConversationalRetrievalQAChain to actually make the call. This is kind of hard to explain without showing code
I guess my question is how would I setup langchain so I can retain the history in Helicone as well? Are other people running into this issue?
We want to and have been asked to build a tighter integration with langchain so that complex chains show the full trace of requests and link them with each other
ah okay so it currently isn't possible and anything from langchain doesn't have the history showing up properly?
It's possible to do some custom patching to add a property for each chain via this feature https://docs.helicone.ai/advanced-usage/custom-properties. You can then filter results by chain -- but the UI isn't currently great for that, we're working on having better support for traces!
ah ok so if we add a custom ID to each helicone request we'd be able to query via that custom ID later to pull the data?
This should work now! This is a bit of a slow query. I am working on optimizing querying for a specific user id now. πŸ™‚ this should be a lot faster by tomorrow. We just have to shuffle some data around to make this query speedy πŸƒβ€β™€οΈπŸ’¨
Add a reply
Sign up and join the conversation on Discord