Langchain-experiments classroom exercise
I just can't get openAI to send me a response. I had a look at the new https://python.langchain.com/docs/get_started/quickstart site and updated the folder code as the original doesn't work anymore.
I ended with the following:
import os
from dotenv import find_dotenv, load_dotenv
from langchain_openai import ChatOpenAI
load_dotenv(find_dotenv())
my_key = os.getenv("OPENAI_API_KEY")
my_prompt = "Write a poem about python and AI"
my_model = "gpt-3.5-turbo-0125"
llm = ChatOpenAI(openai_api_key=my_key, model_name=my_model)
response = llm.invoke(my_prompt)
print(response)
Here i'm getting "You exceeded your current quota..." but my API key is saying that my last used was "Never". This suggests that my call wasn't fully configured. I tried most models on the openAI website.
The llm variable information: (API key is hidden🙂)
llm: client=<openai.resources.chat.completions.Completions object at 0x0000026DA9AC75F0> async_client= <...> -turbo-0125' openai_api_key='sk-...nGVq' openai_proxy=''
Any hints what to look at to resolve this?
5
5 comments
Gerko van den Berg
6
Langchain-experiments classroom exercise
Data Alchemy
skool.com/data-alchemy
Your Community to Master the Fundamentals of Working with Data and AI — by Datalumina®
Leaderboard (30-day)
Powered by