Switch to agent arch
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import random
|
||||
import typer
|
||||
|
||||
import httpx
|
||||
import typer
|
||||
|
||||
CONTENT_LIST = [
|
||||
"¿Cuáles son los beneficios de una tarjeta de crédito?",
|
||||
@@ -17,7 +18,7 @@ CONTENT_LIST = [
|
||||
"¿Cómo puedo transferir dinero a una cuenta internacional?",
|
||||
]
|
||||
|
||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
app = typer.Typer()
|
||||
@@ -41,7 +42,7 @@ async def call_rag_endpoint_task(client: httpx.AsyncClient, url: str):
|
||||
async def run_test(concurrency: int, url: str, timeout_seconds: float):
|
||||
"""Continuously calls the RAG endpoint and tracks requests."""
|
||||
total_requests = 0
|
||||
|
||||
|
||||
logger.info(f"Starting diagnostic test with {concurrency} concurrent requests on endpoint '{url}'.")
|
||||
logger.info(f"Request timeout is set to {timeout_seconds} seconds.")
|
||||
logger.info("Press Ctrl+C to stop.")
|
||||
@@ -50,7 +51,7 @@ async def run_test(concurrency: int, url: str, timeout_seconds: float):
|
||||
async with httpx.AsyncClient(timeout=timeout) as client:
|
||||
while True:
|
||||
tasks = [call_rag_endpoint_task(client, url) for _ in range(concurrency)]
|
||||
|
||||
|
||||
try:
|
||||
await asyncio.gather(*tasks)
|
||||
total_requests += concurrency
|
||||
|
||||
Reference in New Issue
Block a user