From 5bc6dc076eac7d451cabb7988aed08309ef596c7 Mon Sep 17 00:00:00 2001 From: Justin Torre Date: Thu, 23 Feb 2023 11:03:04 -0800 Subject: [PATCH] added caching and properties docs (#1255) --- docs/ecosystem/helicone.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/ecosystem/helicone.md b/docs/ecosystem/helicone.md index 345cc4a4..88cf2e52 100644 --- a/docs/ecosystem/helicone.md +++ b/docs/ecosystem/helicone.md @@ -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)