Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Deploying a Beam app as a REST API
RestAPI
Beam.Types
app.Trigger.RestAPI( inputs={"x": beam.Types.Float(), "y": beam.Types.Float()}, outputs={"sum": beam.Types.Float()}, handler="test.py:add_numbers", )
inputs
outputs
handler
curl -X POST --compressed "https://beam.slai.io/ahg0v" \ -H 'Accept: */*' \ -H 'Accept-Encoding: gzip, deflate' \ -H 'Authorization: Basic dW5kZWZpbmVkOnVuZGVmaW5lZA==' \ -H 'Connection: keep-alive' \ -H 'Content-Type: application/json' \ -d '{"prompt": "Here's my example prompt"}'
{ "result": { "prediction": "{'POSITIVE': 0.9988627433776855, 'NEGATIVE': 0.0011372779263183475}" }, "msg": "", "error_msg": "" }
beam.types.Json()
beam.types.String(max_length=None)
beam.types.Float()
beam.types.Boolean()
beam.types.Tensor(shape=None, dtype=None)
beam.types.Dataframe()
beam.types.NumpyArray(shape=None, dtype=None)
beam.types.Binary()
beam.types.Image(raw=False)
required=false
beam.types.Boolean(required=false)
beam.types.Dataframe(required=false)