openai-sdk-helpers 0.4.3__py3-none-any.whl → 0.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openai_sdk_helpers/__init__.py +41 -7
- openai_sdk_helpers/agent/__init__.py +1 -2
- openai_sdk_helpers/agent/base.py +89 -173
- openai_sdk_helpers/agent/configuration.py +12 -20
- openai_sdk_helpers/agent/coordinator.py +14 -17
- openai_sdk_helpers/agent/runner.py +3 -45
- openai_sdk_helpers/agent/search/base.py +49 -71
- openai_sdk_helpers/agent/search/vector.py +82 -110
- openai_sdk_helpers/agent/search/web.py +103 -81
- openai_sdk_helpers/agent/summarizer.py +20 -28
- openai_sdk_helpers/agent/translator.py +17 -23
- openai_sdk_helpers/agent/validator.py +17 -23
- openai_sdk_helpers/errors.py +9 -0
- openai_sdk_helpers/extract/__init__.py +23 -0
- openai_sdk_helpers/extract/extractor.py +157 -0
- openai_sdk_helpers/extract/generator.py +476 -0
- openai_sdk_helpers/prompt/extractor_config_agent_instructions.jinja +6 -0
- openai_sdk_helpers/prompt/extractor_config_generator.jinja +37 -0
- openai_sdk_helpers/prompt/extractor_config_generator_instructions.jinja +9 -0
- openai_sdk_helpers/prompt/extractor_prompt_optimizer_agent_instructions.jinja +4 -0
- openai_sdk_helpers/prompt/extractor_prompt_optimizer_request.jinja +11 -0
- openai_sdk_helpers/response/__init__.py +2 -6
- openai_sdk_helpers/response/base.py +85 -94
- openai_sdk_helpers/response/configuration.py +39 -14
- openai_sdk_helpers/response/files.py +2 -0
- openai_sdk_helpers/response/runner.py +1 -48
- openai_sdk_helpers/response/tool_call.py +0 -141
- openai_sdk_helpers/response/vector_store.py +8 -5
- openai_sdk_helpers/streamlit_app/app.py +1 -1
- openai_sdk_helpers/structure/__init__.py +16 -0
- openai_sdk_helpers/structure/base.py +239 -278
- openai_sdk_helpers/structure/extraction.py +1228 -0
- openai_sdk_helpers/structure/plan/plan.py +0 -20
- openai_sdk_helpers/structure/plan/task.py +0 -33
- openai_sdk_helpers/structure/prompt.py +16 -0
- openai_sdk_helpers/structure/responses.py +2 -2
- openai_sdk_helpers/structure/web_search.py +0 -10
- openai_sdk_helpers/tools.py +346 -99
- openai_sdk_helpers/utils/__init__.py +7 -0
- openai_sdk_helpers/utils/json/base_model.py +315 -32
- openai_sdk_helpers/utils/langextract.py +194 -0
- {openai_sdk_helpers-0.4.3.dist-info → openai_sdk_helpers-0.5.0.dist-info}/METADATA +18 -4
- {openai_sdk_helpers-0.4.3.dist-info → openai_sdk_helpers-0.5.0.dist-info}/RECORD +46 -37
- openai_sdk_helpers/streamlit_app/streamlit_web_search.py +0 -75
- {openai_sdk_helpers-0.4.3.dist-info → openai_sdk_helpers-0.5.0.dist-info}/WHEEL +0 -0
- {openai_sdk_helpers-0.4.3.dist-info → openai_sdk_helpers-0.5.0.dist-info}/entry_points.txt +0 -0
- {openai_sdk_helpers-0.4.3.dist-info → openai_sdk_helpers-0.5.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,77 +1,86 @@
|
|
|
1
|
-
openai_sdk_helpers/__init__.py,sha256=
|
|
1
|
+
openai_sdk_helpers/__init__.py,sha256=8I469KuzrbAjhNX2A5UnYt_kSmjXqQbfHectTeUx7TI,5163
|
|
2
2
|
openai_sdk_helpers/cli.py,sha256=BDc08NqWVfL4GBekxMfN5IPPB4pmN1Od9sVpKtIJRZk,8025
|
|
3
3
|
openai_sdk_helpers/environment.py,sha256=mNoswzIdv37tTRhFwA2B6_Onxsm7vhfjPArfwhYuL7g,1825
|
|
4
|
-
openai_sdk_helpers/errors.py,sha256=
|
|
4
|
+
openai_sdk_helpers/errors.py,sha256=ZclLp94o08fSsFNjFn_yrX9yTjw1RE0v7A5T1hBChUc,2925
|
|
5
5
|
openai_sdk_helpers/files_api.py,sha256=uMKHvGg1Od0J95Izl3AG9ofQYq8EDJXEty7zP0oKjJM,12569
|
|
6
6
|
openai_sdk_helpers/logging.py,sha256=JcR0FTWht1tYdwD-bXH835pr0JV0RwHfY3poruiZGHM,795
|
|
7
7
|
openai_sdk_helpers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
openai_sdk_helpers/settings.py,sha256=xK_u0YNKgtPrLrZrVr4F4k0CvSuYbsmkqqw9mCMdyF8,10932
|
|
9
|
-
openai_sdk_helpers/tools.py,sha256=
|
|
9
|
+
openai_sdk_helpers/tools.py,sha256=8hhcytpmDfoXV16UQbDmDVV0rhLOn8c_VjXO8XaTFLQ,19000
|
|
10
10
|
openai_sdk_helpers/types.py,sha256=ejCG0rYqJhjOQvKLoNnzq-TzcKCFt69GVfi7y805NkU,1451
|
|
11
|
-
openai_sdk_helpers/agent/__init__.py,sha256=
|
|
12
|
-
openai_sdk_helpers/agent/base.py,sha256=
|
|
13
|
-
openai_sdk_helpers/agent/configuration.py,sha256=
|
|
14
|
-
openai_sdk_helpers/agent/coordinator.py,sha256=
|
|
15
|
-
openai_sdk_helpers/agent/runner.py,sha256=
|
|
16
|
-
openai_sdk_helpers/agent/summarizer.py,sha256
|
|
17
|
-
openai_sdk_helpers/agent/translator.py,sha256=
|
|
11
|
+
openai_sdk_helpers/agent/__init__.py,sha256=SRz8WupyS89c7sYML2hkwZLkIu6zczyI9MVyDWAHK1w,1040
|
|
12
|
+
openai_sdk_helpers/agent/base.py,sha256=y2LEkg4AVqNZQ_OPAn5yTy4x8lREq8tJPaUwAYTNHQY,24065
|
|
13
|
+
openai_sdk_helpers/agent/configuration.py,sha256=FU3xnb8-8qoezLW47WwxZg7z2AxNXRW1Svl0FMsk8kc,14244
|
|
14
|
+
openai_sdk_helpers/agent/coordinator.py,sha256=lVjA0yI-GhGKlqbNR_k9GOCrUjFoZ0QoqRaafHckyME,18052
|
|
15
|
+
openai_sdk_helpers/agent/runner.py,sha256=l2NPS9VA9d4RISuBfanFfKxXNYSHQ7MTjRsuzx4APls,3473
|
|
16
|
+
openai_sdk_helpers/agent/summarizer.py,sha256=-yVm-KdTvGRXGj1MlEikTAFYVlPoovLNIL3Tc_WYIzs,3653
|
|
17
|
+
openai_sdk_helpers/agent/translator.py,sha256=6Gj1cqT-W5j32F14sY9kOCFQenq_odceu2fi8hud_Z0,5970
|
|
18
18
|
openai_sdk_helpers/agent/utils.py,sha256=DTD5foCqGYfXf13F2bZMYIQROl7SbDSy5GDPGi0Zl-0,1089
|
|
19
|
-
openai_sdk_helpers/agent/validator.py,sha256=
|
|
19
|
+
openai_sdk_helpers/agent/validator.py,sha256=krktzjaHhEprn76F7hD4cH6H2CwucmFN1KWJ_vjl01g,4774
|
|
20
20
|
openai_sdk_helpers/agent/search/__init__.py,sha256=LXXzEcX2MU7_htHRdRCGPw0hsr9CrZn0ESii7GZJMBw,806
|
|
21
|
-
openai_sdk_helpers/agent/search/base.py,sha256=
|
|
22
|
-
openai_sdk_helpers/agent/search/vector.py,sha256=
|
|
23
|
-
openai_sdk_helpers/agent/search/web.py,sha256=
|
|
21
|
+
openai_sdk_helpers/agent/search/base.py,sha256=BonbNL7yAQyImhPTrsxZs5axLmaTbwjVGdADNYQaEvY,9764
|
|
22
|
+
openai_sdk_helpers/agent/search/vector.py,sha256=7GoDwvarwyIJIYlP-JpMyH1XokInNalRUJT0HNdQMBk,14130
|
|
23
|
+
openai_sdk_helpers/agent/search/web.py,sha256=vwBKmLNhE6PGswQPjr-sTOPfPURLlwlX7Wm1ysY6w7U,11502
|
|
24
24
|
openai_sdk_helpers/enums/__init__.py,sha256=aFf79C4JBeLC3kMlJfSpehyjx5uNCtW6eK5rD6ZFfhM,322
|
|
25
25
|
openai_sdk_helpers/enums/base.py,sha256=cNllDtzcgI0_eZYXxFko14yhxwicX6xbeDfz9gFE3qo,2753
|
|
26
|
+
openai_sdk_helpers/extract/__init__.py,sha256=T8xtBEm_Mlu5SeXVn4Qv87uGDXed9L0JQaY_gryR1CQ,734
|
|
27
|
+
openai_sdk_helpers/extract/extractor.py,sha256=vmRJyhKDEYAVfRk0KMgLH5hTqUfDAUyWBug5gR3yzcc,5313
|
|
28
|
+
openai_sdk_helpers/extract/generator.py,sha256=K9Euq0IaWs82oe5aRm73_18DelLKYyuH8VhfZ1_ZCEU,14695
|
|
26
29
|
openai_sdk_helpers/prompt/__init__.py,sha256=MOqgKwG9KLqKudoKRlUfLxiSmdOi2aD6hNrWDFqLHkk,418
|
|
27
30
|
openai_sdk_helpers/prompt/base.py,sha256=6X0zeopEvO0ba8207O8Nnj1QvFZEZier7kNNh4qkcmE,7782
|
|
31
|
+
openai_sdk_helpers/prompt/extractor_config_agent_instructions.jinja,sha256=vCrsoUnsgHWSr7OS_ojMUjmPtHfbyv9bzKfaMaCJ99E,329
|
|
32
|
+
openai_sdk_helpers/prompt/extractor_config_generator.jinja,sha256=9rZ1PZdoQtnxDxFUlKRb0SooIEfNw4_Em99n9xvFyyU,960
|
|
33
|
+
openai_sdk_helpers/prompt/extractor_config_generator_instructions.jinja,sha256=GqV3DrGObyER_Fa-GMGGqhWBrQIH9FFlyKdgTjidyzg,534
|
|
34
|
+
openai_sdk_helpers/prompt/extractor_prompt_optimizer_agent_instructions.jinja,sha256=vDCXs1segU-9w9f5Fjp2PfWoXUeOeYw8SBLkAKS8plo,129
|
|
35
|
+
openai_sdk_helpers/prompt/extractor_prompt_optimizer_request.jinja,sha256=YC5uY18CeEXwlnWXOD-vke0npd7Mk-BHRBLjvQzq5lk,280
|
|
28
36
|
openai_sdk_helpers/prompt/summarizer.jinja,sha256=jliSetWDISbql1EkWi1RB8-L_BXUg8JMkRRsPRHuzbY,309
|
|
29
37
|
openai_sdk_helpers/prompt/translator.jinja,sha256=SZhW8ipEzM-9IA4wyS_r2wIMTAclWrilmk1s46njoL0,291
|
|
30
38
|
openai_sdk_helpers/prompt/validator.jinja,sha256=6t8q_IdxFd3mVBGX6SFKNOert1Wo3YpTOji2SNEbbtE,547
|
|
31
39
|
openai_sdk_helpers/prompt/vector_planner.jinja,sha256=szzuJu6ZawYWuARgQn4DykBLigHfCd0lKYM-GRgoR30,282
|
|
32
40
|
openai_sdk_helpers/prompt/vector_search.jinja,sha256=KPEYQDRKsUesadSyQcBBiqYQEDL1NLN6BQsqw-GcKMA,249
|
|
33
41
|
openai_sdk_helpers/prompt/vector_writer.jinja,sha256=q5osfexGvt1xn8ZPtBWUP36n_1HK_Ziu8dkmCZDVamc,342
|
|
34
|
-
openai_sdk_helpers/response/__init__.py,sha256=
|
|
35
|
-
openai_sdk_helpers/response/base.py,sha256=
|
|
36
|
-
openai_sdk_helpers/response/configuration.py,sha256=
|
|
37
|
-
openai_sdk_helpers/response/files.py,sha256=
|
|
42
|
+
openai_sdk_helpers/response/__init__.py,sha256=YFrGpnMIfatnLWXAZgZDMvDx7Yjsqjat8W9INxKuPxY,1728
|
|
43
|
+
openai_sdk_helpers/response/base.py,sha256=pZYc2YpIzg9fYP98XqVN_sTDGRpgqd-UvrBZLfUw0KQ,34791
|
|
44
|
+
openai_sdk_helpers/response/configuration.py,sha256=jxneKd7oj08D40ceOWETB3TeUHd7Cnz-ooQp0akI9fA,10465
|
|
45
|
+
openai_sdk_helpers/response/files.py,sha256=zv5MpYZYHDBum4q9RJH_mVdnKHKOB72EB4nZwTwnlbU,13295
|
|
38
46
|
openai_sdk_helpers/response/messages.py,sha256=qX3sW79rLuJEys28zyv5MovZikwGOaLevzdVN0VYMRE,10104
|
|
39
47
|
openai_sdk_helpers/response/planner.py,sha256=AuNMZkd4TGnvybSJaf2iMbvfPINbusrWucWBk2uQN_g,340
|
|
40
48
|
openai_sdk_helpers/response/prompter.py,sha256=TLRLmNwPcxaaB_X76BbvwXlphducPKYVbn-afTqN2Rk,344
|
|
41
|
-
openai_sdk_helpers/response/runner.py,sha256=
|
|
42
|
-
openai_sdk_helpers/response/tool_call.py,sha256=
|
|
43
|
-
openai_sdk_helpers/response/vector_store.py,sha256=
|
|
49
|
+
openai_sdk_helpers/response/runner.py,sha256=3VmWY5du5iBwjVU9D0n2hexu61f561m2iTvhkmq30rc,2932
|
|
50
|
+
openai_sdk_helpers/response/tool_call.py,sha256=Y0ub14WJyuVyj9gRdnHFH2e-ezkfhJ9nnMlkubMKdug,2938
|
|
51
|
+
openai_sdk_helpers/response/vector_store.py,sha256=HClp6O_g20uklQTY7trC4age3rtDmrt3tuvrl93xIf4,3222
|
|
44
52
|
openai_sdk_helpers/streamlit_app/__init__.py,sha256=3yAkl6qV71cqtT5YFZuC9Bkqit0NtffDV6jmMWpT1k4,812
|
|
45
|
-
openai_sdk_helpers/streamlit_app/app.py,sha256=
|
|
53
|
+
openai_sdk_helpers/streamlit_app/app.py,sha256=YbCMOOjrC4rxqQP09WcFnHnfpIYYXn-9Tn-NBRGjFJI,17502
|
|
46
54
|
openai_sdk_helpers/streamlit_app/configuration.py,sha256=0KeJ4HqCNFthBHsedV6ptqHluAcTPBb5_TujFOGkIUU,16685
|
|
47
|
-
openai_sdk_helpers/
|
|
48
|
-
openai_sdk_helpers/structure/__init__.py,sha256=jROw0IbXYVRD2Eb3dBMsB6amQZrX8X7XSgGh_zjsZWc,3469
|
|
55
|
+
openai_sdk_helpers/structure/__init__.py,sha256=JRdhEFPLDwty8tuAzCmep59RSknorZ4Dd7cyqonOi4Q,3891
|
|
49
56
|
openai_sdk_helpers/structure/agent_blueprint.py,sha256=VyJWkgPNzAYKRDMeR1M4kE6qqQURnwqtrrEn0TRJf0g,9698
|
|
50
|
-
openai_sdk_helpers/structure/base.py,sha256=
|
|
51
|
-
openai_sdk_helpers/structure/
|
|
52
|
-
openai_sdk_helpers/structure/
|
|
57
|
+
openai_sdk_helpers/structure/base.py,sha256=nYViUME9pvzMRFIvNORTgwNFcjJdCjd4R1mLMo0nMSM,24822
|
|
58
|
+
openai_sdk_helpers/structure/extraction.py,sha256=wODP0iLAhhsdQkMWRYPYTiLUMU8bFMKiBjPl3PKUleg,37335
|
|
59
|
+
openai_sdk_helpers/structure/prompt.py,sha256=ZfsaHdA0hj5zmZDrOdpXjCsC8U-jjzwFG4JBsWYiaH4,1535
|
|
60
|
+
openai_sdk_helpers/structure/responses.py,sha256=WUwh0DhXj24pkvgqH1FMkdx5V2ArdvdtrDN_fuMBtDU,4882
|
|
53
61
|
openai_sdk_helpers/structure/summary.py,sha256=iP1uffqve18B9HXceP4rV0Ho5AaDZXMmC66tRKDNx3c,3143
|
|
54
62
|
openai_sdk_helpers/structure/translation.py,sha256=rBSzGBX6hGaETD43340z9MbKGsxWekjRD4xEZz67SnI,712
|
|
55
63
|
openai_sdk_helpers/structure/validation.py,sha256=D03rlyBDn22qNjTGaGsjhsk3g50oPmzYMFqycYF2_CU,2409
|
|
56
64
|
openai_sdk_helpers/structure/vector_search.py,sha256=XNQsG6_-c7X6TpXjqWOdKCmqXatX1gwd0zq-hII3cz4,5782
|
|
57
|
-
openai_sdk_helpers/structure/web_search.py,sha256=
|
|
65
|
+
openai_sdk_helpers/structure/web_search.py,sha256=cPqjwip0xS3OHf7yQ3B_t4VJSlviqgqzPpOkT8_qLvY,4330
|
|
58
66
|
openai_sdk_helpers/structure/plan/__init__.py,sha256=IGr0Tk4inN_8o7fT2N02_FTi6U6l2T9_npcQHAlBwKA,1076
|
|
59
67
|
openai_sdk_helpers/structure/plan/enum.py,sha256=seESSwH-IeeW-9BqIMUQyk3qjtchfU3TDhF9HPDB1OM,3079
|
|
60
68
|
openai_sdk_helpers/structure/plan/helpers.py,sha256=Vc6dBTMFrNWlsaCTpEImEIKjfFq4BSSxNjB4K8dywOQ,5139
|
|
61
|
-
openai_sdk_helpers/structure/plan/plan.py,sha256=
|
|
62
|
-
openai_sdk_helpers/structure/plan/task.py,sha256=
|
|
69
|
+
openai_sdk_helpers/structure/plan/plan.py,sha256=yRBx0Z7tog4sGyq7s1kJHvqQOzLpKT8JJ9Ur5j-lhtk,9130
|
|
70
|
+
openai_sdk_helpers/structure/plan/task.py,sha256=DAfgJIa3Yq2AMEzaX20o8SdOs2AlM28pPE9GfbmXk3o,3547
|
|
63
71
|
openai_sdk_helpers/structure/plan/types.py,sha256=7y9QEVdZreQUXV7n-R4RoNZzw5HeOVbJGWx9QkSfuNY,418
|
|
64
|
-
openai_sdk_helpers/utils/__init__.py,sha256=
|
|
72
|
+
openai_sdk_helpers/utils/__init__.py,sha256=TO8VoKlxCNnrdsLT9iMA5hFwF2mT5SEoTsJzYnLdDKs,3669
|
|
65
73
|
openai_sdk_helpers/utils/async_utils.py,sha256=9KbPEVfi6IXdbwkTUE0h5DleK8TI7I6P_VPL8UgUv98,3689
|
|
66
74
|
openai_sdk_helpers/utils/coercion.py,sha256=Pq1u7tAbD7kTZ84lK-7Fb9CyYKKKQt4fypG5BlSI6oQ,3774
|
|
67
75
|
openai_sdk_helpers/utils/encoding.py,sha256=oDtlNGZ5p-edXiHW76REs-0-8NXkQNReKJdj6sHLkt8,4615
|
|
68
76
|
openai_sdk_helpers/utils/instructions.py,sha256=trbjxjxv2otQR9VmBsPFk1_CJj8nA85Sgtj_5QmQOKI,942
|
|
77
|
+
openai_sdk_helpers/utils/langextract.py,sha256=wkEGbNHDiSX5WVURwCZZZDi23EpHsnO4JR_jJht99C0,5245
|
|
69
78
|
openai_sdk_helpers/utils/output_validation.py,sha256=3DC6Hr6vAFx_bQGaLsxkGN_LuKe_MugLpVogMBgG9tc,12621
|
|
70
79
|
openai_sdk_helpers/utils/path_utils.py,sha256=NOSX7553cc8LqxbnvmdYjgDBi5Le2W2LuMINwFsTzyM,1969
|
|
71
80
|
openai_sdk_helpers/utils/registry.py,sha256=FJvQEZ19vmgfhd1QR5JHb-jIite5fB-bSEOMTGkY7iQ,6680
|
|
72
81
|
openai_sdk_helpers/utils/validation.py,sha256=ZjnZNOy5AoFlszRxarNol6YZwfgw6LnwPtkCekZmwAU,7826
|
|
73
82
|
openai_sdk_helpers/utils/json/__init__.py,sha256=wBm1DBgfy_n1uSUcnCPyqBn_cCq41mijjPigSMZJZqg,2118
|
|
74
|
-
openai_sdk_helpers/utils/json/base_model.py,sha256=
|
|
83
|
+
openai_sdk_helpers/utils/json/base_model.py,sha256=DXxKT3CuTNrzUDc9zq7c32EQ18WLyifXG33XOWZxiBk,14122
|
|
75
84
|
openai_sdk_helpers/utils/json/data_class.py,sha256=Bobc5yCZPMh093-0fiWaYNcEH7gUXUV2Itd-tPXH15w,6476
|
|
76
85
|
openai_sdk_helpers/utils/json/ref.py,sha256=FqBIRWIw33Up3rFyTlLYljcuUjg43f6Nu5wX3tOXn54,2809
|
|
77
86
|
openai_sdk_helpers/utils/json/utils.py,sha256=iyc25tnObqXQJWPKLZMVts932GArdKer59KuC8aQKsY,5948
|
|
@@ -79,8 +88,8 @@ openai_sdk_helpers/vector_storage/__init__.py,sha256=L5LxO09puh9_yBB9IDTvc1CvVkA
|
|
|
79
88
|
openai_sdk_helpers/vector_storage/cleanup.py,sha256=ImWIE-9lli-odD8qIARvmeaa0y8ZD4pYYP-kT0O3178,3552
|
|
80
89
|
openai_sdk_helpers/vector_storage/storage.py,sha256=CcpATTNdeppmMfbQLnhv29hdEfE3wtAVsyKHNCrL-cI,23657
|
|
81
90
|
openai_sdk_helpers/vector_storage/types.py,sha256=jTCcOYMeOpZWvcse0z4T3MVs-RBOPC-fqWTBeQrgafU,1639
|
|
82
|
-
openai_sdk_helpers-0.
|
|
83
|
-
openai_sdk_helpers-0.
|
|
84
|
-
openai_sdk_helpers-0.
|
|
85
|
-
openai_sdk_helpers-0.
|
|
86
|
-
openai_sdk_helpers-0.
|
|
91
|
+
openai_sdk_helpers-0.5.0.dist-info/METADATA,sha256=DoveMw25xYYVHQpPcj8FZjz4oEDvwPPbMALwVeU-fwI,24106
|
|
92
|
+
openai_sdk_helpers-0.5.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
93
|
+
openai_sdk_helpers-0.5.0.dist-info/entry_points.txt,sha256=gEOD1ZeXe8d2OP-KzUlG-b_9D9yUZTCt-GFW3EDbIIY,63
|
|
94
|
+
openai_sdk_helpers-0.5.0.dist-info/licenses/LICENSE,sha256=CUhc1NrE50bs45tcXF7OcTQBKEvkUuLqeOHgrWQ5jaA,1067
|
|
95
|
+
openai_sdk_helpers-0.5.0.dist-info/RECORD,,
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"""Developer configuration for the example Streamlit chat app."""
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
from openai_sdk_helpers.agent.search.web import WebAgentSearch
|
|
5
|
-
from openai_sdk_helpers.settings import OpenAISettings
|
|
6
|
-
from openai_sdk_helpers.response.base import ResponseBase
|
|
7
|
-
from openai_sdk_helpers.structure.web_search import WebSearchStructure
|
|
8
|
-
from openai_sdk_helpers.structure.prompt import PromptStructure
|
|
9
|
-
from openai_sdk_helpers.tools import ToolSpec, build_tool_definitions
|
|
10
|
-
from openai_sdk_helpers.utils import coerce_jsonable, customJSONEncoder
|
|
11
|
-
from openai_sdk_helpers.environment import DEFAULT_MODEL
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class StreamlitWebSearch(ResponseBase[WebSearchStructure]):
|
|
15
|
-
"""Response tuned for a generic chat experience with structured output.
|
|
16
|
-
|
|
17
|
-
Methods
|
|
18
|
-
-------
|
|
19
|
-
__init__()
|
|
20
|
-
Configure a general-purpose response session using OpenAI settings.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
def __init__(self) -> None:
|
|
24
|
-
settings = OpenAISettings.from_env()
|
|
25
|
-
if not settings.default_model:
|
|
26
|
-
settings = settings.model_copy(update={"default_model": DEFAULT_MODEL})
|
|
27
|
-
super().__init__(
|
|
28
|
-
name="streamlit_web_search",
|
|
29
|
-
instructions="Perform web searches and generate reports.",
|
|
30
|
-
tools=build_tool_definitions(
|
|
31
|
-
[
|
|
32
|
-
ToolSpec(
|
|
33
|
-
structure=PromptStructure,
|
|
34
|
-
tool_name="perform_search",
|
|
35
|
-
tool_description="Tool to perform web searches and generate reports.",
|
|
36
|
-
output_structure=WebSearchStructure,
|
|
37
|
-
)
|
|
38
|
-
]
|
|
39
|
-
),
|
|
40
|
-
output_structure=WebSearchStructure,
|
|
41
|
-
tool_handlers={"perform_search": perform_search},
|
|
42
|
-
openai_settings=settings,
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
async def perform_search(tool) -> str:
|
|
47
|
-
"""Perform a web search and return structured results."""
|
|
48
|
-
structured_data = PromptStructure.from_tool_arguments(tool.arguments)
|
|
49
|
-
web_result = await WebAgentSearch(default_model=DEFAULT_MODEL).run_agent_async(
|
|
50
|
-
structured_data.prompt
|
|
51
|
-
)
|
|
52
|
-
payload = coerce_jsonable(web_result)
|
|
53
|
-
return json.dumps(payload, cls=customJSONEncoder)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
APP_CONFIG = {
|
|
57
|
-
"response": StreamlitWebSearch,
|
|
58
|
-
"display_title": "Web Search Assistant",
|
|
59
|
-
"description": "configuration-driven chat experience for performing web searches.",
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if __name__ == "__main__":
|
|
63
|
-
web_search_instance = StreamlitWebSearch()
|
|
64
|
-
import asyncio
|
|
65
|
-
|
|
66
|
-
result = asyncio.run(
|
|
67
|
-
web_search_instance.run_async("What are the 2026 advancements in AI?")
|
|
68
|
-
)
|
|
69
|
-
if result:
|
|
70
|
-
print(web_search_instance.get_last_tool_message())
|
|
71
|
-
else:
|
|
72
|
-
print("No result returned.")
|
|
73
|
-
filepath = f"./data/{web_search_instance.name}.{web_search_instance.uuid}.json"
|
|
74
|
-
web_search_instance.save(filepath)
|
|
75
|
-
web_search_instance.close()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|