11wqe1 11 months ago
parent
commit
a3f05021e2
2 changed files with 40 additions and 77 deletions
  1. 25 57
      src/components/easy2/commpont/markScore.vue
  2. 15 20
      src/components/easy2/studyStudent.vue

+ 25 - 57
src/components/easy2/commpont/markScore.vue

@@ -243,46 +243,25 @@ export default {
     aiGet2(messages, callback) {
       // console.log(this.toolIndex, this.wIndex);
       let _this = this;
-      // let parm = {
-      //   assistant_id: "6063369f-289a-11ef-8bf4-12e77c4cb76b",
-      //   message: [
-      //     {
-      //       type: "text",
-      //       text: messages.replaceAll("\n", " ").replaceAll("*", "")
-      //     }
-      //   ],
-      //   session_name: uuidv4(),
-      //   userId: this.userid,
-      //   file_ids: ""
-      // };
+
       let params = {
-        // "model": "Chat",
-        model: "gpt-4o",
-        temperature: 0,
-        max_tokens: 4096,
-        top_p: 1,
-        frequency_penalty: 0,
-        presence_penalty: 0,
-        messages: [
-          {
-            content: messages.replaceAll("\n", " ").replaceAll("*", ""),
-            role: "user"
-          }
-        ],
-        stream: false,
-        uid: this.userid,
-        mind_map_question: ""
+        assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
+        message: [{"type":"text", "text":messages.replaceAll('\n', " ").replaceAll('*', "")}],
+        session_name: uuidv4(),
+        userId: this.userid,
+        file_ids: [],
+        model:'gpt-4o-2024-08-06'
       };
       this.ajax
-        .post("https://gpt4.cocorobo.cn/chat", params)
+        .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
         .then(response => {
           let data = response.data.FunctionResponse;
-          console.log("data", data);
-          if (data.choices && data.choices.length && data.choices[0].message) {
+          // console.log("data", data);
+          if (data.message) {
             let dArray = {};
             try {
               dArray = JSON.parse(
-                data.choices[0].message.content
+                data.message
                   .replaceAll("```json", "")
                   .replaceAll("```", "")
               );
@@ -291,7 +270,7 @@ export default {
               try {
                 let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
 
-                let match = data.choices[0].message.content.match(regex);
+                let match = data.message.match(regex);
                 dArray = JSON.parse(
                   match[0]
                     .replace(/\n/g, "")
@@ -301,7 +280,7 @@ export default {
               } catch (error) {
                 try {
                   dArray = JSON.parse(
-                    data.choices[0].message.content
+                    data.message
                       .replaceAll("```json", "")
                       .replaceAll("# Solution", "")
                       .replaceAll("```", "")
@@ -397,39 +376,28 @@ export default {
       let _this = this;
 
       let params = {
-        // "model": "Chat",
-        model: "gpt-4o",
-        temperature: 0,
-        max_tokens: 4096,
-        top_p: 1,
-        frequency_penalty: 0,
-        presence_penalty: 0,
-        messages: [
-          {
-            content: messages.replaceAll("\n", " ").replaceAll("*", ""),
-            role: "user"
-          }
-        ],
-        stream: false,
-        uid: this.userid,
-        mind_map_question: ""
+      
+        assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
+        message: [{"type":"text", "text":messages.replaceAll('\n', " ").replaceAll('*', "")}],
+        session_name: uuidv4(),
+        userId: this.userid,
+        file_ids: [],
+        model:'gpt-4o-2024-08-06'
       };
       return new Promise(resolve => {
         this.ajax
-          .post("https://gpt4.cocorobo.cn/chat", params)
+          .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
           .then(response => {
             let data = response.data.FunctionResponse;
             // console.log(data);
 
             if (
-              data.choices &&
-              data.choices.length &&
-              data.choices[0].message
+              data.message
             ) {
               let dArray = {};
               try {
                 dArray = JSON.parse(
-                  data.choices[0].message.content
+                  data.message
                     .replaceAll("```json", "")
                     .replaceAll("```", "")
                 );
@@ -438,7 +406,7 @@ export default {
                 try {
                   let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
 
-                  let match = data.choices[0].message.content.match(regex);
+                  let match = data.message.match(regex);
                   // console.log("dArray2", match);
                   dArray = JSON.parse(
                     match[0]
@@ -450,7 +418,7 @@ export default {
                 } catch (error) {
                   try {
                     dArray = JSON.parse(
-                      data.choices[0].message.content
+                      data.message
                         .replaceAll("```json", "")
                         .replaceAll("# Solution", "")
                         .replaceAll("```", "")

+ 15 - 20
src/components/easy2/studyStudent.vue

@@ -12037,6 +12037,7 @@ import scoreItem from '../scoreList/scoreItem.vue'
 import scoreZong from '../scoreZong/index.vue'
 import classRoomHelper from '../classRoomHelper/index.vue'
 import markScore from "./commpont/markScore";
+import { v4 as uuidv4 } from "uuid";
 
 const getFile = (url) => {
   return new Promise((resolve, reject) => {
@@ -12604,8 +12605,9 @@ export default {
         })
     },
     againEva(i,k){
+
       let msg = `NOTICE
-        Role: 你是一个专业的项目式学习导师,你要根据<评价维度>和<维度描述>制定具体的评价细则。
+        Role: 你是一个专业的项目式学习导师,你要根据制定标准资料中的评价维度和维度描述制定具体的评价细则。
         Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
         ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
         Instruction: Based on the context, follow "Format example", write content.
@@ -12628,32 +12630,25 @@ export default {
         5 星,问题或需求都被识别。 ==
         
         `
+
       let params = {
-        // "model": "Chat",
-        model: "gpt-4o",
-        temperature: 0,
-        max_tokens: 4096,
-        top_p: 1,
-        frequency_penalty: 0,
-        presence_penalty: 0,
-        messages: [
-          {
-            content: msg.replaceAll("\n", " ").replaceAll("*", ""),
-            role: "user"
-          }
-        ],
-        stream: false,
-        uid: this.userid,
-        mind_map_question: ""
+        assistant_id: 'f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b',
+        message: [{"type":"text", "text":msg.replaceAll('\n', " ").replaceAll('*', "")}],
+        session_name: uuidv4(),
+        userId: this.userid,
+        file_ids: [],
+        model:'gpt-4o-2024-08-06'
       };
+      console.log('params',params);
+      
       
         this.ajax
-          .post("https://gpt4.cocorobo.cn/chat", params)
+          .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", params)
           .then(response => {
             let data = response.data.FunctionResponse;
             console.log("data", data);
-            if (data.choices && data.choices.length && data.choices[0].message) {
-              let content = data.choices[0].message.content;
+            if (data.message) {
+              let content = data.message;
               
               var regex = new RegExp('==([^=]+)==');
               let match = content.match(regex);