microsoft / microsoft/azurechat

Load Test

Open
#388 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.4k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the /api/chat entry point and reproduce the authenticated POST using the shown Python requests payload and headers. Compare the 307 transaction in Application Insights with the final 200 HTML response; the work is done when the chat request returns the expected API response rather than HTML.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, python, typescript
Domain
api, backend, cloud, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.