Skip to content

Commit fd13684

Browse files
Merge branch 'main' into update-syrupy
2 parents 3fc4270 + 7ea3e1b commit fd13684

File tree

23 files changed

+142
-32
lines changed

23 files changed

+142
-32
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ updates:
1010
directory: "/"
1111
schedule:
1212
interval: weekly
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
schedule:
16+
interval: weekly

.github/workflows/ci.js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
3131

3232
steps:
33-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3434
- name: Use Node.js ${{ matrix.node-version }}
35-
uses: actions/setup-node@v3
35+
uses: actions/setup-node@v4
3636
with:
3737
node-version: ${{ matrix.node-version }}
3838
cache: "npm"

.github/workflows/github-pages.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
deploy:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919
- name: Use Node.js
20-
uses: actions/setup-node@v3
20+
uses: actions/setup-node@v4
2121
with:
2222
node-version: 18.x
2323
cache: 'npm'
@@ -29,9 +29,9 @@ jobs:
2929
npm ci
3030
npm run build
3131
- name : Upload artifact
32-
uses: actions/upload-pages-artifact@v2
32+
uses: actions/upload-pages-artifact@v3
3333
with:
3434
name: github-pages
3535
path: site/_site
3636
- name: Deploy to GitHub Pages from artifacts
37-
uses: actions/deploy-pages@v2
37+
uses: actions/deploy-pages@v4

python/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ Types are all you need!
1818

1919
## Getting Started
2020

21-
> [!NOTE]
22-
> TypeChat is not currently published. For now, install from our GitHub repository.
23-
2421
Install TypeChat:
2522

2623
```sh
27-
pip install "typechat @ git+https://github.com/microsoft/TypeChat#subdirectory=python"
24+
pip install typechat
2825
```
2926

3027
You can also develop TypeChat from source, which needs [Python >=3.11](https://www.python.org/downloads/), [hatch](https://hatch.pypa.io/1.6/install/), and [Node.js >=20](https://nodejs.org/en/download):

python/examples/healthData/translator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def _create_request_prompt(self, intent: str) -> str:
4141
now = datetime.now()
4242

4343
prompt = F"""
44-
user: You are a service that translates user requests into JSON objects of type "{self._type_name}" according to the following TypeScript definitions:
44+
user: You are a service that translates user requests into JSON objects of type "{self.type_name}" according to the following TypeScript definitions:
4545
'''
46-
{self._schema_str}
46+
{self.schema_str}
4747
'''
4848
4949
user:

python/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "typechat-py",
33
"private": true,
4-
"version": "0.0.1",
4+
"version": "0.0.4",
55
"description": "TypeChat is a library that makes it easy to build natural language interfaces using types.",
66
"scripts": {
77
"check": "pyright"

python/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ classifiers = [
1818
"Programming Language :: Python",
1919
"Programming Language :: Python :: 3.11",
2020
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
2122
"Programming Language :: Python :: Implementation :: CPython",
2223
"Programming Language :: Python :: Implementation :: PyPy",
2324
]

python/src/typechat/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-FileCopyrightText: Microsoft Corporation
22
#
33
# SPDX-License-Identifier: MIT
4-
__version__ = "0.0.2"
4+
__version__ = "0.0.4"

python/src/typechat/_internal/translator.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class TypeChatJsonTranslator(Generic[T]):
1717
model: TypeChatLanguageModel
1818
validator: TypeChatValidator[T]
1919
target_type: type[T]
20-
_type_name: str
21-
_schema_str: str
20+
type_name: str
21+
schema_str: str
2222
_max_repair_attempts = 1
2323

2424
def __init__(
@@ -46,8 +46,8 @@ def __init__(
4646
error_text = "".join(f"\n- {error}" for error in conversion_result.errors)
4747
raise ValueError(f"Could not convert Python type to TypeScript schema: \n{error_text}")
4848

49-
self._type_name = conversion_result.typescript_type_reference
50-
self._schema_str = conversion_result.typescript_schema_str
49+
self.type_name = conversion_result.typescript_type_reference
50+
self.schema_str = conversion_result.typescript_schema_str
5151

5252
async def translate(self, input: str, *, prompt_preamble: str | list[PromptSection] | None = None) -> Result[T]:
5353
"""
@@ -102,9 +102,9 @@ async def translate(self, input: str, *, prompt_preamble: str | list[PromptSecti
102102

103103
def _create_request_prompt(self, intent: str) -> str:
104104
prompt = f"""
105-
You are a service that translates user requests into JSON objects of type "{self._type_name}" according to the following TypeScript definitions:
105+
You are a service that translates user requests into JSON objects of type "{self.type_name}" according to the following TypeScript definitions:
106106
```
107-
{self._schema_str}
107+
{self.schema_str}
108108
```
109109
The following is a user request:
110110
'''

0 commit comments

Comments
 (0)