arpakitlib 1.8.69__py3-none-any.whl → 1.8.70__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.
- arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json +1 -1
- arpakitlib/_arpakit_project_template_v_5/project/tg_bot/filter_/prod_mode_filter.py +1 -1
- arpakitlib/_arpakit_project_template_v_5/project/tg_bot/util/notify_admins.py +5 -1
- arpakitlib/ar_openai_api_client_util.py +12 -5
- {arpakitlib-1.8.69.dist-info → arpakitlib-1.8.70.dist-info}/METADATA +1 -1
- {arpakitlib-1.8.69.dist-info → arpakitlib-1.8.70.dist-info}/RECORD +9 -9
- {arpakitlib-1.8.69.dist-info → arpakitlib-1.8.70.dist-info}/LICENSE +0 -0
- {arpakitlib-1.8.69.dist-info → arpakitlib-1.8.70.dist-info}/WHEEL +0 -0
- {arpakitlib-1.8.69.dist-info → arpakitlib-1.8.70.dist-info}/entry_points.txt +0 -0
@@ -50,7 +50,14 @@ class OpenAIAPIClient:
|
|
50
50
|
self._logger.error(e)
|
51
51
|
return False
|
52
52
|
|
53
|
-
def simple_ask(
|
53
|
+
def simple_ask(
|
54
|
+
self,
|
55
|
+
*,
|
56
|
+
prompt: str | None = None,
|
57
|
+
content: str,
|
58
|
+
model: str = "gpt-4o",
|
59
|
+
max_tokens: int = 300
|
60
|
+
) -> ChatCompletion:
|
54
61
|
messages = []
|
55
62
|
if prompt is not None:
|
56
63
|
messages.append({
|
@@ -59,15 +66,15 @@ class OpenAIAPIClient:
|
|
59
66
|
})
|
60
67
|
messages.append({
|
61
68
|
"role": "user",
|
62
|
-
"content":
|
69
|
+
"content": content
|
63
70
|
})
|
64
71
|
response: ChatCompletion = self.open_ai.chat.completions.create(
|
65
|
-
model=
|
72
|
+
model=model,
|
66
73
|
messages=messages,
|
67
74
|
n=1,
|
68
75
|
temperature=0.1,
|
69
76
|
top_p=0.9,
|
70
|
-
max_tokens=
|
77
|
+
max_tokens=max_tokens
|
71
78
|
)
|
72
79
|
return response
|
73
80
|
|
@@ -121,7 +128,7 @@ async def __async_example():
|
|
121
128
|
print(await client.async_is_conn_good())
|
122
129
|
|
123
130
|
response = client.simple_ask(
|
124
|
-
|
131
|
+
content="Привет, проверяю тебя"
|
125
132
|
)
|
126
133
|
print(response.choices[0].message.content)
|
127
134
|
|
@@ -8,7 +8,7 @@ arpakitlib/_arpakit_project_template_v_5/alembic/env.py,sha256=Qesmnj5A2kB-Doeuf
|
|
8
8
|
arpakitlib/_arpakit_project_template_v_5/alembic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
|
9
9
|
arpakitlib/_arpakit_project_template_v_5/alembic/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
arpakitlib/_arpakit_project_template_v_5/alembic.ini,sha256=8fuyeEvGBiPGbxEFy8ISBV3xX_fgVmuhEGpB10_B5Uo,3733
|
11
|
-
arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json,sha256=
|
11
|
+
arpakitlib/_arpakit_project_template_v_5/arpakitlib_project_template_info.json,sha256=jzAYgWiiMnqi8c38yKZ6E1MRRfui4ZLOpgAISXI_OR4,98
|
12
12
|
arpakitlib/_arpakit_project_template_v_5/command/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
arpakitlib/_arpakit_project_template_v_5/command/alembic_history.sh,sha256=OMnDNtHIksGh9iavWnzbtxcudZW4vjdcISsBXvzZSPw,22
|
14
14
|
arpakitlib/_arpakit_project_template_v_5/command/alembic_revision_autogenerate.sh,sha256=yW2i-SBOtBx15Ya0poVQqKkJM5t2JZp06r9AEW-DmGE,46
|
@@ -267,7 +267,7 @@ arpakitlib/_arpakit_project_template_v_5/project/tg_bot/filter_/__init__.py,sha2
|
|
267
267
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/filter_/is_private_chat.py,sha256=2anQo68KqkNYQnfIZDXSOX0P9hU59oSSSIJ36bWQdo8,500
|
268
268
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/filter_/message_text.py,sha256=OdQSWtdqAQeiJt2hr1z5XMreT-esVkBHLBLvMx4PzAw,1326
|
269
269
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/filter_/not_prod_mode_filter.py,sha256=WY2Bl6_vznUi2bT0WMbVUkQq_JQ783hMFFwLs4u9Whk,236
|
270
|
-
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/filter_/prod_mode_filter.py,sha256=
|
270
|
+
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/filter_/prod_mode_filter.py,sha256=WfbAnzW8X4wJVtv_lHbr6u2SXXGwLhplTKPaHpuWQZ4,229
|
271
271
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/filter_/user_roles_has_admin.py,sha256=HBHDLTX6lRQcn_8NSIfP-YYfajldsToSGMafGx6AiFo,577
|
272
272
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/filter_/user_roles_has_client.py,sha256=vuVUssIlkpUAfMSVr6tabUiHe_Tr-KYI_pXN0YyeSA4,579
|
273
273
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/kb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -322,7 +322,7 @@ arpakitlib/_arpakit_project_template_v_5/project/tg_bot/tg_bot.py,sha256=jMX_awQ
|
|
322
322
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/tg_bot_dispatcher.py,sha256=CUTYSiVEQrOcOe1pTl8BAHZIDIqurwVQEy0zCmab8Z8,660
|
323
323
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
324
324
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/util/etc.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
325
|
-
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/util/notify_admins.py,sha256=
|
325
|
+
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/util/notify_admins.py,sha256=csnBJPdHArFFnRnEoWriQ2PgJM0t8ttyP8EM5zhjTro,1949
|
326
326
|
arpakitlib/_arpakit_project_template_v_5/project/tg_bot/util/set_tg_bot_commands.py,sha256=3Vp29YG9DGMrQSB2WPYciI4pdBHyT1vOGDBKfZ8OLTE,3483
|
327
327
|
arpakitlib/_arpakit_project_template_v_5/project/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
328
328
|
arpakitlib/_arpakit_project_template_v_5/project/util/arpakitlib_project_template.py,sha256=syA_IuszHVub0zm0sVdB4_7rPJXwXRW4JmQ4qHbjXPk,396
|
@@ -359,7 +359,7 @@ arpakitlib/ar_list_util.py,sha256=2woOAHAU8oTIiVjZ8GLnx15odEaoQUq3Q0JPxlufFF0,45
|
|
359
359
|
arpakitlib/ar_logging_util.py,sha256=GLw87L6qUASHS4-eAoBW0kN2hHXVdmWcmE9huw-J5aI,1681
|
360
360
|
arpakitlib/ar_mongodb_util.py,sha256=2ECkTnGAZ92qxioL-fmN6R4yZOSr3bXdXLWTzT1C3vk,4038
|
361
361
|
arpakitlib/ar_need_type_util.py,sha256=l4ky_15KKwqgYf2WTgEaKfBI15jZbnszOeQjwC0YUmk,2312
|
362
|
-
arpakitlib/ar_openai_api_client_util.py,sha256=
|
362
|
+
arpakitlib/ar_openai_api_client_util.py,sha256=nMF8-ybcSx29Q7HK3X6vhliQIy7UnuNcpXiYOWgyMn0,3316
|
363
363
|
arpakitlib/ar_parse_command.py,sha256=1WTdQoWVshoDZ1jDaKeTzajfqaYHP3FNO0-REyo1aMY,3003
|
364
364
|
arpakitlib/ar_postgresql_util.py,sha256=1AuLjEaa1Lg4pzn-ukCVnDi35Eg1k91APRTqZhIJAdo,945
|
365
365
|
arpakitlib/ar_rat_func_util.py,sha256=Ca10o3RJwyx_DJLxjTxgHDO6NU3M6CWgUR4bif67OE4,2006
|
@@ -375,8 +375,8 @@ arpakitlib/ar_str_util.py,sha256=NisRtt4xwE7qthkkXzL49jvGKMGlvJ4KKcvpQfmRlIw,441
|
|
375
375
|
arpakitlib/ar_type_util.py,sha256=Cs_tef-Fc5xeyAF54KgISCsP11NHyzIsglm4S3Xx7iM,4049
|
376
376
|
arpakitlib/ar_yookassa_api_client_util.py,sha256=VozuZeCJjmLd1zj2BdC9WfiAQ3XYOrIMsdpNK-AUlm0,5347
|
377
377
|
arpakitlib/ar_zabbix_api_client_util.py,sha256=oHNS-2WckQxp7cVqsRne9JgkP9I7RQGBKVKZSMLN8zw,9427
|
378
|
-
arpakitlib-1.8.
|
379
|
-
arpakitlib-1.8.
|
380
|
-
arpakitlib-1.8.
|
381
|
-
arpakitlib-1.8.
|
382
|
-
arpakitlib-1.8.
|
378
|
+
arpakitlib-1.8.70.dist-info/LICENSE,sha256=GPEDQMam2r7FSTYqM1mm7aKnxLaWcBotH7UvQtea-ec,11355
|
379
|
+
arpakitlib-1.8.70.dist-info/METADATA,sha256=v_CAyQBiAjHN-xhT3oWvo85N7SABJ7xY_JJ6nHng6zY,3475
|
380
|
+
arpakitlib-1.8.70.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
381
|
+
arpakitlib-1.8.70.dist-info/entry_points.txt,sha256=36xqR3PJFT2kuwjkM_EqoIy0qFUDPKSm_mJaI7emewE,87
|
382
|
+
arpakitlib-1.8.70.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|