java/resources/conversations/methods/retrieve/index.md +0 −68 deleted
File Deleted View Diff
1## Retrieve a conversation
2
3`Conversation conversations().retrieve(ConversationRetrieveParamsparams = ConversationRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
4
5**get** `/conversations/{conversation_id}`
6
7Get a conversation
8
9### Parameters
10
11- `ConversationRetrieveParams params`
12
13 - `Optional<String> conversationId`
14
15### Returns
16
17- `class Conversation:`
18
19 - `String id`
20
21 The unique ID of the conversation.
22
23 - `long createdAt`
24
25 The time at which the conversation was created, measured in seconds since the Unix epoch.
26
27 - `JsonValue metadata`
28
29 Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.
30 Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.
31
32 - `JsonValue; object_ "conversation"constant`
33
34 The object type, which is always `conversation`.
35
36 - `CONVERSATION("conversation")`
37
38### Example
39
40```java
41package com.openai.example;
42
43import com.openai.client.OpenAIClient;
44import com.openai.client.okhttp.OpenAIOkHttpClient;
45import com.openai.models.conversations.Conversation;
46import com.openai.models.conversations.ConversationRetrieveParams;
47
48public final class Main {
49 private Main() {}
50
51 public static void main(String[] args) {
52 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
53
54 Conversation conversation = client.conversations().retrieve("conv_123");
55 }
56}
57```
58
59#### Response
60
61```json
62{
63 "id": "id",
64 "created_at": 0,
65 "metadata": {},
66 "object": "conversation"
67}
68```