Skip to content

Commit 627339a

Browse files
committed
File can be str
1 parent cf6bb42 commit 627339a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/inferencesh/sdk.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,18 @@ def refresh_metadata(self) -> None:
264264
self.size = self._get_file_size() # Always update size
265265
self.filename = self._get_filename()
266266

267+
@classmethod
268+
def model_json_schema(cls, **kwargs):
269+
schema = super().model_json_schema(**kwargs)
270+
271+
# Create a schema that accepts either a string or the full object
272+
return {
273+
"oneOf": [
274+
{"type": "string"}, # Accept string input
275+
schema # Accept full object input
276+
]
277+
}
278+
267279

268280
class ContextMessageRole(str, Enum):
269281
USER = "user"

0 commit comments

Comments
 (0)