Skip to content

Commit 97d8fce

Browse files
docs: fix typos in FileContent docstrings and examples (#10579)
* fix datta typo and base64_file/base64_data * fix test --------- Co-authored-by: anakin87 <stefanofiorucci@gmail.com>
1 parent e8f92fe commit 97d8fce

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

docs-website/docs/concepts/data-classes/chatmessage.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class FileContent:
9494
"""
9595
The file content of a chat message.
9696
97-
:param base64_file: A base64 string representing the file.
97+
:param base64_data: A base64 string representing the file.
9898
:param mime_type: The MIME type of the file (e.g. "application/pdf").
9999
Providing this value is recommended, as most LLM providers require it.
100100
If not provided, the MIME type is guessed from the base64 string, which can be slow and not always reliable.
@@ -232,7 +232,7 @@ print(user_message)
232232
>>> _role=<ChatRole.USER: 'user'>,
233233
>>> _content=[
234234
>>> FileContent(
235-
>>> base64_datta='JVBERi0...',
235+
>>> base64_data='JVBERi0...',
236236
>>> mime_type='application/pdf',
237237
>>> filename='2309.08632',
238238
>>> extra={}
@@ -251,7 +251,7 @@ print(user_message.texts)
251251

252252
print(user_message.file)
253253
>>> FileContent(
254-
>>> base64_datta='JVBERi0...',
254+
>>> base64_data='JVBERi0...',
255255
>>> mime_type='application/pdf',
256256
>>> filename='2309.08632',
257257
>>> extra={}

docs-website/reference/haystack-api/data_classes_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ The file content of a chat message.
12471247

12481248
**Arguments**:
12491249

1250-
- `base64_file`: A base64 string representing the file.
1250+
- `base64_data`: A base64 string representing the file.
12511251
- `mime_type`: The MIME type of the file (e.g. "application/pdf").
12521252
Providing this value is recommended, as most LLM providers require it.
12531253
If not provided, the MIME type is guessed from the base64 string, which can be slow and not always reliable.

docs-website/reference_versioned_docs/version-2.24/haystack-api/data_classes_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ The file content of a chat message.
12471247

12481248
**Arguments**:
12491249

1250-
- `base64_file`: A base64 string representing the file.
1250+
- `base64_data`: A base64 string representing the file.
12511251
- `mime_type`: The MIME type of the file (e.g. "application/pdf").
12521252
Providing this value is recommended, as most LLM providers require it.
12531253
If not provided, the MIME type is guessed from the base64 string, which can be slow and not always reliable.

docs-website/versioned_docs/version-2.24/concepts/data-classes/chatmessage.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class FileContent:
9494
"""
9595
The file content of a chat message.
9696
97-
:param base64_file: A base64 string representing the file.
97+
:param base64_data: A base64 string representing the file.
9898
:param mime_type: The MIME type of the file (e.g. "application/pdf").
9999
Providing this value is recommended, as most LLM providers require it.
100100
If not provided, the MIME type is guessed from the base64 string, which can be slow and not always reliable.
@@ -232,7 +232,7 @@ print(user_message)
232232
>>> _role=<ChatRole.USER: 'user'>,
233233
>>> _content=[
234234
>>> FileContent(
235-
>>> base64_datta='JVBERi0...',
235+
>>> base64_data='JVBERi0...',
236236
>>> mime_type='application/pdf',
237237
>>> filename='2309.08632',
238238
>>> extra={}
@@ -251,7 +251,7 @@ print(user_message.texts)
251251

252252
print(user_message.file)
253253
>>> FileContent(
254-
>>> base64_datta='JVBERi0...',
254+
>>> base64_data='JVBERi0...',
255255
>>> mime_type='application/pdf',
256256
>>> filename='2309.08632',
257257
>>> extra={}

haystack/dataclasses/file_content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class FileContent:
2222
"""
2323
The file content of a chat message.
2424
25-
:param base64_file: A base64 string representing the file.
25+
:param base64_data: A base64 string representing the file.
2626
:param mime_type: The MIME type of the file (e.g. "application/pdf").
2727
Providing this value is recommended, as most LLM providers require it.
2828
If not provided, the MIME type is guessed from the base64 string, which can be slow and not always reliable.

test/tools/test_parameters_schema_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200

201201
FILE_CONTENT_SCHEMA = {
202202
"properties": {
203-
"base64_data": {"description": "Field 'base64_data' of 'FileContent'.", "type": "string"},
203+
"base64_data": {"description": "A base64 string representing the file.", "type": "string"},
204204
"extra": {
205205
"additionalProperties": True,
206206
"default": {},

0 commit comments

Comments
 (0)