Commit 8061aa6
authored
Instrument tracing with
* add langsmith
* Update requirements and add async support for LLM completion
- Upgrade ZenML to version 0.74.0
- Add Pinecone, nest_asyncio, and asyncio to requirements
- Implement async version of get_completion_from_messages
- Add Langsmith callback for LLM requests
- Improve error handling for async completion
* Refactor Pinecone and import statements in populate_index and llm_utils
- Reorganize import statements in populate_index.py and llm_utils.py
- Remove redundant Pinecone import in populate_index.py
- Improve code formatting and import order
- Minor code cleanup and optimization
* Instrument langsmith tracing
* Add environment-specific tracing tags for Gradio deployment
- Import os module to handle environment variables
- Add APP_ENVIRONMENT variable with default "dev"
- Include tracing tags in predict function with environment contextlangfuse (#167)1 parent 6c61fd3 commit 8061aa6
File tree
7 files changed
+185
-45
lines changed- llm-complete-guide
- steps
- utils
7 files changed
+185
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
8 | | - | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| 16 | + | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
| |||
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
24 | 104 | | |
25 | 105 | | |
26 | 106 | | |
| |||
29 | 109 | | |
30 | 110 | | |
31 | 111 | | |
| 112 | + | |
32 | 113 | | |
33 | 114 | | |
34 | 115 | | |
35 | 116 | | |
36 | 117 | | |
37 | 118 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
44 | 135 | | |
45 | 136 | | |
46 | 137 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
238 | 242 | | |
239 | 243 | | |
240 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
55 | | - | |
56 | | - | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
| |||
642 | 646 | | |
643 | 647 | | |
644 | 648 | | |
645 | | - | |
| 649 | + | |
646 | 650 | | |
647 | 651 | | |
648 | 652 | | |
| |||
825 | 829 | | |
826 | 830 | | |
827 | 831 | | |
828 | | - | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
829 | 835 | | |
830 | 836 | | |
831 | 837 | | |
| |||
856 | 862 | | |
857 | 863 | | |
858 | 864 | | |
859 | | - | |
860 | | - | |
| 865 | + | |
| 866 | + | |
861 | 867 | | |
862 | 868 | | |
863 | 869 | | |
| |||
870 | 876 | | |
871 | 877 | | |
872 | 878 | | |
873 | | - | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
874 | 882 | | |
875 | 883 | | |
876 | 884 | | |
| |||
914 | 922 | | |
915 | 923 | | |
916 | 924 | | |
917 | | - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
918 | 928 | | |
919 | 929 | | |
920 | 930 | | |
| |||
0 commit comments