Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,36 @@
"@codemirror/view": "^6.43.0",
"@ddietr/codemirror-themes": "1.5.2",
"@excalidraw/excalidraw": "^0.18.0",
"@haklex/rich-agent-core": "0.16.1",
"@haklex/rich-compose": "0.16.1",
"@haklex/rich-diff": "0.16.1",
"@haklex/rich-editor": "0.16.1",
"@haklex/rich-editor-ui": "0.16.1",
"@haklex/rich-ext-ai-agent": "0.16.1",
"@haklex/rich-ext-chat": "0.16.1",
"@haklex/rich-ext-code-snippet": "0.16.1",
"@haklex/rich-ext-embed": "0.16.1",
"@haklex/rich-ext-excalidraw": "0.16.1",
"@haklex/rich-ext-gallery": "0.16.1",
"@haklex/rich-ext-nested-doc": "0.16.1",
"@haklex/rich-plugin-block-handle": "0.16.1",
"@haklex/rich-plugin-floating-toolbar": "0.16.1",
"@haklex/rich-plugin-link-edit": "0.16.1",
"@haklex/rich-plugin-litexml-paste": "0.16.1",
"@haklex/rich-plugin-mention": "0.16.1",
"@haklex/rich-plugin-slash-menu": "0.16.1",
"@haklex/rich-plugin-table": "0.16.1",
"@haklex/rich-plugin-toolbar": "0.16.1",
"@haklex/rich-renderer-alert": "0.16.1",
"@haklex/rich-renderer-banner": "0.16.1",
"@haklex/rich-renderer-codeblock": "0.16.1",
"@haklex/rich-renderer-image": "0.16.1",
"@haklex/rich-renderer-katex": "0.16.1",
"@haklex/rich-renderer-linkcard": "0.16.1",
"@haklex/rich-renderer-mention": "0.16.1",
"@haklex/rich-renderer-mermaid": "0.16.1",
"@haklex/rich-renderer-ruby": "0.16.1",
"@haklex/rich-renderer-video": "0.16.1",
"@haklex/rich-agent-core": "0.18.0",
"@haklex/rich-compose": "0.18.0",
"@haklex/rich-diff": "0.18.0",
"@haklex/rich-editor": "0.18.0",
"@haklex/rich-editor-ui": "0.18.0",
"@haklex/rich-ext-ai-agent": "0.18.0",
"@haklex/rich-ext-chat": "0.18.0",
"@haklex/rich-ext-code-snippet": "0.18.0",
"@haklex/rich-ext-embed": "0.18.0",
"@haklex/rich-ext-excalidraw": "0.18.0",
"@haklex/rich-ext-gallery": "0.18.0",
"@haklex/rich-ext-nested-doc": "0.18.0",
"@haklex/rich-plugin-block-handle": "0.18.0",
"@haklex/rich-plugin-floating-toolbar": "0.18.0",
"@haklex/rich-plugin-link-edit": "0.18.0",
"@haklex/rich-plugin-litexml-paste": "0.18.0",
"@haklex/rich-plugin-mention": "0.18.0",
"@haklex/rich-plugin-slash-menu": "0.18.0",
"@haklex/rich-plugin-table": "0.18.0",
"@haklex/rich-plugin-toolbar": "0.18.0",
"@haklex/rich-renderer-alert": "0.18.0",
"@haklex/rich-renderer-banner": "0.18.0",
"@haklex/rich-renderer-codeblock": "0.18.0",
"@haklex/rich-renderer-image": "0.18.0",
"@haklex/rich-renderer-katex": "0.18.0",
"@haklex/rich-renderer-linkcard": "0.18.0",
"@haklex/rich-renderer-mention": "0.18.0",
"@haklex/rich-renderer-mermaid": "0.18.0",
"@haklex/rich-renderer-ruby": "0.18.0",
"@haklex/rich-renderer-video": "0.18.0",
"@lexical/markdown": "^0.44.0",
"@lexical/react": "^0.44.0",
"@lezer/highlight": "1.2.3",
Expand Down
25 changes: 12 additions & 13 deletions apps/admin/src/api/ai-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export interface AgentConversation {
updatedAt: string
}

export interface AgentTitleProjectionData {
messages?: Record<string, unknown>[]
model?: string | null
providerId?: string | null
}

export function createAgentConversation(data: {
messages?: Record<string, unknown>[]
model?: string | null
Expand All @@ -33,16 +39,6 @@ export function getAgentConversation(id: string) {
return getJson<AgentConversation>(`/ai/agent/conversations/${id}`)
}

export function appendAgentConversationMessages(
id: string,
messages: Record<string, unknown>[],
) {
return patchJson<AgentConversation, { messages: Record<string, unknown>[] }>(
`/ai/agent/conversations/${id}/messages`,
{ messages },
)
}

export function replaceAgentConversationMessages(
id: string,
messages: Record<string, unknown>[],
Expand Down Expand Up @@ -71,9 +67,12 @@ export function deleteAgentConversation(id: string) {
return deleteJson<void>(`/ai/agent/conversations/${id}`)
}

export function generateAgentConversationTitle(id: string) {
return postJson<AgentConversation, Record<string, never>>(
export function generateAgentConversationTitle(
id: string,
data: AgentTitleProjectionData = {},
) {
return postJson<AgentConversation, AgentTitleProjectionData>(
`/ai/agent/conversations/${id}/title`,
{},
data,
)
}
Loading