microsoft / semantic-kernel

Integrate cutting-edge LLM technology quickly and easily into your apps
https://aka.ms/semantic-kernel
MIT License
21.26k stars 3.12k forks source link

.Net: Add Semantic Kernel to user agent and Semantic Kernel Version header to OpenAPI plugin requests #7363

Closed matthewbolanos closed 1 month ago

matthewbolanos commented 1 month ago

To allow downstream applications know that Semantic Kernel made an HTTP request from an OpenAPI plugin, we should provide the same headers and user agent as we do for Azure OpenAI

moonbox3 commented 1 month ago

We do this today in Python: https://github.com/microsoft/semantic-kernel/blob/0fda22e8f547e100e4dd9b8b1307142af42a251a/python/semantic_kernel/connectors/openapi_plugin/openapi_runner.py#L154C9-L157C1

matthewbolanos commented 1 month ago

@SergeyMenshykh, do we already do this in .NET?

markwallace-microsoft commented 1 month ago

Yes, we do this, here's the relevant code: https://github.com/microsoft/semantic-kernel/blob/main/dotnet/src/Functions/Functions.OpenApi/RestApiOperationRunner.cs#L187-L189

Note: This can be overridden.