Skip to content

Post process for AI answer #14374

Answered by planger
wss29 asked this question in Q&A
Oct 30, 2024 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

Hi @wss29,

you just need to add the context (e.g. "Wheather report for Boise, ...") to the messages that are sent to the LLM, and there are several ways to do that in a chat agent.

The way that is closest to the "manual approach" you sketched is to overwrite invoke(request) in your chat agent and run custom code to obtain the additional context and add it to the request model before you call super. As input to your custom code (to take the user request into account), you can take the input parameter request, which contains the user request, or you can even access the entire chat session (request.session). To actually obtain the additional context, your custom code could

  • Run arbitrary cod…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@wss29
Comment options

@planger
Comment options

Answer selected by wss29
@wss29
Comment options

@planger
Comment options

@wss29
Comment options

@planger
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants