go/resources/conversations/methods/delete/index.md +0 −58 deleted
File Deleted View Diff
1## Delete a conversation
2
3`client.Conversations.Delete(ctx, conversationID) (*ConversationDeletedResource, error)`
4
5**delete** `/conversations/{conversation_id}`
6
7Delete a conversation. Items in the conversation will not be deleted.
8
9### Parameters
10
11- `conversationID string`
12
13### Returns
14
15- `type ConversationDeletedResource struct{…}`
16
17 - `ID string`
18
19 - `Deleted bool`
20
21 - `Object ConversationDeleted`
22
23 - `const ConversationDeletedConversationDeleted ConversationDeleted = "conversation.deleted"`
24
25### Example
26
27```go
28package main
29
30import (
31 "context"
32 "fmt"
33
34 "github.com/openai/openai-go"
35 "github.com/openai/openai-go/option"
36)
37
38func main() {
39 client := openai.NewClient(
40 option.WithAPIKey("My API Key"),
41 )
42 conversationDeletedResource, err := client.Conversations.Delete(context.TODO(), "conv_123")
43 if err != nil {
44 panic(err.Error())
45 }
46 fmt.Printf("%+v\n", conversationDeletedResource.ID)
47}
48```
49
50#### Response
51
52```json
53{
54 "id": "id",
55 "deleted": true,
56 "object": "conversation.deleted"
57}
58```