Skip to content

Commit

Permalink
feat(fetchSimpleJob/fetchLevelJob)
Browse files Browse the repository at this point in the history
  • Loading branch information
martsimq committed Jul 19, 2024
1 parent aed77fb commit adfd469
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/api/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ const axiosInstance = createAxiosInstance(axiosConfig);
* 获取 Job
* @param data
*/
export function fetchJob(data: string) {
export function fetchSimpleJob(data: string) {
return axiosInstance.post("/gis_agent_backend/simple/task_plan/", data, {
headers: {
"Content-Type": "application/json",
},
});
}

export function fetchLevelJob(data: string) {
return axiosInstance.post(
"/gis_agent_backend/plan2level/task_plan/?modelName=gpt-4o",
data,
Expand Down
6 changes: 3 additions & 3 deletions src/store/job.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { defineStore } from "pinia";
import { job2G6TreeGraph, jobLeafNode2G6Graph } from "@/utils/graphUtil.ts";
import { computed } from "vue";
import { fetchJob } from "@/api";
import { fetchSimpleJob } from "@/api";

Check failure on line 4 in src/store/job.ts

View workflow job for this annotation

GitHub Actions / build (18.x, chrisgray0626/gis-agent-frontend, 0.2)

Module '"@/api"' has no exported member 'fetchSimpleJob'.
import { Task } from "@/type.ts";

export const useJobStore = defineStore("job", () => {
let _job: Task;

async function updateData(question: string) {
// const res = (await fetchJob(question)).data;
const res = (await fetchJob(`{ "task": "${question}" }`)).data;
const res = (await fetchSimpleJob(`{ "task": "${question}" }`)).data;
// const res = (await fetchLevelJob(`{ "task": "${question}" }`)).data;
console.debug("res", res);
_job = convertData(res.data);

Expand Down

0 comments on commit adfd469

Please sign in to comment.