-
Hi But I did not understand the example with the lambda function
If I run this code
I get `user_proxy (to order_assistant): Use tool X if they are relevant. ` What is the use case for this type of message? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
@JieyuZ2 would you like to explain this use case? |
Beta Was this translation helpful? Give feedback.
-
The example is to show how to use the context mechanism. In general, the context mechanism allows you to change any user message in the conversation history. For example, the context could be
Then, the first message you send to the model could be
At certain turn of the conversation, you want to switch the
Then, when calling the LLM, the first message would be changed to One use case of this mechanism is, the initial message contains some useful but long information ( In my EcoAssistant project (https://github.com/JieyuZ2/EcoAssistant/), I append some demonstrations to the first message sent to the LLM, then in the subsequent conversation / calls of LLM, I turn off the demonstration in the first message to save the number of inputting tokens. Let me know if you have any question! |
Beta Was this translation helpful? Give feedback.
-
@JieyuZ2 I wonder if send and receive function can be used in an instance of autogen.GroupChat? Since the chat is managed by the group chat manager, is there a way to intervene the group chat? |
Beta Was this translation helpful? Give feedback.
The example is to show how to use the context mechanism. In general, the context mechanism allows you to change any user message in the conversation history. For example, the context could be
Then, the first message you send to the model could be
At certain turn of the conversation, you want to switch the
first message
tostr_a
only, you can sendThen, when calling the LLM, the first message would be changed to
str_a
only. (note: when using chat LLMs, every t…