提示词没有设计好,因为这个的确算小众知识,如果要激发出来,提示词是关键。
我的测试是,本地 7B 左右的 LLM 基本没戏,激发也没用,已经吃不准了,而 qwen2.5 则没戏,估计是一点都没有学过。
7B 左右只有 gemma9B 经过二次提醒,能搞对顺序。30b 左右的基本能一次搞定。
[PPE(Programable Prompt Engine)](
https://github.com/offline-ai/cli)提示词如下:```yaml
---
parameters:
temperature: 0
---
system: |-
You are a helpful Unity programming expert in the world. You know the Unity knowledge very well. You are very careful and precise.
Think about the user's intention carefully and solve the problem step by step.
---
user: |-
Please tell me the order in which the following Unity events occur:
OnPointerUp Start Awake OnPointerDown OnBeginDrag OnDrag OnEndDrag
assistant: "[[AI]]"
```
`ai run unity.ai.yaml`的执行结果(gemma-27b):
```
user: Please tell me the order in which the following Unity events occur:
OnPointerUp Start Awake OnPointerDown OnBeginDrag OnDrag OnEndDrag
unity: Here's the order of those Unity events, along with a brief explanation of each:
1. **Awake:** This event is called once when the script instance is being loaded, before any Start functions are called.
2. **Start:** This event is called once at the beginning of the game, after all Awake functions have been called.
3. **OnPointerDown:** This event is triggered when the user starts pressing down on a UI element or a GameObject with a
Collider.
4. **OnBeginDrag:** This event is triggered when the user starts dragging the UI element or GameObject after pressing down.
5. **OnDrag:** This event is triggered continuously while the user is dragging the UI element or GameObject.
6. **OnPointerUp:** This event is triggered when the user releases the mouse button or touch input.
7. **OnEndDrag:** This event is triggered when the user finishes dragging the UI element or GameObject.
**Important Notes:**
* These events are typically used with UI elements or GameObjects that have colliders attached.
* The order can be slightly modified depending on specific user interactions and the setup of your UI or game.
Let me know if you have any other Unity event-related questions!
```
gemma9B 经过二次提醒的提示词:
```yaml
---
parameters:
temperature: 0
---
system: |-
You are a helpful Unity programming expert in the world. You know the Unity knowledge very well. You are very careful and precise.
Think about the user's intention carefully and solve the problem step by step.
---
user: |-
Please tell me the order in which the following Unity events occur:
OnPointerUp Start Awake OnPointerDown OnBeginDrag OnDrag OnEndDrag
assistant: "[[AI]]"
user: |-
Hint: Please think about OnPointerUp in Unity carefully.
assistant: "[[AI]]"
```
执行结果:
```
user: Please tell me the order in which the following Unity events occur:
OnPointerUp Start Awake OnPointerDown OnBeginDrag OnDrag OnEndDrag
unity: Here's the order in which those Unity events occur, along with a brief explanation of each:
1. **Awake:** This method is called once, when the script instance is being loaded. It's used to initialize variables and set up
initial conditions.
1. **Start:** This method is called once, after Awake, and before the first frame update. It's often used to perform setup tasks
that require access to the GameObject's components or other game objects.
1. **OnPointerDown:** This event is triggered when the user presses a mouse button or touches the screen over your GameObject.
2. **OnBeginDrag:** This event is triggered when the user starts dragging an object. This usually happens after `OnPointerDown`
and only if the object is set up to be draggable.
1. **OnDrag:** This event is triggered repeatedly while the user is dragging the object.
2. **OnEndDrag:** This event is triggered when the user releases the mouse button or lifts their finger from the screen, ending
the drag operation.
1. **OnPointerUp:** This event is triggered when the user releases the mouse button or lifts their finger from the screen. It
occurs after `OnEndDrag` if the drag operation was initiated.
**Important Notes:**
* The exact order of events can vary slightly depending on the specific Unity version and the context of the events.
* `OnPointerDown` and `OnPointerUp` are more general events that can occur for any interaction with the mouse or touch input.
`OnBeginDrag`, `OnDrag`, and `OnEndDrag` are specifically related to dragging operations.
Let me know if you have any other questions about Unity events or need further clarification!
user: Hint: Please think about OnPointerUp in Unity carefully.
unity: You're right, I need to be more careful about `OnPointerUp`.
While it's generally triggered when the user releases the mouse button or finger, it's not *always* directly after `OnEndDrag`.
Here's a more precise order, taking `OnPointerUp` into account:
1. **Awake:** Initialization of script variables.
2. **Start:** Setup tasks after Awake.
3. **OnPointerDown:** Mouse button pressed or touch initiated on the GameObject.
4. **OnBeginDrag:** Drag operation starts if the GameObject is set up for dragging.
5. **OnDrag:** Repeatedly triggered while dragging.
6. **OnPointerUp:** Triggered when the mouse button or finger is released.
* **Important:** This can happen *before* `OnEndDrag` if the user releases the button without completing the drag.
7. **OnEndDrag:** Triggered when the drag operation officially ends (usually after `OnPointerUp` if the drag was completed).
Let me know if you have any more questions!
```