Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nahsra authored May 23, 2024
1 parent 4fd6a6c commit 0ff1f30
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,18 @@ The `executable` could involve multiple command line tokens (e.g., `npm run` or
}
```

## Configuring Azure OpenAI
## Configuring OpenAI

Codemods request access to OpenAI models by name, and by default are given access to types that talk to OpenAI directly. It's possible to override the default behavior to use Azure OpenAI in codemods by specifying the following environment variables, like in the following example:
You can optionally allow codemods to access OpenAI by adding the following environment variable:
```bash
CODEMODDER_OPENAI_API_KEY=<KEY>
```

In the case of problems communicating with an AI subprocessor, all other codemods should still run normally.

### Using Azure OpenAI

Codemods request access to OpenAI models by name, and by default are given access to types that talk to OpenAI directly. It's possible to override the default behavior to use Azure OpenAI in codemods by specifying the following environment variables:

```bash
CODEMODDER_AZURE_OPENAI_API_KEY=<KEY>
Expand All @@ -92,7 +101,7 @@ CODEMODDER_AZURE_OPENAI_GPT-4-TURBO-2024-04-12_API_DEPLOYMENT=<DEPLOYMENT_NAME>
```

- Providing `CODEMODDER_AZURE_OPENAI_API_KEY` without `CODEMODDER_AZURE_OPENAI_ENDPOINT` (and vice versa) will cause a failure on startup.
- If using Azure OpenAI and a codemod requests access to a model for which there is no corresponding `CODEMODDER_AZURE_OPENAI_(MODELNAME)_DDEPLOYMENT` variable, the codemod should fail immediately with an error message.
- If using Azure OpenAI and a codemod requests access to a model for which there is no corresponding `CODEMODDER_AZURE_OPENAI_(MODELNAME)_DEPLOYMENT` variable, the deployment name will be assumed to be the name of the model (e.g., "gpt-4o").

## Console output

Expand Down

0 comments on commit 0ff1f30

Please sign in to comment.