Helicone Community Page

Updated 6 months ago

Incomplete LangChain Gateway Example?

At a glance

The community member posted an example code snippet that uses the ChatOpenAI class from the langchain.chat_models module. They questioned whether the example is incomplete, as it includes a helicone_headers variable that is not used anywhere in the code. They also asked if the example needs a Helicone-Target-Url header.

In the comments, another community member responded that the helicone_headers variable seems unnecessary and that they will update the documentation accordingly. There is no explicitly marked answer in the provided information.

Useful resources
Hi, is this example incomplete? Does it need a Helicone-Target-Url? Doesn't look like helicone_headers is used anywhere?
Plain Text
from langchain.chat_models import AzureChatOpenAI
helicone_headers = {
    "Helicone-Auth": f"Bearer {helicone_api_key}",
    "Helicone-Target-Url":
}
llm = ChatOpenAI(
    openai_api_key='<>',
    headers={
        "Helicone-Auth": f"Bearer {env.HELICONE_API_KEY}"
        "Helicone-Target-Url": "https://api.lemonfox.ai",
        "Helicone-Target-Provider": "LemonFox",
    },
    openai_api_base="https://gateway.hconeai.com/v1",
)
from https://docs.helicone.ai/getting-started/integration-method/gateway
C
1 comment
Hi, yes that looks like it is incorrect in our docs. helicone_headers seems unnecessary! Thanks for the call out will make an update.
Add a reply
Sign up and join the conversation on Discord