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

Serialization exception while retrieving thread messages #368

Closed
meroving opened this issue Jul 16, 2024 · 1 comment · Fixed by #369
Closed

Serialization exception while retrieving thread messages #368

meroving opened this issue Jul 16, 2024 · 1 comment · Fixed by #369

Comments

@meroving
Copy link
Contributor

Description

Trying to get messages from assistant with included file_search function if response message has file citations, exception
exception: io.ktor.serialization.JsonConvertException: Illegal input: Field 'quote' is required for type with serial name 'com.aallam.openai.api.message.FileCitation', but it was missing at path: $.data[0].content[0].text.annotations[0].file_citation occured

Steps to Reproduce

  1. Create assistant with included vector store with files and file_search option
  2. Create and run thread with message about information stored in files (e.g with retrieval file info)
  3. after run is completed call method openai.messages(ThreadId(THREAD_ID))

Environment

  • openai-kotlin version: 3.8.1
  • Kotlin version:1.9.10
  • OS: macOS
@meroving
Copy link
Contributor Author

Format of file citation json
"annotations": [ { "type": "file_citation", "text": "【4:2†source】", "start_index": 343, "end_index": 355, "file_citation": { "file_id": "file-8FpXtQ1YmdB3I01fcAMjfQZQ" } },

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.

1 participant