Skip to content

Commit 6f7cd6a

Browse files
Python: Add user agent to OpenAI and OpenAPI headers (#3488)
### Motivation and Context Replaces: #3074 This PR adds the User-Agent header "Semantic Kernel" to calls made to OpenAI/Azure OpenAI and OpenAPI calls. ### Description * Addition of telemetry.py file containing telemetry constants * ability to disable Azure/OpenAI telemetry with an environment variable called AZURE_TELEMETRY_DISABLED ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Devis Lucato <[email protected]>
1 parent 24e2419 commit 6f7cd6a

File tree

11 files changed

+350
-29
lines changed

11 files changed

+350
-29
lines changed

python/.vscode/extensions.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": [
5+
"littlefoxteam.vscode-python-test-adapter"
6+
]
7+
}

python/.vscode/launch.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Current File",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal",
13+
"justMyCode": true
14+
}
15+
]
16+
}

python/.vscode/settings.json

+6
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@
2323
],
2424
"python.testing.unittestEnabled": false,
2525
"python.testing.pytestEnabled": true,
26+
"pythonTestExplorer.testFramework": "pytest",
27+
"pythonTestExplorer.pytestPath": "poetry",
28+
"pythonTestExplorer.pytestArguments": [
29+
"run",
30+
"pytest"
31+
],
2632
}

0 commit comments

Comments
 (0)