microsoft-foundry.rest.security.o-auth2-auth
Conversations
Delete a conversation
DELETE
/openai/v1/conversations/{conversation_id}
Removes the specified conversation resource from the current project.
경로 매개 변수
conversation_id
string
필수
The id of the conversation to delete.
헤더 매개 변수
x-ms-user-identity
string
Opaque per-user identity string used to scope endpoint-scoped data to a specific end user. The caller must have the agents/endpoints/UserIdentityImpersonation/action RBAC permission.
응답
The request has succeeded.
본문
Content-Type: application/json
object
enum
필수
conversation.deleted
deleted
boolean
필수
id
string
필수
요청
curl -X DELETE https://api.openai.com/v1/conversations/conv_123 \
-H "Authorization: Bearer $OPENAI_API_KEY"
import OpenAI from "openai";
const client = new OpenAI();
const deleted = await client.conversations.delete("conv_123");
console.log(deleted);
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("OPENAI_API_KEY"), # This is the default and can be omitted
)
conversation_deleted_resource = client.conversations.delete(
"conv_123",
)
print(conversation_deleted_resource.id)
using System;
using OpenAI.Conversations;
OpenAIConversationClient client = new(
apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")
);
DeletedConversation deleted = client.DeleteConversation("conv_123");
Console.WriteLine(deleted.Id);
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted
});
const conversationDeletedResource = await client.conversations.delete('conv_123');
console.log(conversationDeletedResource.id);
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("My API Key"),
)
conversationDeletedResource, err := client.Conversations.Delete(context.TODO(), "conv_123")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v
", conversationDeletedResource.ID)
}
package com.openai.example;
import com.openai.client.OpenAIClient;
import com.openai.client.okhttp.OpenAIOkHttpClient;
import com.openai.models.conversations.ConversationDeleteParams;
import com.openai.models.conversations.ConversationDeletedResource;
public final class Main {
private Main() {}
public static void main(String[] args) {
OpenAIClient client = OpenAIOkHttpClient.fromEnv();
ConversationDeletedResource conversationDeletedResource = client.conversations().delete("conv_123");
}
}
require "openai"
openai = OpenAI::Client.new(api_key: "My API Key")
conversation_deleted_resource = openai.conversations.delete("conv_123")
puts(conversation_deleted_resource)
응답
{
"id": "conv_123",
"object": "conversation.deleted",
"deleted": true
}