@@ -269,7 +269,7 @@ from friendli import SyncFriendli
269269with SyncFriendli(
270270 token = os.getenv(" FRIENDLI_TOKEN" , " " ),
271271) as friendli:
272- res = friendli.serverless .chat.complete(
272+ res = friendli.container .chat.complete(
273273 messages = [
274274 {
275275 " content" : " You are a helpful assistant." ,
@@ -280,8 +280,8 @@ with SyncFriendli(
280280 " role" : " user" ,
281281 },
282282 ],
283- model = " meta-llama-3.1-8b-instruct" ,
284283 max_tokens = 200 ,
284+ model = " (adapter-route)" ,
285285 )
286286
287287 # Handle response
@@ -298,24 +298,43 @@ with SyncFriendli(
298298### [ container] ( docs/sdks/container/README.md )
299299
300300
301- #### [ container.chat] ( docs/sdks/friendlicorecontainerchat /README.md )
301+ #### [ container.chat] ( docs/sdks/chat /README.md )
302302
303- * [ complete] ( docs/sdks/friendlicorecontainerchat /README.md#complete ) - Chat completions
304- * [ stream] ( docs/sdks/friendlicorecontainerchat /README.md#stream ) - Stream chat completions
303+ * [ complete] ( docs/sdks/chat /README.md#complete ) - Chat completions
304+ * [ stream] ( docs/sdks/chat /README.md#stream ) - Stream chat completions
305305
306- #### [ container.completions] ( docs/sdks/friendlicorecontainercompletions /README.md )
306+ #### [ container.completions] ( docs/sdks/completions /README.md )
307307
308- * [ complete] ( docs/sdks/friendlicorecontainercompletions /README.md#complete ) - Completions
309- * [ stream] ( docs/sdks/friendlicorecontainercompletions /README.md#stream ) - Stream completions
308+ * [ complete] ( docs/sdks/completions /README.md#complete ) - Completions
309+ * [ stream] ( docs/sdks/completions /README.md#stream ) - Stream completions
310310
311- #### [ container.image] ( docs/sdks/friendlicoreimage /README.md )
311+ #### [ container.image] ( docs/sdks/image /README.md )
312312
313- * [ generate] ( docs/sdks/friendlicoreimage /README.md#generate ) - Image generations
313+ * [ generate] ( docs/sdks/image /README.md#generate ) - Image generations
314314
315- #### [ container.token] ( docs/sdks/friendlicorecontainertoken /README.md )
315+ #### [ container.token] ( docs/sdks/token /README.md )
316316
317- * [ tokenization] ( docs/sdks/friendlicorecontainertoken/README.md#tokenization ) - Tokenization
318- * [ detokenization] ( docs/sdks/friendlicorecontainertoken/README.md#detokenization ) - Detokenization
317+ * [ tokenization] ( docs/sdks/token/README.md#tokenization ) - Tokenization
318+ * [ detokenization] ( docs/sdks/token/README.md#detokenization ) - Detokenization
319+
320+ ### [ dataset] ( docs/sdks/dataset/README.md )
321+
322+ * [ create_dataset] ( docs/sdks/dataset/README.md#create_dataset ) - Create a new dataset
323+ * [ list_datasets] ( docs/sdks/dataset/README.md#list_datasets ) - List datasets
324+ * [ get_dataset] ( docs/sdks/dataset/README.md#get_dataset ) - Get dataset info
325+ * [ delete_dataset] ( docs/sdks/dataset/README.md#delete_dataset ) - Delete dataset
326+ * [ create_version] ( docs/sdks/dataset/README.md#create_version ) - Create a version
327+ * [ list_versions] ( docs/sdks/dataset/README.md#list_versions ) - List versions
328+ * [ get_version] ( docs/sdks/dataset/README.md#get_version ) - Get version info
329+ * [ delete_version] ( docs/sdks/dataset/README.md#delete_version ) - Delete a version
330+ * [ create_split] ( docs/sdks/dataset/README.md#create_split ) - Create a split
331+ * [ list_splits] ( docs/sdks/dataset/README.md#list_splits ) - List splits
332+ * [ get_split] ( docs/sdks/dataset/README.md#get_split ) - Get split info
333+ * [ delete_split] ( docs/sdks/dataset/README.md#delete_split ) - Delete split
334+ * [ add_samples] ( docs/sdks/dataset/README.md#add_samples ) - Add samples
335+ * [ list_samples] ( docs/sdks/dataset/README.md#list_samples ) - List samples
336+ * [ update_samples] ( docs/sdks/dataset/README.md#update_samples ) - Update samples
337+ * [ delete_samples] ( docs/sdks/dataset/README.md#delete_samples ) - Delete samples
319338
320339### [ dedicated] ( docs/sdks/dedicated/README.md )
321340
@@ -335,49 +354,52 @@ with SyncFriendli(
335354* [ wandb_artifact_create] ( docs/sdks/endpoint/README.md#wandb_artifact_create ) - Create endpoint from W&B artifact
336355* [ create] ( docs/sdks/endpoint/README.md#create ) - Create a new endpoint
337356* [ list] ( docs/sdks/endpoint/README.md#list ) - List all endpoints
338- * [ get ] ( docs/sdks/endpoint/README.md#get ) - Get endpoint specification
357+ * [ get_spec ] ( docs/sdks/endpoint/README.md#get_spec ) - Get endpoint specification
339358* [ update] ( docs/sdks/endpoint/README.md#update ) - Update endpoint spec
340359* [ delete] ( docs/sdks/endpoint/README.md#delete ) - Delete endpoint
341- * [ get_version ] ( docs/sdks/endpoint/README.md#get_version ) - Get endpoint versions
360+ * [ get_version_history ] ( docs/sdks/endpoint/README.md#get_version_history ) - Get endpoint version history
342361* [ get_status] ( docs/sdks/endpoint/README.md#get_status ) - Get endpoint status
343362* [ sleep] ( docs/sdks/endpoint/README.md#sleep ) - Sleep endpoint
344363* [ wake] ( docs/sdks/endpoint/README.md#wake ) - Wake endpoint
345364* [ terminate] ( docs/sdks/endpoint/README.md#terminate ) - Terminate endpoint
346365* [ restart] ( docs/sdks/endpoint/README.md#restart ) - Restart endpoint
366+ * [ create_beta] ( docs/sdks/endpoint/README.md#create_beta ) - Create a new endpoint (Beta)
367+ * [ list_beta] ( docs/sdks/endpoint/README.md#list_beta ) - List all endpoints (Beta)
368+ * [ get_spec_beta] ( docs/sdks/endpoint/README.md#get_spec_beta ) - Get endpoint specification (Beta)
369+ * [ update_beta] ( docs/sdks/endpoint/README.md#update_beta ) - Update endpoint spec (Beta)
370+ * [ get_status_beta] ( docs/sdks/endpoint/README.md#get_status_beta ) - Get endpoint status (Beta)
371+ * [ terminate_beta] ( docs/sdks/endpoint/README.md#terminate_beta ) - Terminate endpoint (Beta)
372+ * [ restart_beta] ( docs/sdks/endpoint/README.md#restart_beta ) - Restart endpoint (Beta)
347373
348- #### [ dedicated.image] ( docs/sdks/image /README.md )
374+ #### [ dedicated.image] ( docs/sdks/friendlicoreimage /README.md )
349375
350- * [ generate] ( docs/sdks/image /README.md#generate ) - Image generations
376+ * [ generate] ( docs/sdks/friendlicoreimage /README.md#generate ) - Image generations
351377
352378#### [ dedicated.token] ( docs/sdks/friendlicoretoken/README.md )
353379
354380* [ tokenization] ( docs/sdks/friendlicoretoken/README.md#tokenization ) - Tokenization
355381* [ detokenization] ( docs/sdks/friendlicoretoken/README.md#detokenization ) - Detokenization
356382
383+ ### [ file] ( docs/sdks/file/README.md )
357384
358- ### [ platform] ( docs/sdks/platform/README.md )
385+ * [ init_upload] ( docs/sdks/file/README.md#init_upload ) - Initiate file upload
386+ * [ complete_upload] ( docs/sdks/file/README.md#complete_upload ) - Complete file upload
387+ * [ get_info] ( docs/sdks/file/README.md#get_info ) - Get file info
388+ * [ get_download_url] ( docs/sdks/file/README.md#get_download_url ) - Get file download URL
359389
360390
361- #### [ platform.files] ( docs/sdks/files/README.md )
362-
363- * [ upload] ( docs/sdks/files/README.md#upload ) - Files upload
364- * [ list] ( docs/sdks/files/README.md#list ) - Files list
365- * [ retrieve] ( docs/sdks/files/README.md#retrieve ) - File retrieve
366- * [ delete] ( docs/sdks/files/README.md#delete ) - Files delete
367- * [ download] ( docs/sdks/files/README.md#download ) - Files download
368-
369391### [ serverless] ( docs/sdks/serverless/README.md )
370392
371393
372- #### [ serverless.chat] ( docs/sdks/chat /README.md )
394+ #### [ serverless.chat] ( docs/sdks/friendlicoreserverlesschat /README.md )
373395
374- * [ complete] ( docs/sdks/chat /README.md#complete ) - Chat completions
375- * [ stream] ( docs/sdks/chat /README.md#stream ) - Stream chat completions
396+ * [ complete] ( docs/sdks/friendlicoreserverlesschat /README.md#complete ) - Chat completions
397+ * [ stream] ( docs/sdks/friendlicoreserverlesschat /README.md#stream ) - Stream chat completions
376398
377- #### [ serverless.completions] ( docs/sdks/completions /README.md )
399+ #### [ serverless.completions] ( docs/sdks/friendlicoreserverlesscompletions /README.md )
378400
379- * [ complete] ( docs/sdks/completions /README.md#complete ) - Completions
380- * [ stream] ( docs/sdks/completions /README.md#stream ) - Stream completions
401+ * [ complete] ( docs/sdks/friendlicoreserverlesscompletions /README.md#complete ) - Completions
402+ * [ stream] ( docs/sdks/friendlicoreserverlesscompletions /README.md#stream ) - Stream completions
381403
382404#### [ serverless.knowledge] ( docs/sdks/knowledge/README.md )
383405
@@ -387,10 +409,10 @@ with SyncFriendli(
387409
388410* [ list] ( docs/sdks/model/README.md#list ) - Retrieve serverless models
389411
390- #### [ serverless.token] ( docs/sdks/token /README.md )
412+ #### [ serverless.token] ( docs/sdks/friendlicoreserverlesstoken /README.md )
391413
392- * [ tokenization] ( docs/sdks/token /README.md#tokenization ) - Tokenization
393- * [ detokenization] ( docs/sdks/token /README.md#detokenization ) - Detokenization
414+ * [ tokenization] ( docs/sdks/friendlicoreserverlesstoken /README.md#tokenization ) - Tokenization
415+ * [ detokenization] ( docs/sdks/friendlicoreserverlesstoken /README.md#detokenization ) - Detokenization
394416
395417#### [ serverless.tool_assisted_chat] ( docs/sdks/toolassistedchat/README.md )
396418
@@ -420,7 +442,7 @@ from friendli import SyncFriendli
420442with SyncFriendli(
421443 token = os.getenv(" FRIENDLI_TOKEN" , " " ),
422444) as friendli:
423- res = friendli.serverless .chat.stream(
445+ res = friendli.container .chat.stream(
424446 messages = [
425447 {
426448 " content" : " You are a helpful assistant." ,
@@ -431,8 +453,8 @@ with SyncFriendli(
431453 " role" : " user" ,
432454 },
433455 ],
434- model = " meta-llama-3.1-8b-instruct" ,
435456 max_tokens = 200 ,
457+ model = " (adapter-route)" ,
436458 )
437459
438460 with res as event_stream:
@@ -464,12 +486,13 @@ from friendli import SyncFriendli
464486with SyncFriendli(
465487 token = os.getenv(" FRIENDLI_TOKEN" , " " ),
466488) as friendli:
467- res = friendli.platform.files.upload(
489+ res = friendli.dataset.update_samples(
490+ dataset_id = " <id>" ,
491+ split_id = " <id>" ,
468492 file = {
469493 " file_name" : " example.file" ,
470494 " content" : open (" example.file" , " rb" ),
471495 },
472- purpose = " batch" ,
473496 )
474497
475498 # Handle response
@@ -492,7 +515,7 @@ from friendli.utils import BackoffStrategy, RetryConfig
492515with SyncFriendli(
493516 token = os.getenv(" FRIENDLI_TOKEN" , " " ),
494517) as friendli:
495- res = friendli.serverless .chat.complete(
518+ res = friendli.container .chat.complete(
496519 messages = [
497520 {
498521 " content" : " You are a helpful assistant." ,
@@ -503,8 +526,8 @@ with SyncFriendli(
503526 " role" : " user" ,
504527 },
505528 ],
506- model = " meta-llama-3.1-8b-instruct" ,
507529 max_tokens = 200 ,
530+ model = " (adapter-route)" ,
508531 retries = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
509532 )
510533
@@ -523,7 +546,7 @@ with SyncFriendli(
523546 retry_config = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
524547 token = os.getenv(" FRIENDLI_TOKEN" , " " ),
525548) as friendli:
526- res = friendli.serverless .chat.complete(
549+ res = friendli.container .chat.complete(
527550 messages = [
528551 {
529552 " content" : " You are a helpful assistant." ,
@@ -534,8 +557,8 @@ with SyncFriendli(
534557 " role" : " user" ,
535558 },
536559 ],
537- model = " meta-llama-3.1-8b-instruct" ,
538560 max_tokens = 200 ,
561+ model = " (adapter-route)" ,
539562 )
540563
541564 # Handle response
@@ -557,7 +580,7 @@ By default, an API error will raise a models.SDKError exception, which has the f
557580| ` .raw_response ` | * httpx.Response* | The raw HTTP response |
558581| ` .body ` | * str* | The response content |
559582
560- When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective * Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the ` create ` method may raise the following exceptions:
583+ When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective * Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the ` delete ` method may raise the following exceptions:
561584
562585| Error Type | Status Code | Content Type |
563586| -------------------------- | ----------- | ---------------- |
@@ -576,16 +599,7 @@ with SyncFriendli(
576599) as friendli:
577600 res = None
578601 try :
579- res = friendli.dedicated.endpoint.create(
580- advanced = {
581- " tokenizer_add_special_tokens" : True ,
582- " tokenizer_skip_special_tokens" : False ,
583- },
584- hf_model_repo = " <value>" ,
585- instance_option_id = " <id>" ,
586- name = " <value>" ,
587- project_id = " <id>" ,
588- )
602+ res = friendli.dedicated.endpoint.delete(endpoint_id = " <id>" )
589603
590604 # Handle response
591605 print (res)
@@ -614,7 +628,7 @@ with SyncFriendli(
614628 server_url = " https://api.friendli.ai" ,
615629 token = os.getenv(" FRIENDLI_TOKEN" , " " ),
616630) as friendli:
617- res = friendli.serverless .chat.complete(
631+ res = friendli.container .chat.complete(
618632 messages = [
619633 {
620634 " content" : " You are a helpful assistant." ,
@@ -625,8 +639,8 @@ with SyncFriendli(
625639 " role" : " user" ,
626640 },
627641 ],
628- model = " meta-llama-3.1-8b-instruct" ,
629642 max_tokens = 200 ,
643+ model = " (adapter-route)" ,
630644 )
631645
632646 # Handle response
0 commit comments