Skip to content

JSONDecodeError: Expecting value: line 1 column 1 (char 0) #3

@Coder-Vishali

Description

@Coder-Vishali

This issue occurs while executing following line of code:

Testing inference of Starling

lm("What is the capital of Colombia?")

and

generate_sql_query = dspy.Predict(signature=TextToSql)

result = generate_sql_query(
sql_prompt=sample["sql_prompt"],
sql_context=sample["sql_context"]
)

for k, v in result.items():
print(f"\n{k.upper()}:\n")
print(v)

JSONDecodeError Traceback (most recent call last)
File c:\Project_Files\knowledge_nexus\venv\Lib\site-packages\requests\models.py:963, in Response.json(self, **kwargs)
962 try:
--> 963 return complexjson.loads(self.content.decode(encoding), **kwargs)
964 except UnicodeDecodeError:
965 # Wrong UTF codec detected; usually because it's not UTF-8
966 # but some other 8-bit codec. This is an RFC violation,
967 # and the server didn't bother to tell us what codec was
968 # used.

File C:\Python312\Lib\json_init_.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
343 if (cls is None and object_hook is None and
344 parse_int is None and parse_float is None and
345 parse_constant is None and object_pairs_hook is None and not kw):
--> 346 return _default_decoder.decode(s)
347 if cls is None:

File C:\Python312\Lib\json\decoder.py:337, in JSONDecoder.decode(self, s, _w)
333 """Return the Python representation of s (a str instance
334 containing a JSON document).
335
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
...
--> 971 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
973 try:
974 return complexjson.loads(self.text, **kwargs)

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell ou

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions