forked from Azure-Samples/azure-search-openai-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
locustfile.py
63 lines (59 loc) · 2.82 KB
/
locustfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import random
import time
from locust import HttpUser, between, task
class ChatUser(HttpUser):
wait_time = between(5, 20)
@task
def ask_question(self):
self.client.get("/")
time.sleep(5)
self.client.post(
"/chat",
json={
"messages": [
{
"content": random.choice(
[
"What is included in my Northwind Health Plus plan that is not in standard?",
"What does a Product Manager do?",
"What happens in a performance review?",
"Whats your whistleblower policy?",
]
),
"role": "user",
},
],
"context": {
"overrides": {
"retrieval_mode": "hybrid",
"semantic_ranker": True,
"semantic_captions": False,
"top": 3,
"suggest_followup_questions": False,
},
},
},
)
time.sleep(5)
self.client.post(
"/chat",
json={
"messages": [
{"content": "What happens in a performance review?", "role": "user"},
{
"content": "During a performance review, employees will receive feedback on their performance over the past year, including both successes and areas for improvement. The feedback will be provided by the employee's supervisor and is intended to help the employee develop and grow in their role [employee_handbook-3.pdf]. The review is a two-way dialogue between the employee and their manager, so employees are encouraged to be honest and open during the process [employee_handbook-3.pdf]. The employee will also have the opportunity to discuss their goals and objectives for the upcoming year [employee_handbook-3.pdf]. A written summary of the performance review will be provided to the employee, which will include a rating of their performance, feedback, and goals and objectives for the upcoming year [employee_handbook-3.pdf].",
"role": "assistant",
},
{"content": "Does my plan cover eye exams?", "role": "user"},
],
"context": {
"overrides": {
"retrieval_mode": "hybrid",
"semantic_ranker": True,
"semantic_captions": False,
"top": 3,
"suggest_followup_questions": False,
},
},
},
)