Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ dependencies = [
# Development-time dependencies.
dev = [
"coverage[toml]>=6.5",
"pytest>=8.0.2",
"pytest>=8.0.2,<9",
"pytest-xdist>=3.8.0",
"syrupy>=5.0.0",
]

Expand Down
19 changes: 19 additions & 0 deletions typescript/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,25 @@ AZURE_OPENAI_ENDPOINT=...
AZURE_OPENAI_API_KEY=...
```

### Using a proxy (optional)

If the model endpoint can only be reached through a proxy (for example in restricted regions),
`createLanguageModel` honors the standard `HTTPS_PROXY` / `HTTP_PROXY` / `ALL_PROXY` environment
variables, and `NO_PROXY` for hosts that should bypass the proxy — set them (e.g. in your `.env`
file) and requests are routed accordingly:

```ini
HTTPS_PROXY=http://127.0.0.1:7890
# Optional: comma-separated hosts that should bypass the proxy
NO_PROXY=localhost,127.0.0.1
```

Proxy support uses [`undici`](https://www.npmjs.com/package/undici) (which also powers Node's
built-in `fetch`). It is an optional dependency loaded only when a proxy is configured, so install
it when you need this: `npm install undici`. When calling `createOpenAILanguageModel` or
`createAzureOpenAILanguageModel` directly, pass the proxy explicitly via the `options` argument:
`createOpenAILanguageModel(apiKey, model, endPoint, org, { proxyUrl })` (or `createAzureOpenAILanguageModel(apiKey, endPoint, { proxyUrl })`).

## Step 4: Run the examples

Examples can be found in the `examples` directory.
Expand Down
21 changes: 18 additions & 3 deletions typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "typechat",
"author": "Microsoft",
"version": "0.1.2",
"version": "0.1.3",
"license": "MIT",
"description": "TypeChat is an experimental library that makes it easy to build natural language interfaces using types.",
"keywords": [
Expand Down Expand Up @@ -48,6 +48,7 @@
],
"peerDependencies": {
"typescript": "^5.3.3",
"undici": "^6.0.0",
"zod": "^4.4.3"
},
"peerDependenciesMeta": {
Expand All @@ -56,10 +57,14 @@
},
"zod": {
"optional": true
},
"undici": {
"optional": true
}
},
"devDependencies": {
"@types/node": "^20.10.4"
"@types/node": "^20.10.4",
"undici": "^6.27.0"
},
"workspaces": [
"./",
Expand Down
Loading