.NET: AG-UI - passing extra data from the client to the server #3787
-
|
I'm writing this to see if anyone else has had any success doing this. I have a chat application using AG-UI. I have added the functionality to attach a document to a chat session (where it is parsed and vectorised), and I can query it successfully. However, I would like the ability to pass the file names (and ids) from the client to the server without including it in the chat message. This is so that when I execute my document search tool, I would like to be able to filter the search on filename (or id) ... so I'm not accidently querying the entire list of attached files (files are persisted for historical purposes). I've tried using 'AdditionalProperties' on So, I'm wondering if anyone has successfully passed extra data from the client to the server, via AG-UI, without including it in the message itself? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.

As a workaround I would wrap the prompt into a Json with required parameters, and in the agent's middleware I would deserialized the Json, use parameters as needed, replaced "
TextContentwith Json" with "TextContentwith prompt" and run the agent with this modified set of messages.