File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ async def response_stream():
9292 return fastapi .responses .StreamingResponse (response_stream ())
9393
9494
95- def get_targeting_context ():
95+ def get_targeting_context () -> TargetingContext :
9696 return TargetingContext (user_id = get_baggage ("Microsoft.TargetingId" ))
9797
9898@router .post ("/chat" )
Original file line number Diff line number Diff line change 106106 } ) ;
107107
108108 try {
109- /*
109+
110110 const result = await client . getStreamedCompletion ( messages ) ;
111111
112112 let answer = "" ;
126126 if ( response . error ) {
127127 messageDiv . innerHTML = "Error: " + response . error ;
128128 }
129- }*/
129+ }
130+
131+
130132
131- const response = await client . getCompletion ( messages , { "sessionState" : { "sessionId" : sessionId } } ) ;
132- const answer = response . answer ;
133+ // const response = await client.getCompletion(messages, { "sessionState": { "sessionId": sessionId }});
134+ // const answer = response.answer;
133135
134- messageDiv . innerHTML = converter . makeHtml ( answer ) ;
135- messageDiv . scrollIntoView ( ) ;
136+ // messageDiv.innerHTML = converter.makeHtml(answer);
137+ // messageDiv.scrollIntoView();
136138
137139 messages . push ( {
138140 "role" : "assistant" ,
139141 "content" : answer
140142 } ) ;
141143
142- if ( response . variant ) {
143- messageTitleDiv . innerHTML += ` (Prompt Variant: ${ response . variant } )` ;
144- }
144+ // if (response.variant) {
145+ // messageTitleDiv.innerHTML += ` (Prompt Variant: ${response.variant})`;
146+ // }
145147
146148 messageInput . value = "" ;
147149 } catch ( error ) {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ def get_model_config():
1515
1616def get_eval_data_set ():
1717 current_dir = os .path .dirname (__file__ )
18- file_path = os .path .join (current_dir , "data/eval-data-set-large .jsonl" )
18+ file_path = os .path .join (current_dir , "data/eval-data-set.jsonl" )
1919 with open (file_path ) as file :
2020 dataSet = json .load (file )
2121 return dataSet
@@ -50,7 +50,7 @@ def test_simulate_traffic():
5050def test_simulate_traffic_nostream ():
5151 app = create_app ()
5252 with TestClient (app ) as client :
53- for i in range (20 ):
53+ for i in range (1 ):
5454 for data in get_eval_data_set ():
5555 query = data ["query" ]
5656 response = client .post ("/chat" , json = {
You can’t perform that action at this time.
0 commit comments