Skip to content

Add example of .env file#59

Merged
robgruen merged 6 commits into
microsoft:mainfrom
pacexy:env-example
May 4, 2026
Merged

Add example of .env file#59
robgruen merged 6 commits into
microsoft:mainfrom
pacexy:env-example

Conversation

@pacexy
Copy link
Copy Markdown
Contributor

@pacexy pacexy commented Jul 25, 2023

This will make it easier for users to set up environment variables.

@lingchuL
Copy link
Copy Markdown

lingchuL commented Jul 25, 2023

目前代码里是按是否有相应配置来决定要使用OpenAI还是Azure的,并且在检测到有OpenAI的配置会直接使用OpenAI的API尝试,所以如果只是添加用例可能把几行都默认为注释状态比较好~
In the createLanguageModel process, which endpoint to use is determined by whether there is a corresponding configuration to them. It will try to get OpenAI env variable first, once it get the OPENAI_API_KEY, it will use OpenAI as endpoint. Therefore, it may be better to comment all those lines as the default state~

@pacexy
Copy link
Copy Markdown
Contributor Author

pacexy commented Jul 26, 2023

目前代码里是按是否有相应配置来决定要使用OpenAI还是Azure的,并且在检测到有OpenAI的配置会直接使用OpenAI的API尝试,所以如果只是添加用例可能把几行都默认为注释状态比较好~ In the createLanguageModel process, which endpoint to use is determined by whether there is a corresponding configuration to them. It will try to get OpenAI env variable first, once it get the OPENAI_API_KEY, it will use OpenAI as endpoint. Therefore, it may be better to comment all those lines as the default state~

Maybe we can just keep it empty? (e.g. OPENAI_API_KEY=), and then it will not affect the createLanguageModel.

@lingchuL
Copy link
Copy Markdown

Yeah, it works too.

@Stevenic
Copy link
Copy Markdown

Stevenic commented Aug 9, 2023

You don't normally include the "" quotes in .env.example files. empty is better

@pacexy
Copy link
Copy Markdown
Contributor Author

pacexy commented Oct 18, 2023

You don't normally include the "" quotes in .env.example files. empty is better

Updated.

Copilot AI review requested due to automatic review settings May 4, 2026 22:12
@robgruen robgruen merged commit c15ee52 into microsoft:main May 4, 2026
11 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a repository-root .env.example file so contributors can copy a ready-made template when configuring TypeChat examples that use OpenAI or Azure OpenAI credentials.

Changes:

  • Add a new .env.example template at the repo root.
  • Include example variables for OpenAI and Azure OpenAI setup.
  • Mirror the environment variable guidance already documented in the examples docs/READMEs.
Show a summary per file
File Description
.env.example Adds a sample .env template intended to simplify local example configuration.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread .env.example
Comment on lines +2 to +13

# For OpenAI
# The OpenAI model name (e.g. `gpt-3.5-turbo` or `gpt-4`)
OPENAI_MODEL=
# Your OpenAI API key
OPENAI_API_KEY=

# For Azure OpenAI
# The full URL of the Azure OpenAI REST API (e.g. `https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/chat/completions?api-version=2023-05-15`)
AZURE_OPENAI_ENDPOINT=
# Your Azure OpenAI API key
AZURE_OPENAI_API_KEY=
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

Successfully merging this pull request may close these issues.

5 participants