@overmap-ai/core 1.0.53-add-agent-conversations.6 → 1.0.53-add-agent-conversations.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { BaseApiService } from "./BaseApiService";
2
- import { Payload, PromptAgentResponse } from "../../typings";
2
+ import { AgentUserConversation, Payload, PromptAgentResponse } from "../../typings";
3
3
  export declare class AgentService extends BaseApiService {
4
4
  /**
5
5
  * Prompt the agent with a message.
@@ -7,6 +7,7 @@ export declare class AgentService extends BaseApiService {
7
7
  * @param conversationId If continuing an existing message, the UUID of that conversation.
8
8
  */
9
9
  prompt(request: Payload<string>, conversationId?: string | null | undefined): Promise<PromptAgentResponse>;
10
+ get(conversationId: AgentUserConversation["offline_id"]): Promise<AgentUserConversation>;
10
11
  rate(responseId: string, rating: 1 | 5): Promise<undefined>;
11
12
  refreshStore(): Promise<void>;
12
13
  }
@@ -1,5 +1,5 @@
1
1
  import { PayloadAction, Reducer } from "@reduxjs/toolkit";
2
- import { AgentUserConversation, OfflineIdMapping, RootState, Selector } from "../../typings";
2
+ import { AgentUserConversation, Offline, OfflineIdMapping, RootState, Selector } from "../../typings";
3
3
  export interface AgentsState {
4
4
  conversations: OfflineIdMapping<AgentUserConversation>;
5
5
  }
@@ -7,8 +7,9 @@ export declare const agentsSlice: import("@reduxjs/toolkit").Slice<AgentsState,
7
7
  setConversations: (state: import("immer/dist/internal.js").WritableDraft<AgentsState>, action: PayloadAction<AgentUserConversation[]>) => void;
8
8
  addConversation: (state: import("immer/dist/internal.js").WritableDraft<AgentsState>, action: PayloadAction<AgentUserConversation>) => void;
9
9
  setConversation: (state: import("immer/dist/internal.js").WritableDraft<AgentsState>, action: PayloadAction<AgentUserConversation>) => void;
10
+ updateConversation: (state: import("immer/dist/internal.js").WritableDraft<AgentsState>, action: PayloadAction<Offline<Partial<AgentUserConversation>>>) => void;
10
11
  }, "agents">;
11
- export declare const setConversations: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentUserConversation[], "agents/setConversations">, addConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentUserConversation, "agents/addConversation">, setConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentUserConversation, "agents/setConversation">;
12
+ export declare const setConversations: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentUserConversation[], "agents/setConversations">, addConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentUserConversation, "agents/addConversation">, setConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<AgentUserConversation, "agents/setConversation">, updateConversation: import("@reduxjs/toolkit").ActionCreatorWithPayload<Offline<Partial<AgentUserConversation>>, "agents/updateConversation">;
12
13
  export declare const selectConversationMapping: (state: RootState) => OfflineIdMapping<AgentUserConversation>;
13
14
  export declare const selectConversations: Selector<AgentUserConversation[]>;
14
15
  export declare const selectConversation: (args: string) => (state: RootState) => AgentUserConversation | undefined;
@@ -10,24 +10,18 @@ export interface AgentProfile extends OptionalFileModel {
10
10
  */
11
11
  description: string;
12
12
  }
13
- export interface PromptAgentResponse {
13
+ export type PromptAgentResponse = {
14
14
  /**
15
- * The response from the agent.
15
+ * The response from the agent, including all TipTap concent, profile information, etc.
16
+ * Only returned for new conversations.
16
17
  */
17
- response: JSONContent[];
18
+ conversation: AgentUserConversation;
19
+ } | {
18
20
  /**
19
- * The UUID of the conversation.
21
+ * The response from the agent for existing conversations. Can be directly added to a TipTap editor.
20
22
  */
21
- conversation_id: string;
22
- /**
23
- * The UUID of the response (used when submitting ratings)
24
- */
25
- response_id: string;
26
- /**
27
- * The profile of the agent. Only included in the first response in a conversation.
28
- */
29
- profile?: AgentProfile;
30
- }
23
+ response: JSONContent;
24
+ };
31
25
  export interface AgentProfile extends OptionalFileModel {
32
26
  /**
33
27
  * The name of the agent.
@@ -38,7 +32,7 @@ export interface AgentProfile extends OptionalFileModel {
38
32
  */
39
33
  description: string;
40
34
  }
41
- export type AgentUserConversation = Offline<Omit<TimestampedModel, "updated_at">> & {
35
+ export interface AgentUserConversation extends Offline<TimestampedModel> {
42
36
  profile?: AgentProfile | null;
43
- tiptap_content: JSONContent[];
44
- };
37
+ tiptap_content?: JSONContent[];
38
+ }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core functionality for Overmap",
4
4
  "author": "Wôrdn Inc.",
5
5
  "license": "UNLICENSED",
6
- "version": "1.0.53-add-agent-conversations.6",
6
+ "version": "1.0.53-add-agent-conversations.7",
7
7
  "type": "module",
8
8
  "main": "dist/overmap-core.umd.cjs",
9
9
  "module": "dist/overmap-core.js",