Skip to content

resource key returned in the async api has a delay in creation #217

@Ishankoradia

Description

@Ishankoradia

Describe the bug
When async apis like POST collections/create and POST threads/start, they return a key in the response which is the resource_uuid. This uuid if used to fetch the info POST collection/info/:collection_id or GET threads/result/:thread_id, throws a 404 resource not found error since the resource has not been created in the db.

To Reproduce
Hit resource creation endpoint and then immediately the api for getting info for that resource. We wont see this in postman, but a quick python script should show this.

Expected behavior
Ideally, we should create the resource in db before returning the key POST collections/create and POST threads/start. The async tasks should do the long running tasks like vector store & assistance creation & then update references accordingly.

Or the service could return a generic id/key that is not tied to the resource and also a separate endpoint to poll on this id/key

Although adding a delay before fetching would solve it temporarily but its not scalable

Screenshots

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions