Skip to content

Commit 5a0213d

Browse files
committed
Remove unused input task submission methods
Deleted the submitInputTask methods from APIService and TaskService as they are no longer used. This helps clean up the codebase and reduces maintenance overhead.
1 parent 869f59b commit 5a0213d

File tree

2 files changed

+0
-60
lines changed

2 files changed

+0
-60
lines changed

src/frontend/src/api/apiService.tsx

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ export class APIService {
101101
private _cache = new APICache();
102102
private _requestTracker = new RequestTracker();
103103

104-
/**
105-
* Submit a new input task to generate a plan
106-
* @param inputTask The task description and optional session ID
107-
* @returns Promise with the response containing session and plan IDs
108-
*/
109-
async submitInputTask(inputTask: InputTask): Promise<InputTaskResponse> {
110-
return apiClient.post(API_ENDPOINTS.INPUT_TASK, inputTask);
111-
}
112104

113105
/**
114106
* Create a new plan with RAI validation
@@ -221,29 +213,6 @@ export class APIService {
221213
return fetcher();
222214
}
223215

224-
/**
225-
* Get steps for a specific plan
226-
* @param planId Plan ID
227-
* @param useCache Whether to use cached data or force fresh fetch
228-
* @returns Promise with array of steps
229-
*/
230-
async getSteps(planId: string, useCache = true): Promise<Step[]> {
231-
const cacheKey = `steps_${planId}`;
232-
233-
const fetcher = async () => {
234-
const data = await apiClient.get(`${API_ENDPOINTS.STEPS}/${planId}`);
235-
if (useCache) {
236-
this._cache.set(cacheKey, data, 30000); // Cache for 30 seconds
237-
}
238-
return data;
239-
};
240-
241-
if (useCache) {
242-
return this._requestTracker.trackRequest(cacheKey, fetcher);
243-
}
244-
245-
return fetcher();
246-
}
247216

248217
/**
249218
* Approve a plan for execution

src/frontend/src/services/TaskService.tsx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -167,35 +167,6 @@ export class TaskService {
167167

168168
return cleanedText;
169169
}
170-
/**
171-
* Submit an input task to create a new plan
172-
* @param description Task description
173-
* @returns Promise with the response containing session and plan IDs
174-
*/
175-
static async submitInputTask(
176-
description: string
177-
): Promise<InputTaskResponse> {
178-
const sessionId = this.generateSessionId();
179-
180-
const inputTask: InputTask = {
181-
session_id: sessionId,
182-
description: description,
183-
};
184-
185-
try {
186-
return await apiService.submitInputTask(inputTask);
187-
} catch (error: any) {
188-
// You can customize this logic as needed
189-
let message = "Failed to create task.";
190-
if (error?.response?.data?.message) {
191-
message = error.response.data.message;
192-
} else if (error?.message) {
193-
message = error.message?.detail ? error.message.detail : error.message;
194-
}
195-
// Throw a new error with a user-friendly message
196-
throw new Error(message);
197-
}
198-
}
199170

200171
/**
201172
* Create a new plan with RAI validation

0 commit comments

Comments
 (0)