Skip to content

Commit

Permalink
Update python readme to use v1 api (#359)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Jan 17, 2024
1 parent 41438ad commit ca82dcd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ from typing import List, Optional, Tuple
import openai
from langsmith import traceable

openai_client = openai.Client()

@traceable(run_type="llm")
def call_openai(data: List[dict], model: str = "gpt-3.5-turbo", temperature: float = 0.0):
return openai.ChatCompletion.create(
return openai_client.chat.completion.create(
model=model,
messages=data,
temperature=temperature,
Expand Down

0 comments on commit ca82dcd

Please sign in to comment.