mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-16 06:27:58 +00:00
remove unused CreateBatchRequest, update completion_window to be literal "24h"
This commit is contained in:
parent
e6d5bf5588
commit
a0cd3c775d
4 changed files with 7 additions and 18 deletions
|
@ -4,6 +4,6 @@
|
|||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from .batches import Batches, BatchObject, CreateBatchRequest, ListBatchesResponse
|
||||
from .batches import Batches, BatchObject, ListBatchesResponse
|
||||
|
||||
__all__ = ["Batches", "BatchObject", "CreateBatchRequest", "ListBatchesResponse"]
|
||||
__all__ = ["Batches", "BatchObject", "ListBatchesResponse"]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
from typing import Any, Literal, Protocol, runtime_checkable
|
||||
from typing import Literal, Protocol, runtime_checkable
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
@ -16,16 +16,6 @@ except ImportError as e:
|
|||
raise ImportError("OpenAI package is required for batches API. Please install it with: pip install openai") from e
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class CreateBatchRequest(BaseModel):
|
||||
"""Request to create a new batch."""
|
||||
|
||||
input_file_id: str = Field(..., description="The ID of an uploaded file that contains requests for the new batch")
|
||||
endpoint: str = Field(..., description="The endpoint to be used for all requests in the batch")
|
||||
completion_window: str = Field(..., description="The time window within which the batch should be processed")
|
||||
metadata: dict[str, Any] | None = Field(default=None, description="Optional metadata for the batch")
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class ListBatchesResponse(BaseModel):
|
||||
"""Response containing a list of batch objects."""
|
||||
|
@ -53,7 +43,7 @@ class Batches(Protocol):
|
|||
self,
|
||||
input_file_id: str,
|
||||
endpoint: str,
|
||||
completion_window: str,
|
||||
completion_window: Literal["24h"],
|
||||
metadata: dict[str, str] | None = None,
|
||||
) -> BatchObject:
|
||||
"""Create a new batch for processing multiple API requests.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue