Skip to content

[FEA]: Provide an async version of the /generate endpoint #223

Closed
@AnuradhaKaruppiah

Description

@AnuradhaKaruppiah

Is this a new feature, an improvement, or a change to existing functionality?

New Feature

How would you describe the priority of this feature request

High

Please provide a clear description of problem this feature solves

Provide an async POST endpoint for example "/generate/async/"

  1. For long running jobs the endpoint should return a job-id that can be polled via a GET endpoint for e.g. " "/generate/async/job/<>"
  2. Ideally the endpoint should be sync for up to "sync-timeout" seconds and fallback to async if the job doesn't complete by that time. When falling back to async it should return a job-id that can be polled.

Describe your ideal solution

A new endpoint "/generate/async" can be added for this purpose. Sample usage:
curl -X 'POST'
'http://localhost:8000/generate/async'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{"input_message": "What is LangSmith?,
"sync_timeout": 60"}'

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I have searched the open feature requests and have found no duplicates for this feature request

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions