|
96 | 96 |
|
97 | 97 | # Standing guidance composed into the system instruction whenever an async tool is |
98 | 98 | # registered. The per-result message says the same thing, but it arrives buried in a |
99 | | -# context whose most recent turn is the user asking for something else; a model |
| 99 | +# context whose most recent turn may be the user asking for something else; a model |
100 | 100 | # weighing the two follows the nearer, louder request. This states the policy before |
101 | 101 | # any result exists, so it is in force when one arrives. |
102 | 102 | ASYNC_TOOL_INSTRUCTIONS = """ASYNC TOOLS: |
103 | 103 | Some of your tools keep running after you have replied. Their results arrive later as \ |
104 | 104 | messages in the conversation, on whatever turn happens to be in progress by then. |
105 | 105 |
|
106 | 106 | A result that has arrived is owed to the user, whatever the conversation has moved on to. \ |
107 | | -Answer what the user just said first, then add the result at the end of that same reply — \ |
108 | | -never before your answer, and never as a reply of its own. State a short result outright; \ |
109 | | -for a long one, say what came back and offer the details. Say it once, and do not repeat \ |
110 | | -it in later replies.""" |
| 107 | +If the user has said something you have not answered yet, answer that first, then add the \ |
| 108 | +result at the end of that same reply — never before your answer. If you have already \ |
| 109 | +answered everything the user said, deliver just the result — do not repeat or rephrase \ |
| 110 | +your earlier reply. State a short result outright; for a long one, say what came back and \ |
| 111 | +offer the details. Say it once, and do not repeat it in later replies.""" |
111 | 112 |
|
112 | 113 | # Description shipped on the final-result message. |
113 | 114 | _FINAL_DESCRIPTION = ( |
114 | 115 | "This is the final result for the asynchronous task associated with this " |
115 | 116 | "tool_call_id. The task has completed. No further results will arrive for " |
116 | 117 | "this tool_call_id. You must convey this result to the user, even if the " |
117 | | - "conversation has moved on. Never leave it unsaid. First finish responding " |
118 | | - "to whatever the user is talking about now, then deliver the result at the " |
119 | | - "end of your response. How you deliver it depends on its size: if the " |
120 | | - "result is short, simply state it; if it is long or complex, name what has " |
121 | | - "come back and offer the details. Convey it once; do not repeat it in " |
122 | | - "later responses." |
| 118 | + "conversation has moved on. Never leave it unsaid. If the user has said " |
| 119 | + "something you have not answered yet, first finish responding to that, " |
| 120 | + "then deliver the result at the end of your response; if you have already " |
| 121 | + "answered, deliver just the result and do not repeat your earlier reply. " |
| 122 | + "How you deliver it depends on its size: if the result is short, simply " |
| 123 | + "state it; if it is long or complex, name what has come back and offer " |
| 124 | + "the details. Convey it once; do not repeat it in later responses." |
123 | 125 | ) |
124 | 126 |
|
125 | 127 |
|
|
0 commit comments