Skip to content

Commit

Permalink
switch to new openai library with basic chatgpt switch
Browse files Browse the repository at this point in the history
  • Loading branch information
ndjenkins85 committed Nov 22, 2023
1 parent 3ad3eea commit 45d19e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion afkode/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def chatgpt(prompt: str, model: str = "gpt-4-1106-preview") -> str:
Returns:
The generated text response.
"""
client = openai.OpenAI(api_key=api.get_credentials()["OPENAI_KEY"])
client = openai.OpenAI(api_key=get_credentials()["OPENAI_KEY"])

try:
completion = client.chat.completions.create(model=model, messages=[{"role": "user", "content": prompt}])
Expand Down

0 comments on commit 45d19e6

Please sign in to comment.