Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load Test #388

Open
quirxx-droid opened this issue May 28, 2024 · 0 comments
Open

Load Test #388

quirxx-droid opened this issue May 28, 2024 · 0 comments

Comments

@quirxx-droid
Copy link

quirxx-droid commented May 28, 2024

I have this app deployed and I am trying to do the load-test using locust.

I am able to obtain access token but when I try to make an api call using:

chat_endpoint = 'app-url/api/chat'  # Ensure this is the correct API endpoint

# JSON payload for the chat message
chat_payload = {
    'id': 'thread-id',  # Replace with the actual chat thread ID
    'message': 'Hello, LLM!'  # The user message
}

chat_headers = {
    'Authorization': f'Bearer {token}',
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Origin': 'app-url',
    'Referer': 'app-url/chat/thread-id',
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.1.15'
}

chat_response = requests.post(chat_endpoint, headers=chat_headers, json=chat_payload)

print(f"Chat Status Code: {chat_response.status_code}")
print(f"Chat Response Headers: {chat_response.headers}")
print(f"Chat Raw Response Content: {chat_response.text}")

try:
    chat_response_json = chat_response.json()
    print('Chat Response:', chat_response_json)
except ValueError:
    print('Chat response content is not valid JSON')

though I am getting status code 200, I am getting a response in html. When I look at transactions in Applications Insights, I see code 307.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant