Skip to content

Commit

Permalink
Update more docs with langchain integration (#65)
Browse files Browse the repository at this point in the history
Update more docs with langchain integration.
  • Loading branch information
eyurtsev authored Mar 15, 2023
1 parent 5aa050a commit 856079a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 9 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 856079a

Please sign in to comment.