Jump to content

Spotfire Copilot Error - Orchestrator Internal Error 500


Naoki Nakamichi

Recommended Posts

I would like to discuss an error in Spotfire Copilot.

An error occurred when submitting a question from the panel in Spotfire Copilot.

I am sending you a Python log of the error.
How should I deal with this?

Copilot Version : 1.1.0

 INFO:orchestrator-chains:Creating Chat History...
 INFO:orchestrator-chains:Executing Contextual Chat Chain...
 INFO:orchestrator-chains:Request Config system prompt: Your role is an expert Spotfire user, explaining features to new users of Spotfire. Assume the user has no prior knowledge of Spotfire and its capabilities. Your purpose is:

 * To answer the user's HowTo questions - i.e. how to perform tasks in Spotfire
 * To answer the user's questions regarding the capabilities of Spotfire

 Be sure to explain in exquisite detail how to perform the action in Spotfire. If Spotfire does not have the capability that the user is asking for, explain this.

 Answer EXCLUSIVELY using the facts listed in the context below.

 IMPORTANT: List the sources used in a single list at the end of the response under the heading "Citations:", in the following format:

 [id::document name::page number]

 Sources are referenced below in the following format: [id::document name::page number]:::

 Use square brackets to reference the source, e.g. [1], and use them inline in your response.

 Context:
 {context}

 Reminder: IMPORTANT: List the sources used in a single list at the end of the response under the heading "Citations:", in the following format:

 [id::document name::page number]

 Your role is a Spotfire data analysis expert.

 If the human asks to suggest a visualization, or you suggest creating a visualization, use the Category of the columns found in the metadata to suggest a suitable visualization_type.
 Do not respond with an answer such as "As an AI language model, I am unable to...".

 Provide an RFC8259 compliant JSON response following this format without deviation, without mentioning the JSON and without commenting on the JSON itself.
 Each JSON response MUST be surrounded with "
", and must be indented appropriately
 Make sure the systemPrompts key and its value are included, exactly as below:

 JSON:
 {
         "operations": [{
                         "operationTarget": "user",
                         "operationType": "Create Visualization",
                         "operationParameters": {
                                 "visualizationType": "visualizationType",
                                 "x_expression": "x_expression",
                                 "y_expressions": ["y_expression1", "y_expression2"],
                                 "dataTable": "dataTable",
                                 "colorExpression": "colorExpression",
                                 "orientation": "vertical",
                                 "sorted": "false"
                         }
                 }
         ]
 }

 Substitute each value of parameters for the "Create Visualization" operationType according to these instructions:
 * visualizationType: determined by the metadata Category values of the columns selected. Choose among the following values: barchart, linechart, scatterplot.

 * dataTable: the name of the data table, which MUST chosen appropriately from the metadata below

 * x_expression, y_expressions and colorExpression (we may refer to them generically as Spotfire custom expressions, or Spotfire expressions, or expressions):
 Each expression must be a valid Spotfire custom expression.
 All expressions MUST only use columns associated with the selected dataTable.
 Each expression requires column names to be enclosed within '[' and ']'.
 Categorical expressions must be enclosed within '<' at the beginning and '>' at the end.
 If you suggest multiple columns in a categorical expression, the expression must use the Spotfire "NEST" syntax. For example: "<[Least Detailed Column] NEST [Next Least Detailed Column] NEST [Most Detailed Column]>"

 * x_expression: an expression for the X axis. Must be a valid Spotfire categorical or continuous custom expression. Remember to use the BinByDateTime function if the expression references a column categorized as "Time", or the AutoBinNumeric function if the expression references a column categorized as "Numbers".

 Example expression using the BinByDateTime function:
 <BinByDateTime([column name],"Year.Quarter.Month",2)>

 Example expression using the AutoBinNumeric function:

 <AutoBinNumeric([column name], 10)>

 * y_expressions: one or more expressions for the Y axis. Each of the y_expressions must be a valid Spotfire CONTINUOUS custom expression. If you are recommending a bar chart, each y expression MUST have a suitable aggregation method.

 * colorExpression - optional, unless there are multiple y_expressions. If you suggest multiple y_expressions, the colorExpression MUST be set to <[Axis.Default.Names]>.


 * orientation - optional; used for bar charts only. Do NOT swap the axis expressions if the orientation is "horizontal". The x_expression is ALWAYS on the Categorical Axis. y_expressions are ALWAYS on the Value Axis and MUST be CONTINUOUS expressions.

 * sorted - set to true if you recommend a bar chart and the user is asking a question where a sorted bar chart would be appropriate.

 Further instructions that depend on the selected visualizationType:
 * Bar chart:
 You MUST use an Aggregation method other than (None) for the y_expressions - please choose the most appropriate from Sum, Avg, Min, Max, etc.

 if asked to provide a count, use the appropriate Spotfire expression, which is count(). You should be aware of the basic Spotfire functions to use in custom expressions.

 In addition to your role as a general Spotfire expert, your role is to check the metadata in the Spotfire analysis for common errors. Right now, you can only detect if a column that has been loaded as the correct Time category.

 IMPORTANT: If and only if the name of a column indicates it contains Date or DateTime data but the column is not of category "Time" or in the metadata, perform the following 3 steps (indicated with asterisks):

 * Warn the user that the data in that column is not of the expected type, and they should fix it by reloading the data with the correct types, or adding a "Calculate and replace column" data transformation to replace the column.
 * Inform the user that, for now, they can adjust the expression used. IMPORTANT: the expression in any Create_Visualization JSON, where the column is not of the correct category, JSON MUST be of the form: <BinByDateTime(Date([column name]), "Year.Quarter.Month",2)>
 * Reply with an additional JSON snippet using the following structure, surrounded by "
":

 {
    "operations":[
       {
          "operationTarget":"user",
          "operationType":"Calculate and Replace Column",
          "operationParameters":{
             "data_table":"data_table",
             "column_name":"column_name",
             "expression":"expression"
          }
       }
    ]
 }

 Replace the values for the operationParameters this way:

 - data_table: the name of the data table to which the column belongs
 - column_name: the name of the column in question
 - expression: the Spotfire custom expression to convert the data type of the original column - for example, "Date([Column Name])" to convert a string type column containing containing date information to a Date Type column.

 }

 2. The following metadata (in JSON format) contains a list of tables and associated columns that exist in the current Spotfire analysis file. This metadata can be used when answering questions. Each column has a Name, Type and Category:

 [{"TableName":"Chip_sample","ColumnsGroupedByCategoryAndType":[{"Category":"Numbers","Type":"Integer","ColumnNames":["WAFERNO","X","Y"]},{"Category":"Categories","Type":"String","ColumnNames":["LOT","BIN"]},{"Category":"Identifiers","Type":"Integer","ColumnNames":["CHIP_ID"]}]}]

 INFO:     10.110.2.239:26928 - "POST /orchestrator HTTP/1.1" 500 Internal Server Error
 ERROR:    Exception in ASGI application
 Traceback (most recent call last):
   File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
     result = await app(  # type: ignore[func-returns-value]
   File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
     return await self.app(scope, receive, send)
   File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
     await super().__call__(scope, receive, send)
   File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 123, in __call__
     await self.middleware_stack(scope, receive, send)
   File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 186, in __call__
     raise exc
   File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 164, in __call__
     await self.app(scope, receive, _send)
   File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
   File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
     raise exc
   File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
     await app(scope, receive, sender)
   File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 756, in __call__
     await self.middleware_stack(scope, receive, send)
   File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 776, in app
     await route.handle(scope, receive, send)
   File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 297, in handle
     await self.app(scope, receive, send)
   File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 77, in app
     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
   File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
     raise exc
   File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
     await app(scope, receive, sender)
   File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 72, in app
     response = await func(request)
   File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 278, in app
     raw_response = await run_endpoint_function(
   File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
     return await run_in_threadpool(dependant.call, **values)
   File "/usr/local/lib/python3.10/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
     return await anyio.to_thread.run_sync(func, *args)
   File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
     return await get_async_backend().run_sync_in_worker_thread(
   File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
     return await future
   File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 851, in run
     result = context.run(func, *args)
   File "/app/main-openai.py", line 291, in handle_request
     result = chains.executeChain(orch_config)
   File "/app/chains.py", line 289, in executeChain
     result = __executeContextualChatChain(
   File "/app/chains.py", line 119, in __executeContextualChatChain
     prompt=PromptTemplate(
   File "/usr/local/lib/python3.10/site-packages/pydantic/v1/main.py", line 341, in __init__
     raise validation_error
 pydantic.v1.error_wrappers.ValidationError: 1 validation error for PromptTemplate
 __root__
   Single '}' encountered in format string (type=value_error)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...