MCPcopy Create free account
hub / github.com/Azure-Samples/rag-postgres-openai-python / ask_question

Method ask_question

locustfile.py:11–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9
10 @task
11 def ask_question(self):
12 self.client.get("/")
13 time.sleep(5)
14 self.client.post(
15 "/chat",
16 json={
17 "messages": [
18 {
19 "content": random.choice(
20 ["Best shoe for hiking?", "Climbing shoe cheaper than $30?", "Waterproof camping gear?"]
21 ),
22 "role": "user",
23 }
24 ],
25 "context": {
26 "overrides": {"use_advanced_flow": True, "top": 3, "retrieval_mode": "hybrid", "temperature": 0.3}
27 },
28 },
29 )
30 time.sleep(5)
31 self.client.post(
32 "/chat",
33 json={
34 "messages": [
35 {"content": "Best shoe for hiking?", "role": "user"},
36 {
37 "content": "For the best shoe for hiking, I recommend the Trailblaze Steel-Blue Hiking Shoes.",
38 "role": "assistant",
39 },
40 {"content": "any other options?", "role": "user"},
41 ],
42 "context": {
43 "overrides": {"use_advanced_flow": True, "top": 3, "retrieval_mode": "hybrid", "temperature": 0.3}
44 },
45 },
46 )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected