This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Assistant : Error reading thread run response #412
Comments
I said the function part has something wrong but I am not sure. You can test without function call. It need to be fixed by the owner.发自我的 iPhone在 2023年11月17日,17:23,Geoffrey Fourmis ***@***.***> 写道:
Hello,
Using v0.18.1 just released with the #408 by @vacuityv , I was trying to run an assistant's thread (using function). Maybe I'm missing something but until now I'm unable de complete the run.
Here is the code :
// Create thread with one message
MessageRequest messageRequest = MessageRequest.builder()
.content(text)
.build();
ThreadRequest threadRequest = ThreadRequest.builder()
.messages(Collections.singletonList(messageRequest))
.build();
Thread thread = service.createThread(threadRequest);
// run thread
RunCreateRequest runCreateRequest = RunCreateRequest.builder()
.assistantId(ASSISTANT_ID)
.build();
// error here
Run run = service.createRun(thread.getId(), runCreateRequest);
Here is the error I got
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.Class` from Object value (token `JsonToken.START_OBJECT`)
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 25, column: 23] (through reference chain: com.theokanning.openai.runs.Run["tools"]->java.util.ArrayList[1]->com.theokanning.openai.assistants.Tool["function"]->com.theokanning.openai.completion.chat.ChatFunction["parameters"])
full stack trace :
stack_trace.txt
If I manually call URLs here is the JSON I receive, like the stack stace says the pb is on tools->functions[1]->parameters
{
"id": "run_ID",
(...)
"tools": [
{
"type": "retrieval"
},
{
"type": "function",
"function": {
"name": "function_test1",
"description": "my description ",
"parameters": {
"type": "object",
"properties": {
"param_test1": {
"type": "string",
"description": "Param test1"
}
},
"required": [
"param_test1"
]
}
}
}
],
(...)
}
full response :
manual_call_response.json
In the source code I found that it is ChatFunction used :
public class ChatFunction {
(...)
/**
* The parameters the functions accepts.
*/
@JsonProperty("parameters")
private Class<?> parametersClass;
I'm trying to find the solution by myself, without success until now.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Or I will test it tonight发自我的 iPhone在 2023年11月17日,17:45,彭伟 ***@***.***> 写道:I said the function part has something wrong but I am not sure. You can test without function call. It need to be fixed by the owner.发自我的 iPhone在 2023年11月17日,17:23,Geoffrey Fourmis ***@***.***> 写道:
Hello,
Using v0.18.1 just released with the #408 by @vacuityv , I was trying to run an assistant's thread (using function). Maybe I'm missing something but until now I'm unable de complete the run.
Here is the code :
// Create thread with one message
MessageRequest messageRequest = MessageRequest.builder()
.content(text)
.build();
ThreadRequest threadRequest = ThreadRequest.builder()
.messages(Collections.singletonList(messageRequest))
.build();
Thread thread = service.createThread(threadRequest);
// run thread
RunCreateRequest runCreateRequest = RunCreateRequest.builder()
.assistantId(ASSISTANT_ID)
.build();
// error here
Run run = service.createRun(thread.getId(), runCreateRequest);
Here is the error I got
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.Class` from Object value (token `JsonToken.START_OBJECT`)
at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 25, column: 23] (through reference chain: com.theokanning.openai.runs.Run["tools"]->java.util.ArrayList[1]->com.theokanning.openai.assistants.Tool["function"]->com.theokanning.openai.completion.chat.ChatFunction["parameters"])
full stack trace :
stack_trace.txt
If I manually call URLs here is the JSON I receive, like the stack stace says the pb is on tools->functions[1]->parameters
{
"id": "run_ID",
(...)
"tools": [
{
"type": "retrieval"
},
{
"type": "function",
"function": {
"name": "function_test1",
"description": "my description ",
"parameters": {
"type": "object",
"properties": {
"param_test1": {
"type": "string",
"description": "Param test1"
}
},
"required": [
"param_test1"
]
}
}
}
],
(...)
}
full response :
manual_call_response.json
In the source code I found that it is ChatFunction used :
public class ChatFunction {
(...)
/**
* The parameters the functions accepts.
*/
@JsonProperty("parameters")
private Class<?> parametersClass;
I'm trying to find the solution by myself, without success until now.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thanks you for the quick answers, I just tried using the simple weather function example from Open AI assistant and I got the same error. I was able to complete the call localy & temporary by ignoring the property @JsonIgnoreProperties(value={ "parameters" })
public class ChatFunction { Because I don't understand how jackson is suppose de deserialize this : @JsonProperty("parameters")
private Class<?> parametersClass; |
@geoffreyfourmis I checked and it's because the function is different from the chat-function. I said here: And I think it nned to be fixed by @TheoKanning |
@geoffreyfourmis I make a pr for this: #415. You can get more infomation about function in this file: AssistantFunctionTest. And we need @TheoKanning to review and merge it. |
Fixed in 0.18.2 |
Thanks both of you, it's working great |
@geoffreyfourmis Happy that was fixed. You are welcome. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
Using v0.18.1 just released with the #408 by @vacuityv , I was trying to run an assistant's thread (using function). Maybe I'm missing something but until now I'm unable de complete the run.
Here is the code :
Here is the error I got
full stack trace :
stack_trace.txt
If I manually call URLs here is the JSON response, like the stack trace says the pb is on tools->functions[1]->parameters
full response :
manual_call_response.json
In the source code I found that it is ChatFunction used :
I'm trying to find the solution by myself, without success until now.
The text was updated successfully, but these errors were encountered: