@@ -129,6 +129,7 @@ with SyncFriendli(
129129 ],
130130 model = " meta-llama-3.1-8b-instruct" ,
131131 max_tokens = 200 ,
132+ stream = False ,
132133 )
133134
134135 # Handle response
@@ -163,6 +164,7 @@ async def main():
163164 ],
164165 model = " meta-llama-3.1-8b-instruct" ,
165166 max_tokens = 200 ,
167+ stream = False ,
166168 )
167169
168170 # Handle response
@@ -195,6 +197,7 @@ with SyncFriendli(
195197 ],
196198 model = " meta-llama-3.1-8b-instruct" ,
197199 max_tokens = 200 ,
200+ stream = False ,
198201 tools = [
199202 {
200203 " type" : " math:calculator" ,
@@ -230,6 +233,7 @@ async def main():
230233 ],
231234 model = " meta-llama-3.1-8b-instruct" ,
232235 max_tokens = 200 ,
236+ stream = False ,
233237 tools = [
234238 {
235239 " type" : " math:calculator" ,
@@ -278,6 +282,7 @@ with SyncFriendli(
278282 ],
279283 max_tokens = 200 ,
280284 model = " (adapter-route)" ,
285+ stream = False ,
281286 )
282287
283288 # Handle response
@@ -451,6 +456,7 @@ with SyncFriendli(
451456 ],
452457 model = " (endpoint-id)" ,
453458 max_tokens = 200 ,
459+ stream = True ,
454460 )
455461
456462 with res as event_stream:
@@ -524,6 +530,7 @@ with SyncFriendli(
524530 ],
525531 max_tokens = 200 ,
526532 model = " (adapter-route)" ,
533+ stream = False ,
527534 retries = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
528535 )
529536
@@ -555,6 +562,7 @@ with SyncFriendli(
555562 ],
556563 max_tokens = 200 ,
557564 model = " (adapter-route)" ,
565+ stream = False ,
558566 )
559567
560568 # Handle response
@@ -624,7 +632,7 @@ with SyncFriendli(
624632 server_url = " https://api.friendli.ai" ,
625633 token = os.getenv(" FRIENDLI_TOKEN" , " " ),
626634) as friendli:
627- res = friendli.dedicated .chat.complete(
635+ res = friendli.container .chat.complete(
628636 messages = [
629637 {
630638 " content" : " You are a helpful assistant." ,
@@ -637,6 +645,7 @@ with SyncFriendli(
637645 ],
638646 max_tokens = 200 ,
639647 model = " (adapter-route)" ,
648+ stream = False ,
640649 )
641650
642651 # Handle response
@@ -654,7 +663,7 @@ from friendli import SyncFriendli
654663with SyncFriendli(
655664 token = os.getenv(" FRIENDLI_TOKEN" , " " ),
656665) as friendli:
657- res = friendli.dedicated .chat.complete(
666+ res = friendli.container .chat.complete(
658667 messages = [
659668 {
660669 " content" : " You are a helpful assistant." ,
@@ -667,6 +676,7 @@ with SyncFriendli(
667676 ],
668677 max_tokens = 200 ,
669678 model = " (adapter-route)" ,
679+ stream = False ,
670680 server_url = " http://localhost:8000" ,
671681 )
672682
0 commit comments