diff --git a/src/backend/config/routers.py b/src/backend/config/routers.py index 79f988373a..e292f090e8 100644 --- a/src/backend/config/routers.py +++ b/src/backend/config/routers.py @@ -124,17 +124,6 @@ class RouterName(StrEnum): Depends(validate_organization_header), ], }, - RouterName.DEFAULT_AGENT: { - "default": [ - Depends(get_session), - Depends(validate_organization_header), - ], - "auth": [ - Depends(get_session), - Depends(validate_authorization), - Depends(validate_organization_header), - ], - }, RouterName.SNAPSHOT: { "default": [ Depends(get_session), diff --git a/src/backend/main.py b/src/backend/main.py index f500101078..9b79139eb4 100644 --- a/src/backend/main.py +++ b/src/backend/main.py @@ -13,7 +13,6 @@ ) from backend.config.routers import ROUTER_DEPENDENCIES from backend.config.settings import Settings -from backend.routers.agent import default_agent_router from backend.routers.agent import router as agent_router from backend.routers.auth import router as auth_router from backend.routers.chat import router as chat_router @@ -48,7 +47,6 @@ def create_app(): deployment_router, experimental_feature_router, agent_router, - default_agent_router, snapshot_router, organization_router, model_router, diff --git a/src/backend/routers/agent.py b/src/backend/routers/agent.py index 9aa4066c98..bd16455b22 100644 --- a/src/backend/routers/agent.py +++ b/src/backend/routers/agent.py @@ -52,7 +52,6 @@ ) router.name = RouterName.AGENT - @router.post( "", response_model=AgentPublic, @@ -663,10 +662,3 @@ async def delete_agent_file( get_file_service().delete_agent_file_by_id(session, agent_id, file_id, user_id, ctx) return DeleteAgentFileResponse() - - -# Default Agent Router -default_agent_router = APIRouter( - prefix="/v1/default_agent", -) -default_agent_router.name = RouterName.DEFAULT_AGENT diff --git a/src/backend/routers/chat.py b/src/backend/routers/chat.py index b074298e47..dd88fb1cb8 100644 --- a/src/backend/routers/chat.py +++ b/src/backend/routers/chat.py @@ -60,7 +60,6 @@ async def chat_stream( ctx, ) = process_chat(session, chat_request, request, ctx) - return EventSourceResponse( generate_chat_stream( session, diff --git a/src/backend/schemas/agent.py b/src/backend/schemas/agent.py index 14a556f386..5d8dc8441f 100644 --- a/src/backend/schemas/agent.py +++ b/src/backend/schemas/agent.py @@ -1,6 +1,6 @@ import datetime from enum import StrEnum -from typing import Any, Dict, Optional +from typing import Optional from pydantic import BaseModel, Field @@ -115,16 +115,6 @@ class ListAgentsResponse(BaseModel): agents: list[Agent] -class AgentTaskResponse(BaseModel): - task_id: str - status: str - result: Optional[Dict[str, Any]] = None - date_done: str - exception_snippet: Optional[str] = None - name: str - retries: int - - class UpdateAgentRequest(BaseModel): name: Optional[str] = None version: Optional[int] = None diff --git a/src/backend/services/agent.py b/src/backend/services/agent.py index 69f5d71da6..b160c17a25 100644 --- a/src/backend/services/agent.py +++ b/src/backend/services/agent.py @@ -6,7 +6,6 @@ from backend.database_models.agent import Agent, AgentToolMetadata from backend.database_models.database import DBSessionDep -TASK_TRACE_PREVIEW_LIMIT = 200 def validate_agent_exists(session: DBSessionDep, agent_id: str, user_id: str) -> Agent: agent = agent_crud.get_agent_by_id(session, agent_id, user_id) diff --git a/src/interfaces/assistants_web/src/app/tasks/[agentId]/page.tsx b/src/interfaces/assistants_web/src/app/tasks/[agentId]/page.tsx deleted file mode 100644 index b403b79ad2..0000000000 --- a/src/interfaces/assistants_web/src/app/tasks/[agentId]/page.tsx +++ /dev/null @@ -1,70 +0,0 @@ -'use client'; - -import { useAgent, useAgentTasks } from '@/hooks/use-agents'; - -type Props = { - params: { - agentId: string; - }; - searchParams: Record; -}; - -const Page = ({ params }: Props) => { - const agentId = params.agentId; - const { - data: agentTasks, - isLoading: isTaskLoading, - error: isTaskError, - } = useAgentTasks({ agentId }); - const { data: agent, isLoading, error } = useAgent({ agentId }); - - if (error || isTaskError) { - return
Error: {error?.message}
; - } - - if (isLoading || isTaskLoading) { - return
Loading...
; - } - - if (!agentTasks || agentTasks.length === 0) { - return ( -
-

Tasks report for {agent?.name}

-

No tasks yet

-
- ); - } - - return ( -
-

Tasks report for {agent?.name}

- - - - - - - - - - - - {(agentTasks || []).map((task) => ( - - - - - - - - ))} - -
Task IDTask NameTask StatusTask ResultException Snippet
{task.task_id}{task.name}{task.status}{task?.result ? JSON.stringify(task.result, null, 2) : ''}{task?.exception_snippet || ''}
-
- ); -}; - -export default Page; diff --git a/src/interfaces/assistants_web/src/cohere-client/client.ts b/src/interfaces/assistants_web/src/cohere-client/client.ts index d362daee42..43d182f69c 100644 --- a/src/interfaces/assistants_web/src/cohere-client/client.ts +++ b/src/interfaces/assistants_web/src/cohere-client/client.ts @@ -10,7 +10,7 @@ import { CohereUnauthorizedError, CreateAgentRequest, CreateSnapshotRequest, - CreateUser, + CreateUserV1UsersPostData, Fetch, ToggleConversationPinRequest, UpdateAgentRequest, @@ -206,10 +206,8 @@ export class CohereClient { return this.cohereService.default.getStrategiesV1AuthStrategiesGet(); } - public createUser(requestBody: CreateUser) { - return this.cohereService.default.createUserV1UsersPost({ - requestBody, - }); + public createUser(requestBody: CreateUserV1UsersPostData) { + return this.cohereService.default.createUserV1UsersPost(requestBody); } public async googleSSOAuth({ code }: { code: string }) { @@ -271,14 +269,6 @@ export class CohereClient { return this.cohereService.default.getAgentByIdV1AgentsAgentIdGet({ agentId }); } - public getAgentTasks(agentId: string) { - return this.cohereService.default.getAgentTasksV1AgentsAgentIdTasksGet({ agentId }); - } - - public getDefaultAgent() { - return this.cohereService.default.getDefaultAgentV1DefaultAgentGet(); - } - public createAgent(requestBody: CreateAgentRequest) { return this.cohereService.default.createAgentV1AgentsPost({ requestBody }); } diff --git a/src/interfaces/assistants_web/src/cohere-client/generated/services.gen.ts b/src/interfaces/assistants_web/src/cohere-client/generated/services.gen.ts index d957c4fc2b..f281bd5624 100644 --- a/src/interfaces/assistants_web/src/cohere-client/generated/services.gen.ts +++ b/src/interfaces/assistants_web/src/cohere-client/generated/services.gen.ts @@ -957,7 +957,7 @@ export class DefaultService { * Response: Synthesized audio file. * * Raises: - * HTTPException: If the message with the given ID is not found. + * HTTPException: If the message with the given ID is not found or synthesis fails. * @param data The data for the request. * @param data.conversationId * @param data.messageId diff --git a/src/interfaces/assistants_web/src/components/MessageRow/MessageRow.tsx b/src/interfaces/assistants_web/src/components/MessageRow/MessageRow.tsx index b9b1ffa300..00f1ddd4fe 100644 --- a/src/interfaces/assistants_web/src/components/MessageRow/MessageRow.tsx +++ b/src/interfaces/assistants_web/src/components/MessageRow/MessageRow.tsx @@ -12,10 +12,9 @@ import { LongPressMenu, } from '@/components/UI'; import { Breakpoint, useBreakpoint } from '@/hooks'; -import { useSettingsStore } from '@/stores'; import { useExperimentalFeatures } from '@/hooks/use-experimentalFeatures'; import { SynthesisStatus } from '@/hooks/use-synthesizer'; - +import { useSettingsStore } from '@/stores'; import { type ChatMessage, isAbortedMessage, @@ -68,7 +67,7 @@ export const MessageRow = forwardRef(function MessageRowI // For showing thinking steps const { showSteps } = useSettingsStore(); const [isStepsExpanded, setIsStepsExpanded] = useState(true); - + useEffect(() => { setIsStepsExpanded(showSteps); }, [showSteps]); diff --git a/src/interfaces/assistants_web/src/hooks/use-agents.ts b/src/interfaces/assistants_web/src/hooks/use-agents.ts index b84caa08a4..1ad4f2815b 100644 --- a/src/interfaces/assistants_web/src/hooks/use-agents.ts +++ b/src/interfaces/assistants_web/src/hooks/use-agents.ts @@ -70,35 +70,6 @@ export const useAgent = ({ agentId }: { agentId?: string }) => { }); }; -export const useAgentTasks = ({ agentId }: { agentId?: string }) => { - const cohereClient = useCohereClient(); - return useQuery({ - queryKey: ['agentTasks', agentId], - queryFn: async () => { - try { - if (!agentId) { - throw new Error('must have agent id'); - } - return await cohereClient.getAgentTasks(agentId); - } catch (e) { - console.error(e); - throw e; - } - }, - }); -}; - -export const useDefaultAgent = (enabled?: boolean) => { - const cohereClient = useCohereClient(); - return useQuery({ - queryKey: ['defaultAgent'], - enabled: enabled, - queryFn: async () => { - return await cohereClient.getDefaultAgent(); - }, - }); -}; - /** * @description Returns a function to check if an agent name is unique. */ diff --git a/src/interfaces/assistants_web/src/hooks/use-session.ts b/src/interfaces/assistants_web/src/hooks/use-session.ts index 935e3366c0..44df619635 100644 --- a/src/interfaces/assistants_web/src/hooks/use-session.ts +++ b/src/interfaces/assistants_web/src/hooks/use-session.ts @@ -72,9 +72,11 @@ export const useSession = () => { const registerMutation = useMutation({ mutationFn: async (params: RegisterParams) => { return cohereClient.createUser({ - fullname: params.name, - email: params.email, - password: params.password, + requestBody: { + fullname: params.name, + email: params.email, + password: params.password, + }, }); }, }); diff --git a/src/interfaces/coral_web/src/cohere-client/client.ts b/src/interfaces/coral_web/src/cohere-client/client.ts index 667aee6589..d0be521b42 100644 --- a/src/interfaces/coral_web/src/cohere-client/client.ts +++ b/src/interfaces/coral_web/src/cohere-client/client.ts @@ -240,10 +240,6 @@ export class CohereClient { return this.cohereService.default.getAgentByIdV1AgentsAgentIdGet({ agentId }); } - public getDefaultAgent() { - return this.cohereService.default.getDefaultAgentV1DefaultAgentGet(); - } - public createAgent(requestBody: CreateAgent) { return this.cohereService.default.createAgentV1AgentsPost({ requestBody }); } diff --git a/src/interfaces/coral_web/src/cohere-client/generated/services.gen.ts b/src/interfaces/coral_web/src/cohere-client/generated/services.gen.ts index 34ec6ca4d8..327547d147 100644 --- a/src/interfaces/coral_web/src/cohere-client/generated/services.gen.ts +++ b/src/interfaces/coral_web/src/cohere-client/generated/services.gen.ts @@ -39,7 +39,6 @@ import type { GetAgentByIdV1AgentsAgentIdGetResponse, GetConversationV1ConversationsConversationIdGetData, GetConversationV1ConversationsConversationIdGetResponse, - GetDefaultAgentV1DefaultAgentGetResponse, GetSnapshotV1SnapshotsLinkLinkIdGetData, GetSnapshotV1SnapshotsLinkLinkIdGetResponse, GetStrategiesV1AuthStrategiesGetResponse, @@ -1274,18 +1273,6 @@ export class DefaultService { }); } - /** - * Get Default Agent - * @returns GenericResponseMessage Successful Response - * @throws ApiError - */ - public getDefaultAgentV1DefaultAgentGet(): CancelablePromise { - return this.httpRequest.request({ - method: 'GET', - url: '/v1/default_agent/', - }); - } - /** * List Snapshots * List all snapshots. diff --git a/src/interfaces/coral_web/src/cohere-client/generated/types.gen.ts b/src/interfaces/coral_web/src/cohere-client/generated/types.gen.ts index e40ab589b3..d397df874a 100644 --- a/src/interfaces/coral_web/src/cohere-client/generated/types.gen.ts +++ b/src/interfaces/coral_web/src/cohere-client/generated/types.gen.ts @@ -847,8 +847,6 @@ export type DeleteAgentToolMetadataV1AgentsAgentIdToolMetadataAgentToolMetadataI export type DeleteAgentToolMetadataV1AgentsAgentIdToolMetadataAgentToolMetadataIdDeleteResponse = DeleteAgentToolMetadata; -export type GetDefaultAgentV1DefaultAgentGetResponse = GenericResponseMessage; - export type ListSnapshotsV1SnapshotsGetResponse = Array; export type CreateSnapshotV1SnapshotsPostData = { diff --git a/src/interfaces/coral_web/src/hooks/agents.ts b/src/interfaces/coral_web/src/hooks/agents.ts index e3f2d5598b..699906e729 100644 --- a/src/interfaces/coral_web/src/hooks/agents.ts +++ b/src/interfaces/coral_web/src/hooks/agents.ts @@ -61,17 +61,6 @@ export const useAgent = ({ agentId }: { agentId?: string }) => { }); }; -export const useDefaultAgent = (enabled?: boolean) => { - const cohereClient = useCohereClient(); - return useQuery({ - queryKey: ['defaultAgent'], - enabled: enabled, - queryFn: async () => { - return await cohereClient.getDefaultAgent(); - }, - }); -}; - /** * @description Returns a function to check if an agent name is unique. */