mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 07:35:18 +00:00
added caching and properties docs (#1255)
This commit is contained in:
parent
6d37d089e9
commit
5bc6dc076e
@ -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.
|
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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## 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)
|
||||||
|
Loading…
Reference in New Issue
Block a user