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

"Expected to decode String but found a dictionary instead." #11

Closed
KassBarraK opened this issue Dec 8, 2023 · 2 comments · Fixed by #12
Closed

"Expected to decode String but found a dictionary instead." #11

KassBarraK opened this issue Dec 8, 2023 · 2 comments · Fixed by #12

Comments

@KassBarraK
Copy link

it seems to me that there is an issue with the messagesApi.getMessages when the message contains annotations. (Generated when the assistant uses the "retrieval" tool to search files.)

typeMismatch(Swift.String, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "data", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "content", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "text", intValue: nil), CodingKeys(stringValue: "annotations", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0)], debugDescription: "Expected to decode String but found a dictionary instead.", underlyingError: nil))

Shall we change the "public let annotations:[String]?" and consider that annotations is an array of File citation
object and File path object ?

@DeveloperZelentsov
Copy link
Owner

Thank you for bringing the issue with the messagesApi.getMessages function to our attention. To help us better understand and resolve the problem, could you please provide us with the full JSON response where this error occurs? This information will be crucial in diagnosing and fixing the issue more effectively.

Thank you for your cooperation and assistance in improving our library.

@gustininho
Copy link

This is an issue which appears when assistant cites information from a file in the answer (with retrieval tool), please revise data model for this. Easy to reproduce. Thanks 🙏

@DeveloperZelentsov DeveloperZelentsov linked a pull request Dec 14, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants