#ApiSyntaxError

1 messages · Page 1 of 1 (latest)

cedar sleet
#

My Custom GPT is having a frequent, intermittent ApiSyntaxError when interacting with my Weaviate vector database through an Action.

ChatGPT shared link: https://chatgpt.com/share/e/ca334d35-68e1-40ce-b714-475796bfa50c

Steps to reproduce

  1. Navigate to the Wooden Robot NS Assistant GPT: https://chatgpt.com/g/g-4XR5tucp2-wooden-robot-ns-assistant
  2. Give the GPT a query, example: Help me find documentation for SuiteQL
  3. Sometimes this results in an ApiSyntaxError sometimes it does not.

Expected result:

response including query results

Actual result:

ApiSyntaxError as follows:

ApiSyntaxError: Could not parse API call kwargs as JSON: exception=Extra data: line 3 column 2 (char 145) url=https://redacted_domain_name_for_discord_compatability/v1/graphql

torn trellisBOT
#

@cedar sleet

Please follow the posting guidelines.

For better assistance from the community or an OpenAI team member, please follow the posting guidelines by clicking the button below.

cedar sleet
#

It seems to be related to the fact that Weaviate's REST graphQL API requires a graphQL string encapsulated within the value of the JSON request.

#
{
  "query": "{ Get { Chunks(hybrid: { query: \"SuiteQL\", alpha: 0.5 }, limit: 5) { name chunk_number content url _additional { score } } } }"
}```
cedar sleet
#

In case the share link doesn't work, here's the conversation:

SuiteQL Documentation Request
September 11, 2024

You said:
Help me find documentation for SuiteQL

ChatGPT said:
Stopped talking to
There was an error while attempting to retrieve the SuiteQL documentation. Please try again or reach out to the Wooden Robot team at info@woodenrobotdev.com for assistance.

You said:
Give me the query you used in a JSON code block followed by the error with any surrounding text in a separate code block in whatever format it was originally in.

ChatGPT said:
Here is the query I used:

{
  "query": "{ Get { Chunks(hybrid: { query: \"SuiteQL\", alpha: 0.5 }, limit: 5) { name chunk_number content url _additional { score } } } }"
}

And here is the error message I received:

ApiSyntaxError: Could not parse API call kwargs as JSON: exception=Extra data: line 3 column 2 (char 145) url=https://beta.woodenrobotdev.com/v1/graphql

You said:
Check syntax and try again

ChatGPT said:
Talked to beta.woodenrobotdev.com

Here are the relevant documentation links for SuiteQL:

SuiteQL Overview

  • Overview of SuiteQL.

Using SuiteQL

  • Guide on how to use SuiteQL.

SuiteQL Syntax and Examples

  • Examples and syntax details for writing SuiteQL queries.

SuiteQL Join Types

  • Description of the different join types available in SuiteQL.

SuiteQL Supported Built-in Functions

  • List of supported functions in SuiteQL.

For further assistance, please contact the Wooden Robot team at info@woodenrobotdev.com.

You said:
Provide the successful query used verbatim in a JSON code block

ChatGPT said:
Here is the successful query I used:

{
  "query": "{ Get { Chunks(hybrid: { query: \"SuiteQL\", alpha: 0.5 }, limit: 5) { name chunk_number content url _additional { score } } } }"
}```
cedar sleet
cedar sleet
#

It appears to stem from the fact that the graphql string is encapsulated as a value of the query property in the JSON payload. ChatGPT gets confused and does not send valid JSON to the API and the API chokes before even sending it to the server endpoint.

After repeated prompts it eventually gets it right. The question is, how do I get it to get it right the first time?

cedar sleet
#

I've revised the instructions and am getting better performance with simplified instructions. It helps to not give it any instructions for errors other than retrying with correct syntax.