Skip to content

Commit 4d5119f

Browse files
committed
some fixes
1 parent 52644d0 commit 4d5119f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

docs/en/sgr-api/SGR-Integration-&-Examples.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ client = OpenAI(base_url="http://localhost:8010/v1", api_key="dummy")
114114
# Read local image file and encode to base64
115115
with open("chart.png", "rb") as image_file:
116116
image_data = base64.b64encode(image_file.read()).decode("utf-8")
117-
image_url = f"data:image/png;base64,{image_data}"
117+
image_base64 = f"data:image/png;base64,{image_data}"
118118

119119
# Research request with local image
120120
response = client.chat.completions.create(
@@ -123,7 +123,7 @@ response = client.chat.completions.create(
123123
"role": "user",
124124
"content": [
125125
{"type": "text", "text": "Analyze this chart and research the trends shown"},
126-
{"type": "image_url", "image_url": {"url": image_url}}
126+
{"type": "image_url", "image_url": {"url": image_base64}}
127127
]
128128
}],
129129
stream=True,
@@ -137,7 +137,6 @@ for chunk in response:
137137
```
138138

139139
**Image Formats Supported:**
140-
- Local image files (converted to Base64): PNG, JPEG, GIF, WebP
141140
- Image URLs (HTTP/HTTPS)
142141
- Base64 encoded images (`data:image/jpeg;base64,...` or `data:image/png;base64,...`)
143142

docs/ru/sgr-api/SGR-Integration-&-Examples.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ client = OpenAI(base_url="http://localhost:8010/v1", api_key="dummy")
114114
# Прочитать локальный файл изображения и закодировать в base64
115115
with open("chart.png", "rb") as image_file:
116116
image_data = base64.b64encode(image_file.read()).decode("utf-8")
117-
image_url = f"data:image/png;base64,{image_data}"
117+
image_base64 = f"data:image/png;base64,{image_data}"
118118

119119
# Исследовательский запрос с локальным изображением
120120
response = client.chat.completions.create(
@@ -123,7 +123,7 @@ response = client.chat.completions.create(
123123
"role": "user",
124124
"content": [
125125
{"type": "text", "text": "Проанализируй этот график и исследуй показанные тренды"},
126-
{"type": "image_url", "image_url": {"url": image_url}}
126+
{"type": "image_url", "image_url": {"url": image_base64}}
127127
]
128128
}],
129129
stream=True,
@@ -137,7 +137,6 @@ for chunk in response:
137137
```
138138

139139
**Поддерживаемые форматы изображений:**
140-
- Локальные файлы изображений (конвертируются в Base64): PNG, JPEG, GIF, WebP
141140
- URL изображений (HTTP/HTTPS)
142141
- Изображения в формате Base64 (`data:image/jpeg;base64,...` или `data:image/png;base64,...`)
143142

0 commit comments

Comments
 (0)