You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the Pydantic model cannot be defined inside a function, as this will produce an error.
273
273
274
-
### "suggest" Attributs
274
+
### "suggest" Function
275
275
276
276
When you use the emulate function, an attribute is automatically attached. This attribute is a function giving you hints on how to improve your prompt, and a diagram visualization tool. This tool uses the default model to operate.
print(suggest(multpily)) # to have the raw message
293
+
print(multiply.diagram) # to have just the diagram
294
+
295
+
find_occurence_of_a_word.__suggest__(find_occurence_of_a_word) # same
293
296
print(find_occurence_of_a_word.advanced)
294
297
```
295
298
296
299
In this example, you can see that after calling the emulated function, we can call `suggest`, which takes as arguments the function object to which it is hooked. After that, we have four new attributes at our disposal:
297
300
-`enhanced prompt`: It's a proposal to improve the function's prompt.
298
301
-`review`: This is the analysis provided by the AI for its prompt improvement. Can be useful to understand its reasoning.
299
302
-`advanced`: Similar to `enhanced prompt` but adds an iteration. The AI will then try to solve advanced problems according to context or other factors. Especially useful in the most complex cases.
300
-
-`diagramm`: Gives a Mermaid diagram showing the stages of AI thinking. Useful if you want to try coding the function yourself.
303
+
-`diagram`: Gives a Mermaid diagram showing the stages of AI thinking. Useful if you want to try coding the function yourself.
301
304
302
305
You can also retrieve the entire LLM response by storing the output of the `suggest` function.
0 commit comments