Skip to content

Commit c27f2ff

Browse files
author
Gudynin Danila
committed
fix: lint
1 parent 8f2c7b8 commit c27f2ff

13 files changed

Lines changed: 299 additions & 75 deletions

.gitignore

Lines changed: 175 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,179 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/python,pycharm+all,go,goland+all
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=python,pycharm+all,go,goland+all
3+
4+
### Go ###
5+
# If you prefer the allow list template instead of the deny list, see community template:
6+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
7+
#
8+
# Binaries for programs and plugins
9+
*.exe
10+
*.exe~
11+
*.dll
12+
*.so
13+
*.dylib
14+
15+
# Test binary, built with `go test -c`
16+
*.test
17+
18+
# Output of the go coverage tool, specifically when used with LiteIDE
19+
*.out
20+
21+
# Dependency directories (remove the comment below to include it)
22+
# vendor/
23+
24+
# Go workspace file
25+
go.work
26+
27+
### GoLand+all ###
28+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
29+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
30+
31+
# User-specific stuff
32+
.idea/**/workspace.xml
33+
.idea/**/tasks.xml
34+
.idea/**/usage.statistics.xml
35+
.idea/**/dictionaries
36+
.idea/**/shelf
37+
38+
# AWS User-specific
39+
.idea/**/aws.xml
40+
41+
# Generated files
42+
.idea/**/contentModel.xml
43+
44+
# Sensitive or high-churn files
45+
.idea/**/dataSources/
46+
.idea/**/dataSources.ids
47+
.idea/**/dataSources.local.xml
48+
.idea/**/sqlDataSources.xml
49+
.idea/**/dynamic.xml
50+
.idea/**/uiDesigner.xml
51+
.idea/**/dbnavigator.xml
52+
53+
# Gradle
54+
.idea/**/gradle.xml
55+
.idea/**/libraries
56+
57+
# Gradle and Maven with auto-import
58+
# When using Gradle or Maven with auto-import, you should exclude module files,
59+
# since they will be recreated, and may cause churn. Uncomment if using
60+
# auto-import.
61+
# .idea/artifacts
62+
# .idea/compiler.xml
63+
# .idea/jarRepositories.xml
64+
# .idea/modules.xml
65+
# .idea/*.iml
66+
# .idea/modules
67+
# *.iml
68+
# *.ipr
69+
70+
# CMake
71+
cmake-build-*/
72+
73+
# Mongo Explorer plugin
74+
.idea/**/mongoSettings.xml
75+
76+
# File-based project format
77+
*.iws
78+
79+
# IntelliJ
80+
out/
81+
82+
# mpeltonen/sbt-idea plugin
83+
.idea_modules/
84+
85+
# JIRA plugin
86+
atlassian-ide-plugin.xml
87+
88+
# Cursive Clojure plugin
89+
.idea/replstate.xml
90+
91+
# SonarLint plugin
92+
.idea/sonarlint/
93+
94+
# Crashlytics plugin (for Android Studio and IntelliJ)
95+
com_crashlytics_export_strings.xml
96+
crashlytics.properties
97+
crashlytics-build.properties
98+
fabric.properties
99+
100+
# Editor-based Rest Client
101+
.idea/httpRequests
102+
103+
# Android studio 3.1+ serialized cache file
104+
.idea/caches/build_file_checksums.ser
105+
106+
### GoLand+all Patch ###
107+
# Ignore everything but code style settings and run configurations
108+
# that are supposed to be shared within teams.
109+
110+
.idea/*
111+
112+
!.idea/codeStyles
113+
!.idea/runConfigurations
114+
115+
### PyCharm+all ###
116+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
117+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
118+
119+
# User-specific stuff
120+
121+
# AWS User-specific
122+
123+
# Generated files
124+
125+
# Sensitive or high-churn files
126+
127+
# Gradle
128+
129+
# Gradle and Maven with auto-import
130+
# When using Gradle or Maven with auto-import, you should exclude module files,
131+
# since they will be recreated, and may cause churn. Uncomment if using
132+
# auto-import.
133+
# .idea/artifacts
134+
# .idea/compiler.xml
135+
# .idea/jarRepositories.xml
136+
# .idea/modules.xml
137+
# .idea/*.iml
138+
# .idea/modules
139+
# *.iml
140+
# *.ipr
141+
142+
# CMake
143+
144+
# Mongo Explorer plugin
145+
146+
# File-based project format
147+
148+
# IntelliJ
149+
150+
# mpeltonen/sbt-idea plugin
151+
152+
# JIRA plugin
153+
154+
# Cursive Clojure plugin
155+
156+
# SonarLint plugin
157+
158+
# Crashlytics plugin (for Android Studio and IntelliJ)
159+
160+
# Editor-based Rest Client
161+
162+
# Android studio 3.1+ serialized cache file
163+
164+
### PyCharm+all Patch ###
165+
# Ignore everything but code style settings and run configurations
166+
# that are supposed to be shared within teams.
167+
168+
169+
1170
### Python ###
2171
# Byte-compiled / optimized / DLL files
3172
__pycache__/
4173
*.py[cod]
5174
*$py.class
6175

7176
# C extensions
8-
*.so
9177

10178
# Distribution / packaging
11179
.Python
@@ -168,4 +336,9 @@ poetry.toml
168336
.ruff_cache/
169337

170338
# LSP config files
171-
pyrightconfig.json
339+
pyrightconfig.json
340+
341+
# End of https://www.toptal.com/developers/gitignore/api/python,pycharm+all,go,goland+all
342+
343+
344+
coverage.json

README.md

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,11 @@ from evolution_openai import EvolutionOpenAI
4040

4141
# Для обычного использования
4242
client = EvolutionOpenAI(
43-
key_id="your_key_id",
44-
secret="your_secret",
45-
base_url="https://your-model-endpoint.cloud.ru/v1"
43+
key_id="your_key_id", secret="your_secret", base_url="https://your-model-endpoint.cloud.ru/v1"
4644
)
4745

4846
response = client.chat.completions.create(
49-
model="default",
50-
messages=[{"role": "user", "content": "Hello!"}]
47+
model="default", messages=[{"role": "user", "content": "Hello!"}]
5148
)
5249
```
5350

@@ -60,9 +57,7 @@ from evolution_openai import EvolutionOpenAI
6057

6158
# Инициализация client для обычного использования
6259
client = EvolutionOpenAI(
63-
key_id="your_key_id",
64-
secret="your_secret",
65-
base_url="https://your-model-endpoint.cloud.ru/v1"
60+
key_id="your_key_id", secret="your_secret", base_url="https://your-model-endpoint.cloud.ru/v1"
6661
)
6762

6863
# Chat Completions
@@ -85,12 +80,9 @@ print(response.choices[0].message.content)
8580
```python
8681
# Для обычного использования
8782
stream = client.chat.completions.create(
88-
model="default",
89-
messages=[{"role": "user", "content": "Tell me a story"}],
90-
stream=True
83+
model="default", messages=[{"role": "user", "content": "Tell me a story"}], stream=True
9184
)
9285

93-
9486

9587
for chunk in stream:
9688
if chunk.choices[0].delta.content:
@@ -111,8 +103,7 @@ async def main():
111103
base_url="https://your-model-endpoint.cloud.ru/v1",
112104
)
113105
response = await client.chat.completions.create(
114-
model="default",
115-
messages=[{"role": "user", "content": "Async hello!"}]
106+
model="default", messages=[{"role": "user", "content": "Async hello!"}]
116107
)
117108

118109
print(response.choices[0].message.content)

examples/async_examples.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ async def streaming_async_example():
136136
return
137137

138138
try:
139-
client = EvolutionAsyncOpenAI(key_id=KEY_ID, secret=SECRET, base_url=BASE_URL)
139+
client = EvolutionAsyncOpenAI(
140+
key_id=KEY_ID, secret=SECRET, base_url=BASE_URL
141+
)
140142

141143
# Получаем доступную модель
142144
model_name = await get_available_model_async(client)
@@ -207,7 +209,7 @@ async def error_handling_example():
207209
print("\n=== Обработка ошибок ===")
208210

209211
try:
210-
client = AsyncOpenAI(
212+
client = EvolutionAsyncOpenAI(
211213
key_id=KEY_ID,
212214
secret=SECRET,
213215
base_url=BASE_URL,
@@ -245,7 +247,9 @@ async def batch_processing_example():
245247
# Семафор для ограничения количества одновременных запросов
246248
semaphore = asyncio.Semaphore(3) # Максимум 3 одновременных запроса
247249

248-
client = EvolutionAsyncOpenAI(key_id=KEY_ID, secret=SECRET, base_url=BASE_URL)
250+
client = EvolutionAsyncOpenAI(
251+
key_id=KEY_ID, secret=SECRET, base_url=BASE_URL
252+
)
249253

250254
# Получаем доступную модель
251255
model_name = await get_available_model_async(client)

examples/basic_usage.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ def basic_chat_example():
5555

5656
try:
5757
# Создаем client с использованием контекстного менеджера
58-
with EvolutionOpenAI(key_id=key_id, secret=secret, base_url=BASE_URL) as client:
58+
with EvolutionOpenAI(
59+
key_id=key_id, secret=secret, base_url=BASE_URL
60+
) as client:
5961
# Получаем доступную модель
6062
model_name = get_available_model(client)
6163

@@ -97,7 +99,9 @@ def streaming_example():
9799
return None
98100

99101
try:
100-
with EvolutionOpenAI(key_id=key_id, secret=secret, base_url=BASE_URL) as client:
102+
with EvolutionOpenAI(
103+
key_id=key_id, secret=secret, base_url=BASE_URL
104+
) as client:
101105
# Получаем доступную модель
102106
model_name = get_available_model(client)
103107

@@ -180,7 +184,9 @@ def advanced_features_example():
180184
return None
181185

182186
try:
183-
with EvolutionOpenAI(key_id=key_id, secret=secret, base_url=BASE_URL) as client:
187+
with EvolutionOpenAI(
188+
key_id=key_id, secret=secret, base_url=BASE_URL
189+
) as client:
184190
# Получаем доступную модель
185191
model_name = get_available_model(client)
186192

examples/run_all_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def main() -> bool:
140140
("basic_usage.py", "Базовые примеры использования"),
141141
("streaming_examples.py", "Примеры Streaming API"),
142142
("token_management.py", "Управление токенами"),
143-
("async_examples.py", "Асинхронные примеры")
143+
("async_examples.py", "Асинхронные примеры"),
144144
]
145145

146146
# Статистика

examples/streaming_examples.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ def basic_streaming_example():
5656
return
5757

5858
try:
59-
with EvolutionOpenAI(key_id=KEY_ID, secret=SECRET, base_url=BASE_URL) as client:
59+
with EvolutionOpenAI(
60+
key_id=KEY_ID, secret=SECRET, base_url=BASE_URL
61+
) as client:
6062
# Получаем доступную модель
6163
model_name = get_available_model(client)
6264

@@ -100,7 +102,9 @@ def streaming_with_metadata():
100102
return
101103

102104
try:
103-
with EvolutionOpenAI(key_id=KEY_ID, secret=SECRET, base_url=BASE_URL) as client:
105+
with EvolutionOpenAI(
106+
key_id=KEY_ID, secret=SECRET, base_url=BASE_URL
107+
) as client:
104108
# Получаем доступную модель
105109
model_name = get_available_model(client)
106110

@@ -211,7 +215,9 @@ def streaming_with_stop_sequence():
211215
return
212216

213217
try:
214-
client = EvolutionOpenAI(key_id=KEY_ID, secret=SECRET, base_url=BASE_URL)
218+
client = EvolutionOpenAI(
219+
key_id=KEY_ID, secret=SECRET, base_url=BASE_URL
220+
)
215221

216222
# Получаем доступную модель
217223
model_name = get_available_model(client)
@@ -276,7 +282,9 @@ def multiple_streaming_conversations():
276282
]
277283

278284
try:
279-
client = EvolutionOpenAI(key_id=KEY_ID, secret=SECRET, base_url=BASE_URL)
285+
client = EvolutionOpenAI(
286+
key_id=KEY_ID, secret=SECRET, base_url=BASE_URL
287+
)
280288

281289
# Получаем доступную модель
282290
model_name = get_available_model(client)

0 commit comments

Comments
 (0)