I am not able to retrieve a response from:
# Send the query and context to the LLM
client = ChatNVIDIA(
model="meta/llama-3.3-70b-instruct",
api_key=os.getenv("OPENAI_API_KEY"),
temperature=0.2,
top_p=0.7,
max_tokens=1024,
)
for chunk in client.stream([{"role":"user","content":"hello how are you"}]):
print(chunk.content, end="")
The error that I am getting is this:
raceback (most recent call last):
File “/Users/alexitopro/Desktop/LearningPython/QuillaGPT/quilla-gpt/testing.py”, line 46, in
for chunk in client.stream([{“role”:“user”,“content”:“hello how are you”}]):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/alexitopro/Desktop/LearningPython/QuillaGPT/venv/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py”, line 420, in stream
raise e
File “/Users/alexitopro/Desktop/LearningPython/QuillaGPT/venv/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py”, line 400, in stream
for chunk in self._stream(messages, stop=stop, **kwargs):
File “/Users/alexitopro/Desktop/LearningPython/QuillaGPT/venv/lib/python3.12/site-packages/langchain_nvidia_ai_endpoints/chat_models.py”, line 420, in _stream
for response in self._client.get_req_stream(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/alexitopro/Desktop/LearningPython/QuillaGPT/venv/lib/python3.12/site-packages/langchain_nvidia_ai_endpoints/_common.py”, line 563, in get_req_stream
self._try_raise(response)
File “/Users/alexitopro/Desktop/LearningPython/QuillaGPT/venv/lib/python3.12/site-packages/langchain_nvidia_ai_endpoints/_common.py”, line 462, in _try_raise
raise Exception(f"{header}\n{body}") from None
Exception: [403] Forbidden
Invalid UAM response
I do have a side project in which I use OpenAI as client and I do have this error as well. I am not sure why this is happening considering that I still have plenty of credits remaining and a couple of hours ago it pretty much worked fine. I don’t know how to fix this as there’s little to none workarounds on the net.