Accept call
client.Live.Sessions.Accept(ctx, sessionID, body) error
POST/live/sessions/{session_id}/accept
Accept an incoming SIP call. Supply session with type live, the model, and startup configuration. Before accepting calls, follow the Live prompting guide to write frontend conversation instructions and a separate backend prompt. SIP media format is negotiated; omit audio.format.
Accept call
package main
import (
"context"
"github.com/openai/openai-go"
"github.com/openai/openai-go/live"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.Live.Sessions.Accept(
context.TODO(),
"session_id",
live.SessionAcceptParams{
Session: live.SessionAcceptParamsSession{
Model: "gpt-live-1",
Type: live.LiveLive,
},
},
)
if err != nil {
panic(err.Error())
}
}