Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] WorkflowNode Parsing Fails for type Instant and Nested Objects #196

Closed
owaiskazi19 opened this issue Nov 24, 2023 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@owaiskazi19
Copy link
Member

What is the bug?

For the request like:

"llm": {
              "model_id": "ldzS04kBxRPZ5cnWrqpd",
              "parameters": {
                  "type": "hello"
              }
          }

the parsing for WorkflowNode fails with the below

{
    "error": "Can't get text on a START_OBJECT at 56:43"
}

and for the fieldsof type Instant

created_time: 12684646585

fails with the below

Current token (FIELD_NAME) not numeric, can not use numeric value accessors

How can one reproduce the bug?

  1. Pass a nested object to the Create API to reproduce the first bug.
  2. pass an instant value to the Create API to reproduce the second one.

What is the expected behavior?

Parsing should go through.

What is your host/environment?

Ubuntu

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

Add any other context about the problem.

@owaiskazi19 owaiskazi19 added bug Something isn't working untriaged labels Nov 24, 2023
@dbwiddis
Copy link
Member

The nested maps was an intentional thing to stop infinite recursion. You need to encode "parameters" as a special case like this:

if (PROCESSORS_FIELD.equals(inputFieldName)) {
List<PipelineProcessor> processorList = new ArrayList<>();
while (parser.nextToken() != XContentParser.Token.END_ARRAY) {
processorList.add(PipelineProcessor.parse(parser));
}
userInputs.put(inputFieldName, processorList.toArray(new PipelineProcessor[0]));
} else {

(But probably under START_OBJECT rather than the array)

@dbwiddis
Copy link
Member

Current token (FIELD_NAME) not numeric, can not use numeric value accessors

Where are you trying to parse an Instant? You're trying to parse the field name not value here.

@owaiskazi19
Copy link
Member Author

Current token (FIELD_NAME) not numeric, can not use numeric value accessors

Where are you trying to parse an Instant? You're trying to parse the field name not value here.

Pasted the wrong error message here but basically needed to add parsing for numbers. Handled both the cases in this PR: #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants