Migration to OpenAI 1.1.0 (#152)

This commit is contained in:
grit-app[bot]
2023-11-08 14:45:36 -05:00
committed by GitHub
parent 2965e08dff
commit 5acb0b79ef
78 changed files with 1171 additions and 2413 deletions
@@ -1,7 +1,9 @@
from instructor import OpenAISchema
from pydantic import Field
from typing import List, Any
import openai
from openai import OpenAI
client = OpenAI()
class RowData(OpenAISchema):
@@ -42,7 +44,7 @@ class Database(OpenAISchema):
def dataframe(data: str) -> Database:
completion = openai.ChatCompletion.create(
completion = client.chat.completions.create(
model="gpt-4-0613",
temperature=0.0,
functions=[Database.openai_schema],
@@ -51,7 +53,7 @@ def dataframe(data: str) -> Database:
{
"role": "system",
"content": """Map this data into a dataframe a
nd correctly define the correct columns and rows""",
nd correctly define the correct columns and rows""",
},
{
"role": "user",