How to setup parameter for batch endpoint #546
-
import requests inputs = {"input": {"age": age, "json_example": json_example_4_subject}} response = requests.post("http://localhost:8000/generate_subjects/batch", json=inputs) print(response.json()) In the above code, "invoke" is working BUT "batch" is not working. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
inputs needs to be a list inputs = [{"input": {"age": age, "json_example": json_example_4_subject}}] |
Beta Was this translation helpful? Give feedback.
-
inputs = [{"input": {"age": age, "json_example": json_example_4_subject}}] In server side: |
Beta Was this translation helpful? Give feedback.
-
I think the correct way should be.
the batch endpoint expects an object with a key "inputs" that has as a value a list of objects with the type the invoke endpoint expects. |
Beta Was this translation helpful? Give feedback.
I think the correct way should be.
the batch endpoint expects an object with a key "inputs" that has as a value a list of objects with the type the invoke endpoint expects.