File tree Expand file tree Collapse file tree 2 files changed +22
-21
lines changed
samples/llama-deploy/llama-sum Expand file tree Collapse file tree 2 files changed +22
-21
lines changed Original file line number Diff line number Diff line change 22# SPDX-License-Identifier: Apache-2.0
33
44---
5- version : " 3 "
5+ version : ' 3 '
66
77silent : true
88
Original file line number Diff line number Diff line change 11# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
22# SPDX-License-Identifier: Apache-2.0
33
4- import json
5- import os
6- import sys
7- import time
84
95from llama_deploy import ControlPlaneConfig , LlamaDeployClient
106
11- init_timestamp = time .time ()
12-
13- # points to deployed control plane
14- client = LlamaDeployClient (ControlPlaneConfig ())
15-
16- session = client .create_session ()
17- result = session .run ("sum" , max = 10 )
18- v = result .split ()
19- # expected string in the form of
20- # v1 + v2 = v3
21- # we check it the sum returned is correct
22- sum = int (v [0 ]) + int (v [2 ])
23- assert v [4 ] == str (
24- sum
25- ), f"Got a wrong results. Expected { str (sum )} , received { v [4 ]} "
26- print ("test succeded" )
7+ result = None
8+
9+
10+ def run_test ():
11+ # points to deployed control plane
12+ client = LlamaDeployClient (ControlPlaneConfig ())
13+
14+ session = client .create_session ()
15+ result = session .run ("sum" , max = 10 )
16+ v = result .split ()
17+ # expected string in the form of
18+ # v1 + v2 = v3
19+ # we check it the sum returned is correct
20+ sum = int (v [0 ]) + int (v [2 ])
21+ assert v [4 ] == str (sum ), (
22+ f"Got a wrong results. Expected { str (sum )} , received { v [4 ]} "
23+ )
24+ print ("test succeded" )
25+
26+
27+ run_test ()
You can’t perform that action at this time.
0 commit comments