Skip to content

Getting what seems like a response decode error #18

@kasperkronborg

Description

@kasperkronborg

Hi 👋

Awesome job with this library. I just have an issue following your example somewhat. The following code:

let assistant = try await self.client.assistantsApi.retrieve(by: "MY_ASSISTANT_ID")
                
let threadReq = ASACreateThreadRequest()
let thread = try await self.client.threadsApi.create(by: threadReq)

let msgReq = ASACreateMessageRequest(role: "user", content: "Hello World")
let msg = try await self.client.messagesApi.create(by: thread.id, createMessage: msgReq)

let runReq = ASACreateRunRequest(assistantId: assistant.id)
let run = try await self.client.runsApi.create(by: thread.id, createRun: runReq)

Gives me the following error:

keyNotFound(CodingKeys(stringValue: "code", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"code\", intValue: nil) (\"code\").", underlyingError: nil))

Could it be that something in the response of the AssistantAPI have changed that the code does no longer decode correctly?

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