Find answers from the community

Updated last year

As of today I have been having problems

At a glance

The community member is having issues with the llama-index library, but not with OpenAI directly. They are encountering a JSONDecodeError when trying to use the VectorStoreIndex and OpenAI APIs. The comments suggest that querying an empty index may be the issue, and that the full traceback is not provided. Another community member mentions having a similar problem with a normal index and simplifying it, but the issue persists. There is no explicitly marked answer in the comments.

As of today, I have been having problems with llama-index, but it is no problem to openAI directly, what is the reason?
Plain Text
pythonres = OpenAI().complete('hi')
print(res)
res = VectorStoreIndex([]).as_query_engine().query('Hi')
print(res)
Hello! How can I assist you today?
Traceback (most recent call last):
File "E:\demo\CUITCCA\backend\venv\lib\site-packages\openai\api_requestor.py", line 753, in _interpret_response_line
data = json.loads(rbody)
File "D:\DevelopmentEnvironment\Python\Python310\lib\json__init.py", line 346, in loads return _default_decoder.decode(s) File "D:\DevelopmentEnvironment\Python\Python310\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "D:\DevelopmentEnvironment\Python\Python310\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from Nonejson.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)The above exception was the direct cause of the following exception:Traceback (most recent call last): File "E:\demo\CUITCCA\backend\venv\lib\site-packages\tenacity__init.py", line 382, in call
result = fn(args, kwargs) File "E:\demo\CUITCCA\backend\venv\lib\site-packages\llama_index\embeddings\openai.py", line 122, in get_embedding return openai.Embedding.create(input=[text], model=engine, kwargs)["data"][0][ File "E:\demo\CUITCCA\backend\venv\lib\site-packages\openai\api_resources\embedding.py", line 33, in create response = super().create(args, **kwargs)
File "E:\demo\CUITCCA\backend\venv\lib\site-packages\openai\api_resources\abstract\engine_apiresource.py", line 153, in create response, , api_key = requestor.request(...
L
C
4 comments
I dont think you can query an empty index without error?
But also, your traceback is slightly cut off at the end
@Logan M In fact, I had this problem on a noraml index, and I simplified it, but now that it's good, I don't know if it's the reason for modifying the base url
The mistake came up again
Add a reply
Sign up and join the conversation on Discord