A Golang client for Each. Each is a platform for deploying and combining machine learning models as APIs.
This library supports only Each Flow API.
go get github.com/eachlabs/each-go
package main
import (
"context"
"fmt"
each "github.com/eachlabs/eachgo"
)
func main() {
appCtx := context.Background()
client, err := each.NewClient(each.WithCredential("YOUR_API_KEY"))
if err != nil {
panic(err)
}
}
Each provides an AI workflow engine to orchestrate multiple models and data sources. You can create a chain flow multiple models and data sources together.
For more information, please refer to the Each Flow API documentation.
flowID := "flow id"
inputs := map[string]interface{}{
"input1": "value1",
"input2": "value2",
}
triggerID, err := client.TriggerFlow(ctx, flowID, inputs)
if err != nil {
panic(err)
}
fmt.Println(triggerID)
triggerID := "trigger id"
flowID := "flow id"
result, err := client.GetExecution(ctx, flowID, triggerID)
if err != nil {
panic(err)
}
fmt.Println(result)
flowID := "flow id"
results, err := client.GetExecutions(ctx, flowID)
if err != nil {
panic(err)
}
fmt.Println(results)
- Add tests
- Add more examples
- Add inference API support
- CI Integration