From 856079a09b0d50c813a4e4c98031f8927d55910d Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Wed, 15 Mar 2023 14:28:39 -0400 Subject: [PATCH] Update more docs with langchain integration (#65) Update more docs with langchain integration. --- README.md | 11 +++++++++-- docs/source/index.rst | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9e93c92..a5c9e02 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,16 @@ output. You might even get results back. from kor.extraction import Extractor from kor.nodes import Object, Text -from langchain.chat_models import ChatOpenAI +from langchain import ChatOpenAI + +llm = ChatOpenAI(model_name="gpt-3.5-turbo", + temperature = 0, + max_tokens = 2000, + frequency_penalty = 0, + presence_penalty = 0, + top_p = 1.0, +) -llm = ChatOpenAI(model_name="gpt-3.5-turbo") model = Extractor(llm) schema = Object( diff --git a/docs/source/index.rst b/docs/source/index.rst index 695cac0..8b065d5 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -18,11 +18,18 @@ Translate user input into structured JSON to use for an API **request**: .. code-block:: python + from langchain import ChatOpenAI from kor.extraction import Extractor from kor.nodes import Object, Text - from kor.llms import OpenAIChatCompletion - llm = OpenAIChatCompletion(model="gpt-3.5-turbo") + llm = ChatOpenAI(model_name="gpt-3.5-turbo", + temperature = 0, + max_tokens = 2000, + frequency_penalty = 0, + presence_penalty = 0, + top_p = 1.0, + ) + model = Extractor(llm) schema = Object(