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 72ba099
Show file tree
Hide file tree
Showing 15 changed files with 1,063 additions and 1,163 deletions.
26 changes: 12 additions & 14 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 @@ -167,7 +166,6 @@ export async function retrievalActionSpecification(
}

return {
id: configuration.id,
name: "search_data_sources",
description:
"Search the data sources specified by the user for information to answer their request." +
Expand Down Expand Up @@ -314,7 +312,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 +332,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 +352,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 +434,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 +451,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 +530,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 72ba099

Please sign in to comment.