Skip to content

Commit

Permalink
Updated docs a bit to help guide through first run experience. (#46)
Browse files Browse the repository at this point in the history
* Updated docs a bit to help guide through first run experience.
  • Loading branch information
hannesne authored Sep 18, 2024
1 parent 7f98e68 commit 600fe67
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
27 changes: 20 additions & 7 deletions docs/running-deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,26 @@ make install-requirements

## Running the Simulator Locally

Before running the Azure OpenAI API Simulator you should ensure that you have set up your local config. See [Azure OpenAI API Simulator Configuration Options](./config.md) for details on how to do this.

To run the simulated API, use the following command from the repository root directory:

```console
make run-simulated-api
```
1. Before running the Azure OpenAI API Simulator you should ensure that you have set up your local config. See [Azure OpenAI API Simulator Configuration Options](./config.md) for details on how to do this.

The minimum set of environment variables you'll need in your `.env` file to run the simulator locally are as follows:

```dotenv
SIMULATOR_API_KEY=my-test-key
TEST_OPENAI_ENDPOINT=http://localhost:8000/
TEST_OPENAI_KEY=my-test-key
TEST_OPENAI_DEPLOYMENT=gpt-3.5-turbo-0613
```
2. Start the simulator by running the following command in your terminal from the repository root directory:
```console
make run-simulated-api
```
Kill the process and run the command again to restart the simulator whenever you make changes to the config.
3. Now open the [http/chat-completions.http](../http/chat-completions.http) file, and send the first POST request. If you are using the rest-client extension, you may have to set the environment to `test`. Use the `>p rest client: switch environment` command in VS Code to do so.
4. You should receive an http `200` response with some generated completions. Check the terminal for any warnings or errors.
## Changing the Simulator Mode
Expand Down
14 changes: 14 additions & 0 deletions http/chat-completions.http
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ POST {{aoai_endpoint}}/openai/deployments/{{aoai_deployment}}/chat/completions?a
Content-Type: application/json
api-key: {{aoai_key}}

{
"messages": [{
"role": "user",
"content": "Is this thing on?"
}],
"model": "gpt-5-turbo-1",
"max_tokens": 20
}

###
POST {{aoai_endpoint}}/openai/deployments/{{aoai_deployment}}/chat/completions?api-version=2024-02-15-preview
Content-Type: application/json
api-key: {{aoai_key}}

{
"messages": [{
"role": "user",
Expand Down

0 comments on commit 600fe67

Please sign in to comment.