feat(characters): support character-scoped conversations
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
ChatHistoryResponse,
|
||||
ChatSendResponse,
|
||||
SendMessageRequest,
|
||||
UnlockHistoryRequest,
|
||||
UnlockHistoryResponse,
|
||||
UnlockPrivateRequest,
|
||||
UnlockPrivateResponse,
|
||||
@@ -31,9 +32,13 @@ export class ChatApi {
|
||||
/**
|
||||
* 获取聊天历史
|
||||
*/
|
||||
async getHistory(limit = 50, offset = 0): Promise<ChatHistoryResponse> {
|
||||
async getHistory(
|
||||
characterId: string,
|
||||
limit = 50,
|
||||
offset = 0,
|
||||
): Promise<ChatHistoryResponse> {
|
||||
const env = await httpClient<ApiEnvelope<unknown>>(ApiPath.chatHistory, {
|
||||
query: { limit, offset },
|
||||
query: { characterId, limit, offset },
|
||||
});
|
||||
return ChatHistoryResponse.fromJson(
|
||||
unwrap(env) as Record<string, unknown>
|
||||
@@ -61,11 +66,14 @@ export class ChatApi {
|
||||
/**
|
||||
* 一键解锁历史锁定消息
|
||||
*/
|
||||
async unlockHistory(): Promise<UnlockHistoryResponse> {
|
||||
async unlockHistory(
|
||||
body: UnlockHistoryRequest,
|
||||
): Promise<UnlockHistoryResponse> {
|
||||
const env = await httpClient<ApiEnvelope<unknown>>(
|
||||
ApiPath.chatUnlockHistory,
|
||||
{
|
||||
method: "POST",
|
||||
body: body.toJson(),
|
||||
},
|
||||
);
|
||||
return UnlockHistoryResponse.fromJson(
|
||||
|
||||
Reference in New Issue
Block a user