chao 1 bulan lalu
induk
melakukan
10b3cd7c08
2 mengubah file dengan 32 tambahan dan 15 penghapusan
  1. 10 9
      blockly/blocks/python/ai.js
  2. 22 6
      src/python/AI/拼音识别.xml

+ 10 - 9
blockly/blocks/python/ai.js

@@ -12965,7 +12965,8 @@ Blockly.Python.set_pinyin_dict_create_with_items_insert = function (block) {
         var c = this.getFieldValue("KEY" + b);
         a[b] = c + block.getFieldValue("toneADD" + b + b);
     }
-    a = "{" + a.join(", ") + "}";
+    console.log(a.join(" "))
+    a = `"${a.join(" ")}"` ;
     return [a, Blockly.Python.ORDER_ATOMIC]
 };
 
@@ -13744,7 +13745,7 @@ sys.path.append("/root/")`
     from CocoPi import GPTrequest
 except:
     import sys
-    sys.path.append("/home/drivers/pylib/")
+    sys.path.append("/root/preset/drivers/pylib/")
     from GPTrequest import GPTrequest`
     Blockly.Python.definitions_['v831_import_CocoPi_Gpt_init'] = `gptInit = GPTrequest()`
     var code = ``;
@@ -13773,7 +13774,7 @@ sys.path.append("/root/")`
     from CocoPi import GPTrequest
 except:
     import sys
-    sys.path.append("/home/drivers/pylib/")
+    sys.path.append("/root/preset/drivers/pylib/")
     from GPTrequest import GPTrequest`
     Blockly.Python.definitions_['v831_import_CocoPi_Gpt_init'] = `gptInit = GPTrequest()`
     // Blockly.Python.addVariable("TextContent", `TextContent = ""`, true)
@@ -13808,7 +13809,7 @@ sys.path.append("/root/")`
     from CocoPi import GPTrequest
 except:
     import sys
-    sys.path.append("/home/drivers/pylib/")
+    sys.path.append("/root/preset/drivers/pylib/")
     from GPTrequest import GPTrequest`
     Blockly.Python.definitions_['v831_import_CocoPi_Gpt_init'] = `gptInit = GPTrequest()`
     var code = `gptInit.get_image_to_text(${text},${content})`;
@@ -13838,7 +13839,7 @@ sys.path.append("/root/")`
     from CocoPi import GPTrequest
 except:
     import sys
-    sys.path.append("/home/drivers/pylib/")
+    sys.path.append("/root/preset/drivers/pylib/")
     from GPTrequest import GPTrequest`
     Blockly.Python.definitions_['v831_import_CocoPi_Gpt_init'] = `gptInit = GPTrequest()`
     var code = `gptInit.get_text_to_voice(${text})`;
@@ -13881,7 +13882,7 @@ sys.path.append("/root/")`
     from CocoPi import GPTrequest
 except:
     import sys
-    sys.path.append("/home/drivers/pylib/")
+    sys.path.append("/root/preset/drivers/pylib/")
     from GPTrequest import GPTrequest`
     Blockly.Python.definitions_['v831_import_CocoPi_Gpt_init'] = `gptInit = GPTrequest()`
     var code = `gptInit.get_voice_to_text(${text})`;
@@ -13911,7 +13912,7 @@ sys.path.append("/root/")`
     from CocoPi import GPTrequest
 except:
     import sys
-    sys.path.append("/home/drivers/pylib/")
+    sys.path.append("/root/preset/drivers/pylib/")
     from GPTrequest import GPTrequest`
     Blockly.Python.definitions_['v831_import_CocoPi_Gpt_init'] = `gptInit = GPTrequest()`
     var code = `gptInit.get_post_chatgpt(${text})`;
@@ -14008,7 +14009,7 @@ sys.path.append("/root/")`
     from CocoPi import GPTrequest
 except:
     import sys
-    sys.path.append("/home/drivers/pylib/")
+    sys.path.append("/root/preset/drivers/pylib/")
     from GPTrequest import GPTrequest`
     Blockly.Python.definitions_['v831_import_CocoPi_Gpt_init'] = `gptInit = GPTrequest()`
     var code = `gptInit.get_post_AI_Intelligence(${text},${content})`
@@ -14041,7 +14042,7 @@ sys.path.append("/root/")`
     from CocoPi import GPTrequest
 except:
     import sys
-    sys.path.append("/home/drivers/pylib/")
+    sys.path.append("/root/preset/drivers/pylib/")
     from GPTrequest import GPTrequest`
     Blockly.Python.definitions_['v831_import_CocoPi_Gpt_init'] = `gptInit = GPTrequest()`
     var code = `gptInit.cocopi_chatGpt_AI_loading_more(${text},${content})`

+ 22 - 6
src/python/AI/拼音识别.xml

@@ -109,8 +109,12 @@
                                           </block>
                                         </value>
                                         <value name="B">
-                                          <block type="text" id="ryKg%{_p`FU4OEgt0I;#">
-                                            <field name="TEXT">lan2 se4</field>
+                                          <block type="set_pinyin_dict_create_with_items_insert" id="s!n|]$bR.APlANDcsV$b">
+                                            <mutation items="2"></mutation>
+                                            <field name="KEY0">lan</field>
+                                            <field name="toneADD00">2</field>
+                                            <field name="KEY1">se</field>
+                                            <field name="toneADD11">4</field>
                                           </block>
                                         </value>
                                       </block>
@@ -166,8 +170,12 @@
                                           </block>
                                         </value>
                                         <value name="B">
-                                          <block type="text" id="wX2N!!cGIGZ_pUTpEwcj">
-                                            <field name="TEXT">hong2 se4</field>
+                                          <block type="set_pinyin_dict_create_with_items_insert" id="K@s0Cv||q]Gfg~V$|!^:">
+                                            <mutation items="2"></mutation>
+                                            <field name="KEY0">hong</field>
+                                            <field name="toneADD00">2</field>
+                                            <field name="KEY1">se</field>
+                                            <field name="toneADD11">4</field>
                                           </block>
                                         </value>
                                       </block>
@@ -223,8 +231,16 @@
                                           </block>
                                         </value>
                                         <value name="B">
-                                          <block type="text" id="=y3El4!d[I1RBiow:Dmv">
-                                            <field name="TEXT">ke3 ke3 le4 bo2</field>
+                                          <block type="set_pinyin_dict_create_with_items_insert" id="r$MT:4B42QT@N`^,mVz$">
+                                            <mutation items="4"></mutation>
+                                            <field name="KEY0">ke</field>
+                                            <field name="toneADD00">3</field>
+                                            <field name="KEY1">ke</field>
+                                            <field name="toneADD11">3</field>
+                                            <field name="KEY2">le</field>
+                                            <field name="toneADD22">4</field>
+                                            <field name="KEY3">bo</field>
+                                            <field name="toneADD33">2</field>
                                           </block>
                                         </value>
                                       </block>