Skip to content

Commit

Permalink
Fix: calling execute tasks is failing in AI agent
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmullapudi committed Nov 26, 2024
1 parent fa172bd commit 3ad23d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/webapp/src/modules/ai/conversation-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { defaultExtensions } from '@tegonhq/ui/components/ui/editor/editor-exten
import { AI } from '@tegonhq/ui/icons';
import { Editor } from '@tiptap/core';
import { observer } from 'mobx-react-lite';
import getConfig from 'next/config';
import React, { useEffect, useRef } from 'react';

import type { ConversationHistoryType } from 'common/types';
Expand All @@ -20,6 +21,8 @@ interface AIConversationItemProps {
conversationHistory: ConversationHistoryType;
}

const { publicRuntimeConfig } = getConfig();

export const ConversationItem = observer(
({ conversationHistory }: AIConversationItemProps) => {
const { user } = useUserData(conversationHistory.userId);
Expand Down Expand Up @@ -74,6 +77,7 @@ export const ConversationItem = observer(
variant="secondary"
onClick={() => {
runTasks({
baseHost: publicRuntimeConfig.NEXT_PUBLIC_AI_HOST,
conversationId: conversationHistory.conversationId,
conversationHistoryId: conversationHistory.id,
workspaceId: workspace.id,
Expand Down
4 changes: 3 additions & 1 deletion apps/webapp/src/services/conversations/run-tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@ interface MutationParams {
onError?: (error: any) => void;
}
interface RunTasksProps {
baseHost: string;
conversationId: string;
conversationHistoryId: string;
taskIds: string[];
workspaceId: string;
}

const runTasks = async ({
baseHost,
conversationId,
conversationHistoryId,
taskIds,
workspaceId,
}: RunTasksProps) => {
return axios({
url: `http://localhost:2000/chat`,
url: `${baseHost}/chat`,
withCredentials: true,
method: 'Post',
data: {
Expand Down

0 comments on commit 3ad23d5

Please sign in to comment.