GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: RAG - Add support for max_embedding_requests_per_min in upload_… · googleapis/python-aiplatform@a330ecb

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tests/unit/vertex_rag
    • test_rag_data.py
  • vertexai/rag
    • rag_data.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tests/unit/vertex_rag/test_rag_data.py‎

Copy file name to clipboardExpand all lines: tests/unit/vertex_rag/test_rag_data.py
-24Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -756,30 +756,6 @@ def test_upload_file_success_with_transformation_config(
756756

757757
rag_file_eq(rag_file, test_rag_constants.TEST_RAG_FILE)
758758

759-
@pytest.mark.usefixtures("open_file_mock")
760-
def test_upload_file_success_with_max_embedding_requests_per_min(
761-
self,
762-
upload_file_with_upload_config_mock,
763-
):
764-
aiplatform.init(
765-
project=test_rag_constants.TEST_PROJECT,
766-
location=test_rag_constants.TEST_REGION,
767-
)
768-
rag_file = rag.upload_file(
769-
corpus_name=test_rag_constants.TEST_RAG_CORPUS_RESOURCE_NAME,
770-
path=test_rag_constants.TEST_PATH,
771-
display_name=test_rag_constants.TEST_FILE_DISPLAY_NAME,
772-
transformation_config=create_transformation_config(),
773-
max_embedding_requests_per_min=666,
774-
)
775-
776-
upload_file_with_upload_config_mock.assert_called_once()
777-
_, mock_kwargs = upload_file_with_upload_config_mock.call_args
778-
assert mock_kwargs["url"] == test_rag_constants.TEST_UPLOAD_REQUEST_URI
779-
assert mock_kwargs["headers"] == test_rag_constants.TEST_HEADERS
780-
781-
rag_file_eq(rag_file, test_rag_constants.TEST_RAG_FILE)
782-
783759
@pytest.mark.usefixtures("rag_data_client_mock_exception", "open_file_mock")
784760
def test_upload_file_failure(self):
785761
with pytest.raises(RuntimeError) as e:
Collapse file

‎vertexai/rag/rag_data.py‎

Copy file name to clipboardExpand all lines: vertexai/rag/rag_data.py
+5-11Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ def upload_file(
343343
description: Optional[str] = None,
344344
transformation_config: Optional[TransformationConfig] = None,
345345
timeout: int = 600,
346-
max_embedding_requests_per_min: int = 1000,
347346
) -> RagFile:
348-
"""Synchronous file upload to an existing RagCorpus.
347+
"""
348+
Synchronous file upload to an existing RagCorpus.
349349
350350
Example usage:
351351
@@ -375,17 +375,12 @@ def upload_file(
375375
corpus_name: The name of the RagCorpus resource into which to upload the file.
376376
Format: ``projects/{project}/locations/{location}/ragCorpora/{rag_corpus}``
377377
or ``{rag_corpus}``.
378-
path: A local file path. For example, "usr/home/my_file.txt".
378+
path: A local file path. For example,
379+
"usr/home/my_file.txt".
379380
display_name: The display name of the data file.
380381
description: The description of the RagFile.
381382
transformation_config: The config for transforming the RagFile, like chunking.
382383
timeout: Default is 600 seconds.
383-
max_embedding_requests_per_min: Optional. The max number of queries per
384-
minute that this job is allowed to make to the embedding model specified
385-
on the corpus. This value is specific to this job and not shared across
386-
other import jobs. Consult the Quotas page on the project to set an
387-
appropriate value here. If unspecified, a default value of 1,000 QPM
388-
would be used.
389384
390385
Returns:
391386
RagFile.
@@ -426,8 +421,7 @@ def upload_file(
426421
"chunk_overlap": chunk_overlap,
427422
}
428423
}
429-
},
430-
"max_embedding_requests_per_min": max_embedding_requests_per_min,
424+
}
431425
}
432426

433427
files = {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.