Skip to content

Commit df95488

Browse files
committed
latest updates
1 parent a42f6ca commit df95488

3 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/api/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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")

src/api/templates/index.html

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
});
107107

108108
try {
109-
/*
109+
110110
const result = await client.getStreamedCompletion(messages);
111111

112112
let answer = "";
@@ -126,22 +126,24 @@
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) {

src/api/test_ai_eval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def get_model_config():
1515

1616
def 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():
5050
def 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={

0 commit comments

Comments
 (0)