Fork session
client.Live.Sessions.Fork(ctx, sessionID, body) (*SessionForkResponse, error)
POST/live/sessions/{session_id}/fork
Fork session
package main
import (
"context"
"fmt"
"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"),
)
response, err := client.Live.Sessions.Fork(
context.TODO(),
"session_id",
live.SessionForkParams{
Transport: live.SessionForkParamsTransport{
Sdp: "x",
},
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Session)
}
{
"session": {
"id": "id"
},
"transport": {
"sdp": "x",
"type": "webrtc"
}
}Returns Examples
{
"session": {
"id": "id"
},
"transport": {
"sdp": "x",
"type": "webrtc"
}
}