Skip to content

Commit

Permalink
added caching and properties docs (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
chitalian authored Feb 23, 2023
1 parent 6d37d08 commit 5bc6dc0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/ecosystem/helicone.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,35 @@ export OPENAI_API_BASE="https://oai.hconeai.com/v1"
Now head over to [helicone.ai](https://helicone.ai/onboarding?step=2) to create your account, and add your OpenAI API key within our dashboard to view your logs.

![Helicone](../_static/HeliconeKeys.png)

## How to enable Helicone caching

```python
from langchain.llms import OpenAI
import openai
openai.api_base = "https://oai.hconeai.com/v1"

llm = OpenAI(temperature=0.9, headers={"Helicone-Cache-Enabled": "true"})
text = "What is a helicone?"
print(llm(text))
```

[Helicone caching docs](https://docs.helicone.ai/advanced-usage/caching)

## How to use Helicone custom properties

```python
from langchain.llms import OpenAI
import openai
openai.api_base = "https://oai.hconeai.com/v1"

llm = OpenAI(temperature=0.9, headers={
"Helicone-Property-Session": "24",
"Helicone-Property-Conversation": "support_issue_2",
"Helicone-Property-App": "mobile",
})
text = "What is a helicone?"
print(llm(text))
```

[Helicone property docs](https://docs.helicone.ai/advanced-usage/custom-properties)

0 comments on commit 5bc6dc0

Please sign in to comment.