How to Add a custom request header to the getCompletion method of the AIChatProtocolClient #70
markjones-WK
started this conversation in
General
Replies: 1 comment 8 replies
-
The sample is also here as well: https://github.com/microsoft/ai-chat-protocol/blob/main/samples/frontend/js/react/src/Chat.tsx |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to add a custom header to the getCompletion request of the AIChatProtocolClient and access that custom header in the chat controller in the web api. I am using this sample (react front end).
https://github.com/Azure-Samples/aspire-semantic-kernel-basic-chat-app
How do I do this?
I added a constant like this to the chat.tsx file:
and I added it to the getCompletion method call as follows:
However, when the chat controller in the backend webapi is called, I cannot see or access the request headers.
The chatControlller Task looks like this:
public async Task ProcessMessage(AIChatRequest request)
Beta Was this translation helpful? Give feedback.
All reactions