public interface DifyConversationApiService
| 限定符和类型 | 方法和说明 |
|---|---|
retrofit2.Call<LittleResponse> |
deleteConversation(String conversationId,
SimpleUserRequest user)
删除会话
|
retrofit2.Call<ConversationListResponse> |
getConversations(String user,
String lastId,
Integer limit,
String sortBy)
获取会话列表
|
retrofit2.Call<ConversationVariablesResponse> |
getConversationVariables(String conversationId,
String user,
String lastId,
Integer limit,
String variableName)
获取对话变量
|
retrofit2.Call<ChatMessageListResponse> |
getMessages(String conversationId,
String user,
String firstId,
Integer limit) |
retrofit2.Call<Conversation> |
renameConversation(String conversationId,
RenameConversationRequest request)
会话重命名
|
@GET(value="conversations") retrofit2.Call<ConversationListResponse> getConversations(@Query(value="user") String user, @Query(value="last_id") String lastId, @Query(value="limit") Integer limit, @Query(value="sort_by") String sortBy)
@GET(value="messages") retrofit2.Call<ChatMessageListResponse> getMessages(@Query(value="conversation_id") String conversationId, @Query(value="user") String user, @Query(value="first_id") String firstId, @Query(value="limit") Integer limit)
@HTTP(method="DELETE",
path="conversations/{conversation_id}",
hasBody=true)
retrofit2.Call<LittleResponse> deleteConversation(@Path(value="conversation_id")
String conversationId,
@Body
SimpleUserRequest user)
conversationId - user - @POST(value="conversations/{conversation_id}/name")
retrofit2.Call<Conversation> renameConversation(@Path(value="conversation_id")
String conversationId,
@Body
RenameConversationRequest request)
conversationId - request - @GET(value="conversations/{conversation_id}/variables")
retrofit2.Call<ConversationVariablesResponse> getConversationVariables(@Path(value="conversation_id")
String conversationId,
@Query(value="user")
String user,
@Query(value="last_id")
String lastId,
@Query(value="limit")
Integer limit,
@Query(value="variable_name")
String variableName)
conversationId - 会话 ID。user - 用户标识,由开发者定义规则,需保证用户标识在应用内唯一lastId - 选填)当前页最后面一条记录的 ID,默认 null。limit - 一次请求返回多少条记录,默认 20 条,最大 100 条,最小 1 条。variableName - 选填)按变量名称筛选Copyright © 2025. All rights reserved.