Skip to content

Issue deserializing RunSteps for file search #404

Closed
@averyaube

Description

@averyaube

Description

I have an assistant that uses the file search tool. When attempting to analyze the steps after a run, I receive the following error:

com.aallam.openai.api.exception.OpenAIHttpException: Illegal input: Serializer for subclass 'file_search' is not found in the polymorphic scope of 'ToolCallStep'.
Check if class with serial name 'file_search' exists and serializer is registered in a corresponding SerializersModule.
To be registered automatically, class 'file_search' has to be '@Serializable', and the base class 'ToolCallStep' has to be sealed and '@Serializable'.
JSON input: .....ousing act design manual.pdf","score":0.2420911092145576}]}}

Steps to Reproduce

  1. Create an assistant with the file_search tool enabled / a relevant VectorStore provided.
  2. Execute an assistant Run with a message that will trigger a file search
  3. Wait until the Run is completed
  4. Attempt to iterate through the run steps:
// It's possible the exception is thrown during this call and we don't even
// get to the step iteration below
val steps = client.runSteps(
    threadId = threadId,
    runId = run.id,
)

for (step in steps) {
    when (step.stepDetails) {
        is MessageCreationStepDetails -> {
            // I was extracting message content here     
        }
        else -> {}
    }
}

Environment

  • openai-kotlin version: 4.0.0-beta01
  • Kotlin version: 2.1.0
  • OS: Manjaro Linux

Additional Info

It seems like an additional subclass of ToolCallStep needs to be implemented for file search steps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions