(Prompt)
- CreateGenaiPrompt - Create a prompt
Create a prompt
package main
import(
"os"
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New(
unifiedgosdk.WithSecurity(os.Getenv("JWT")),
)
request := operations.CreateGenaiPromptRequest{
ConnectionID: "<value>",
}
ctx := context.Background()
res, err := s.Prompt.CreateGenaiPrompt(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.GenaiPrompt != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.CreateGenaiPromptRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.CreateGenaiPromptResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |