From 51d5ad67c4fc569204e0ce8003a9dada965b827b Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Wed, 23 Oct 2024 13:55:55 -0700 Subject: [PATCH] test client: --- llama_stack/apis/datasets/client.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/llama_stack/apis/datasets/client.py b/llama_stack/apis/datasets/client.py index e387eca6d..9e5891e74 100644 --- a/llama_stack/apis/datasets/client.py +++ b/llama_stack/apis/datasets/client.py @@ -5,9 +5,7 @@ # the root directory of this source tree. import asyncio -import base64 import json -import mimetypes import os from pathlib import Path from typing import Optional @@ -19,21 +17,7 @@ from termcolor import cprint from .datasets import * # noqa: F403 from llama_stack.apis.datasets import * # noqa: F403 from llama_stack.apis.common.type_system import * # noqa: F403 - - -def data_url_from_file(file_path: str) -> str: - if not os.path.exists(file_path): - raise FileNotFoundError(f"File not found: {file_path}") - - with open(file_path, "rb") as file: - file_content = file.read() - - base64_content = base64.b64encode(file_content).decode("utf-8") - mime_type, _ = mimetypes.guess_type(file_path) - - data_url = f"data:{mime_type};base64,{base64_content}" - - return data_url +from llama_stack.providers.tests.datasetio.test_datasetio import data_url_from_file class DatasetsClient(Datasets):