Commit d521c4b
committed
feat(tracer): enhance conditional imports and type hinting for OpenAI integration
- Improved conditional import handling for the `openai` library, ensuring graceful degradation when the library is not installed.
- Enhanced type hints using forward references for `openai` types to improve code clarity and maintainability.
- Added an informative error message when the `openai` library is missing, guiding users on how to install it.
- This update ensures better compatibility and user experience when working with optional dependencies in the OpenAI integration.1 parent 7639007 commit d521c4b
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
22 | | - | |
23 | | - | |
| 29 | + | |
| 30 | + | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
| |||
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
50 | 62 | | |
51 | 63 | | |
52 | 64 | | |
| |||
0 commit comments