Skip to content

Commit

Permalink
WIP rework everything
Browse files Browse the repository at this point in the history
  • Loading branch information
PopDaph committed Sep 8, 2023
1 parent d2f9d8e commit d9bb7a0
Show file tree
Hide file tree
Showing 15 changed files with 1,063 additions and 1,162 deletions.
25 changes: 12 additions & 13 deletions front/lib/api/assistant/actions/retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ import {
import { Err, Ok, Result } from "@app/lib/result";
import logger from "@app/logger/logger";
import {
AgentDataSourceConfigurationType,
isRetrievalConfiguration,
RetrievalActionType,
RetrievalConfigurationType,
RetrievalDocumentType,
TimeFrame,
} from "@app/types/assistant/actions/retrieval";
import { AgentActionSpecification } from "@app/types/assistant/agent";
import {
AgentActionSpecification,
AgentConfigurationType,
AgentFullConfigurationType,
} from "@app/types/assistant/agent";
AgentDataSourceConfigurationType,
isRetrievalConfiguration,
RetrievalConfigurationType,
} from "@app/types/assistant/configuration";
import {
AgentMessageType,
ConversationType,
Expand Down Expand Up @@ -314,7 +313,7 @@ export type RetrievalSuccessEvent = {
// error is expected to be stored by the caller on the parent agent message.
export async function* runRetrieval(
auth: Authenticator,
configuration: AgentFullConfigurationType,
configuration: AgentConfigurationType,
conversation: ConversationType,
userMessage: UserMessageType,
agentMessage: AgentMessageType
Expand All @@ -334,7 +333,7 @@ export async function* runRetrieval(
return yield {
type: "retrieval_error",
created: Date.now(),
configurationId: configuration.agent.sId,
configurationId: configuration.sId,
messageId: agentMessage.sId,
error: {
code: "internal_server_error",
Expand All @@ -354,7 +353,7 @@ export async function* runRetrieval(
return yield {
type: "retrieval_error",
created: Date.now(),
configurationId: configuration.agent.sId,
configurationId: configuration.sId,
messageId: agentMessage.sId,
error: {
code: "retrieval_parameters_generation_error",
Expand Down Expand Up @@ -436,7 +435,7 @@ export async function* runRetrieval(
return yield {
type: "retrieval_error",
created: Date.now(),
configurationId: configuration.agent.sId,
configurationId: configuration.sId,
messageId: agentMessage.sId,
error: {
code: "retrieval_search_error",
Expand All @@ -453,7 +452,7 @@ export async function* runRetrieval(
return yield {
type: "retrieval_error",
created: Date.now(),
configurationId: configuration.agent.sId,
configurationId: configuration.sId,
messageId: agentMessage.sId,
error: {
code: "retrieval_search_error",
Expand Down Expand Up @@ -532,15 +531,15 @@ export async function* runRetrieval(
yield {
type: "retrieval_documents",
created: Date.now(),
configurationId: configuration.agent.sId,
configurationId: configuration.sId,
messageId: agentMessage.sId,
documents,
};

yield {
type: "retrieval_success",
created: Date.now(),
configurationId: configuration.agent.sId,
configurationId: configuration.sId,
messageId: agentMessage.sId,
action: {
id: action.id,
Expand Down
6 changes: 2 additions & 4 deletions front/lib/api/assistant/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ import { runAction } from "@app/lib/actions/server";
import { Authenticator } from "@app/lib/auth";
import { Err, Ok, Result } from "@app/lib/result";
import { generateModelSId } from "@app/lib/utils";
import {
AgentActionSpecification,
AgentConfigurationType,
} from "@app/types/assistant/agent";
import { AgentActionSpecification } from "@app/types/assistant/agent";
import { AgentConfigurationType } from "@app/types/assistant/configuration";
import {
AgentActionType,
AgentMessageType,
Expand Down
283 changes: 0 additions & 283 deletions front/lib/api/assistant/agent/agent_create.ts

This file was deleted.

Loading

0 comments on commit d9bb7a0

Please sign in to comment.