File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 22import asyncio
33from inferencesh import Inference , AsyncInference , TaskStatus
44
5- API_KEY = "1nfsh-7yxm9j9mdpkkpsab2dxtnddxft "
5+ API_KEY = "1nfsh-47p5ztz7qzm6j32maygz51eqbx "
66
77TASK_PARAMS = {
88 "app" : "infsh/text-templating" ,
@@ -21,7 +21,7 @@ def test_sync():
2121 print ("SYNC CLIENT TEST" )
2222 print ("=" * 50 )
2323
24- client = Inference (api_key = API_KEY )
24+ client = Inference (api_key = API_KEY , base_url = "https://api.inference.sh" )
2525
2626 # Test 1: Run and wait (default)
2727 print ("\n 1. run() - wait for completion (default)" )
@@ -75,11 +75,11 @@ async def test_async():
7575 print ("ASYNC CLIENT TEST" )
7676 print ("=" * 50 )
7777
78- client = AsyncInference (api_key = API_KEY )
78+ client = AsyncInference (api_key = API_KEY , base_url = "https://api.inference.sh" )
7979
8080 # Test 1: Run and wait (default)
8181 print ("\n 1. await run() - wait for completion (default)" )
82- task = await client .run (TASK_PARAMS )
82+ task = await client .run (TASK_PARAMS )
8383 print (f" Task ID: { task ['id' ]} " )
8484 print (f" Status: { TaskStatus (task ['status' ]).name } " )
8585 if task ["status" ] == TaskStatus .COMPLETED :
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class MetaItemType(str, Enum):
1111 IMAGE = "image"
1212 VIDEO = "video"
1313 AUDIO = "audio"
14+ RAW = "raw"
1415
1516
1617class VideoResolution (str , Enum ):
@@ -75,6 +76,12 @@ class AudioMeta(MetaItem):
7576 type : str = MetaItemType .AUDIO .value
7677 seconds : float = Field (default = 0 , description = "Duration in seconds" )
7778 sample_rate : int = Field (default = 0 , description = "Sample rate in Hz" )
79+
80+
81+ class RawMeta (MetaItem ):
82+ """Metadata for raw inputs/outputs used for custom pricing."""
83+ type : str = MetaItemType .RAW .value
84+ cost : float = Field (default = 0 , description = "Cost in dollar cents" )
7885
7986
8087class OutputMeta (BaseModel ):
You can’t perform that action at this time.
0 commit comments