Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu committed Sep 7, 2023
1 parent eb66a61 commit f92fc00
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
3 changes: 1 addition & 2 deletions front/lib/api/assistant/actions/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
} from "@app/lib/actions/registry";
import { runAction } from "@app/lib/actions/server";
import { generateActionInputs } from "@app/lib/api/assistant/agent";
import { ModelMessageType } from "@app/lib/api/assistant/generation";
import { Authenticator, prodAPICredentialsForOwner } from "@app/lib/auth";
import { front_sequelize } from "@app/lib/databases";
import { DustAPI } from "@app/lib/dust_api";
Expand Down Expand Up @@ -33,8 +34,6 @@ import {
UserMessageType,
} from "@app/types/assistant/conversation";

import { ModelMessageType } from "../generation";

/**
* TimeFrame parsing
*/
Expand Down
6 changes: 3 additions & 3 deletions front/lib/api/assistant/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ export type AgentGenerationSuccessEvent = {
};

// Event sent once the message is completed and successful.
export type AgentSuccessEvent = {
type: "agent_success";
export type AgentMessageSuccessEvent = {
type: "agent_message_success";
created: number;
configurationId: string;
generationId: string;
Expand All @@ -221,7 +221,7 @@ export async function* runAgent(
| AgentActionSuccessEvent
| GenerationTokensEvent
| AgentGenerationSuccessEvent
| AgentSuccessEvent
| AgentMessageSuccessEvent
> {
yield {
type: "agent_error",
Expand Down
11 changes: 5 additions & 6 deletions front/lib/api/assistant/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import {
AgentErrorEvent,
AgentGenerationSuccessEvent,
AgentMessageNewEvent,
AgentSuccessEvent,
AgentMessageSuccessEvent,
} from "@app/lib/api/assistant/agent";
import { GenerationTokensEvent } from "@app/lib/api/assistant/generation";
import { Authenticator } from "@app/lib/auth";
import { front_sequelize } from "@app/lib/databases";
import { AgentMessage, Message, UserMessage } from "@app/lib/models";
Expand All @@ -19,8 +20,6 @@ import {
UserMessageType,
} from "@app/types/assistant/conversation";

import { GenerationTokensEvent } from "./generation";

/**
* Conversation API
*/
Expand Down Expand Up @@ -54,7 +53,7 @@ export async function* postUserMessage(
| AgentActionSuccessEvent
| GenerationTokensEvent
| AgentGenerationSuccessEvent
| AgentSuccessEvent
| AgentMessageSuccessEvent
> {
const user = auth.user();

Expand Down Expand Up @@ -199,7 +198,7 @@ export async function* retryAgentMessage(
| AgentActionSuccessEvent
| GenerationTokensEvent
| AgentGenerationSuccessEvent
| AgentSuccessEvent
| AgentMessageSuccessEvent
> {
yield {
type: "agent_error",
Expand Down Expand Up @@ -234,7 +233,7 @@ export async function* editUserMessage(
| AgentActionSuccessEvent
| GenerationTokensEvent
| AgentGenerationSuccessEvent
| AgentSuccessEvent
| AgentMessageSuccessEvent
> {
yield {
type: "agent_error",
Expand Down

0 comments on commit f92fc00

Please sign in to comment.