The prejudice in people's hearts is like a mountain. No matter how hard you try, you can't move it. Looking back on it, three years isn't that long. Be quick to obey my command I'm the captain of my destiny, not heaven. If you ask me whether people can change their own destiny, I don't know. But defying fate is Nezha's destiny.
## Source: - The prejudice in people's hearts is like a mountain. No matter how hard you try, you can't move it. - Looking back on it, three years isn't that long. - Be quick to obey my command - I'm the captain of my destiny, not heaven. - If you ask me whether people can change their own destiny, I don't know. But defying fate is Nezha's destiny.
## Source: - The prejudice in people's hearts is like a mountain. No matter how hard you try, you can't move it. - Looking back on it, three years isn't that long. - Be quick to obey my command - I'm the captain of my destiny, not heaven. - If you ask me whether people can change their own destiny, I don't know. But defying fate is Nezha's destiny.
## Example: 1. 原文:Be quick to obey my command 意译:急急如律令 --- 2. 原文:Life is not long, but it's not short either. 意译:人生,说长不长,说短不短。
## Source: - The prejudice in people's hearts is like a mountain. No matter how hard you try, you can't move it. - Looking back on it, three years isn't that long. - Be quick to obey my command - I'm the captain of my destiny, not heaven. - If you ask me whether people can change their own destiny, I don't know. But defying fate is Nezha's destiny.
## Output: ### 直译 {直译}
*** ### 评估和反思 {评估和反思} ***
### 意译 {意译}
模型
方案一翻译结果:
方案二翻译结果:
方案三翻译结果:
gemini-2.0-flash
人心中的成见就像一座大山,任你怎么努力也无法搬动。
如今想来,三年光阴,也不算长。
还不快快听我号令!
我命由我定,不由天!
要问我人能否改变自己的命运,我不知道。但是,逆天而行,就是哪吒的命。
人心存偏见,如山岳难移。纵使竭尽全力,亦不可撼动分毫。
如今想来,三年光阴,弹指一挥间。
奉我号令,不得有误!
我命由我不由天!
若问世人能否逆天改命,吾不得而知。然,抗争宿命,乃哪吒之命也。
人心之偏见,如山岳岿然,纵移山填海,亦难撼其分毫。
事过境迁,三年光阴,亦不过弹指一挥间。
急急如律令
我命由我不由天!
若问人定胜天否,我亦茫然。然逆天而行,乃哪吒之宿命。
few shot这种开卷考试方法是大模型链路中一种重要的优化手段,few shot是提示词中为数不多能够动态变化的部分,且对模型整体效果影响较小,更为可控。 此外业务流量一般都是符合2:8分布的,且是可收敛的,可能只需要20%的few shot案例,就能满足80%的场景诉求。
from dotenv import load_dotenv from llama_index.core.agent import ReActAgent from llama_index.core.tools import FunctionTool from llama_index.llms.azure_openai import AzureOpenAI
defmultiply(a: int, b: int) -> int: """Multiply two integers and returns the result integer""" return a * b
defadd(a: int, b: int) -> int: """Add two integers and returns the result integer""" return a + b
defsubtract(a: int, b: int) -> int: """subtract two integers and returns the result integer""" return a - b
> Running step cba1a160-74c3-4e34-bcc4-88e6a678eaf9. Step input: What is 60-(20+(2*4))? Calculate step by step Thought: The current language of the user is: English. I need to use a tool to help me answer the question. To solve the expression \(60 - (20 + (2 * 4))\) step by step, I will first calculate the multiplication inside the parentheses. Action: multiply Action Input: {'a': 2, 'b': 4} Observation: 8
> Running step 5455108e-ac53-4115-8712-68f2457a9b82. Step input: None Thought: Now that I have the result of the multiplication, I can proceed to the next step, which is to add 20 and 8. Action: add Action Input: {'a': 20, 'b': 8} Observation: 28
> Running step 4d8fae00-83bd-4205-9993-f0e0119f408d. Step input: None Thought: Now that I have the result of the addition, I can proceed to the final step, which is to subtract 28 from 60. Action: subtract Action Input: {'a': 60, 'b': 28} Observation: 32
> Running step ce5d1075-ff11-47a2-b286-d7a715dc40ba. Step input: None Thought: I can answer without using any more tools. I'll use the user's language to answer. Answer: The result of the expression \(60 - (20 + (2 * 4))\) is 32.
上次有同学问,那么大模型在这种链路里面到底发挥了什么作用?
大模型最大的能力就是自然语言理解,我们可以尝试把规则再复杂化,输入改成张三代表减法,李四代表加法,王二代表乘法,What is 60张三(20李四(2王二4))? Calculate step by step,表现仍然可以,这就带来了对自然语言的容错,会像人一样去思考,而不是固定死的逻辑。
Thought: The current language of the user is English. I need to use a tool to help me answer the question. The expression given is 60张三(20李四(2王二4)), which translates to 60 - (20 + (2 * 4)). I will calculate step by step.
First, I need to calculate the multiplication part: 2王二4, which is 2 * 4. Action: multiply Action Input: {'a': 2, 'b': 4} Observation: 8
> Running step 48262cb8-5c3a-47b7-b13b-449787c27078. Step input: None Thought: The result of 2王二4 is 8. Now, I need to calculate the addition part: 20李四8, which is 20 + 8. Action: add Action Input: {'a': 20, 'b': 8} Observation: 28
> Running step 1cccd5c6-3d96-4014-a579-1c997765a1da. Step input: None Thought: The result of 20李四8 is 28. Now, I need to calculate the subtraction part: 60张三28, which is 60 - 28. Action: subtract Action Input: {'a': 60, 'b': 28} Observation: 32
> Running step 65d33d20-1009-4482-a6d2-7af20333640c. Step input: None Thought: I can answer without using any more tools. I'll use the user's language to answer. Answer: The result of 60张三(20李四(2王二4)) is 32.