You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix#1765
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Removes `--preview` flag from BAML CLI, stabilizing REST API, and
updates related documentation, tests, and build scripts.
>
> - **Behavior**:
> - Removes `--preview` flag from `DevArgs` in `dev.rs` and `ServeArgs`
in `serve/mod.rs`, making REST API stable by default.
> - Removes associated warnings and error messages related to the
`--preview` flag in `dev.rs` and `serve/mod.rs`.
> - **Documentation**:
> - Updates `dev.mdx` and `serve.mdx` to remove references to the
`--preview` flag and preview warnings.
> - **Testing**:
> - Adds a print statement in `test_streaming()` in `test_functions.py`
for debugging.
> - **Dependencies**:
> - Adds `types-assertpy` to `uv.lock` for type checking in tests.
> - **Build Script**:
> - Updates `tools/build` to run specific tests in `test_functions.py`
when in test mode.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup>
for d176229. You can
[customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->
log::warn!("We recommend using BAML_PASSWORD=sk-baml-... so that static analysis tools can detect if you accidentally commit and push your password.")
185
+
baml_log::warn!("We recommend using BAML_PASSWORD=sk-baml-... so that static analysis tools can detect if you accidentally commit and push your password.")
Copy file name to clipboardExpand all lines: fern/03-reference/baml-cli/dev.mdx
+5-10Lines changed: 5 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,12 @@
1
-
The `dev` command starts a development server that watches your BAML source files for changes and automatically reloads the BAML runtime. This feature is designed to streamline the development process by providing real-time updates as you modify your BAML configurations.
2
-
3
-
4
-
<Warning>
5
-
**Warning: Preview Feature**
6
-
7
-
1. You must include the `--preview` flag when running the `dev` command.
8
-
2. Be aware that this feature is still being stabilized and may change in future releases.
9
-
</Warning>
1
+
The `dev` command starts a development server that watches your BAML source
2
+
files for changes and automatically reloads the BAML runtime. This feature is
3
+
designed to streamline the development process by providing real-time updates as
Copy file name to clipboardExpand all lines: fern/03-reference/baml-cli/serve.mdx
+47-16Lines changed: 47 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,18 @@
1
-
The `serve` command starts a BAML-over-HTTP API server that exposes your BAML functions via HTTP endpoints. This feature allows you to interact with your BAML functions through a RESTful API interface.
2
-
3
-
<Warning>
4
-
**Warning: Preview Feature**
5
-
6
-
1. You must include the `--preview` flag when running the `dev` command.
7
-
2. Be aware that this feature is still being stabilized and may change in future releases.
8
-
</Warning>
1
+
The `serve` command starts a BAML-over-HTTP API server that exposes your BAML
2
+
functions via HTTP endpoints. This feature allows you to interact with your BAML
3
+
functions through a RESTful API interface.
9
4
10
5
## Usage
11
6
12
7
```
13
-
baml-cli serve [OPTIONS] --preview
8
+
baml-cli serve [OPTIONS]
14
9
```
15
10
16
11
<Tip>
17
-
If you're actively developing, you can use the `dev` command to include hotreload functionality:
12
+
If you're actively developing, you can use the `dev` command to include
13
+
hot-reload functionality:
18
14
```
19
-
baml-cli dev [OPTIONS] --preview
15
+
baml-cli dev [OPTIONS]
20
16
```
21
17
22
18
[See more](./dev)
@@ -29,7 +25,6 @@ baml-cli dev [OPTIONS] --preview
29
25
|`--from <PATH>`| Path to the `baml_src` directory |`./baml_src`|
30
26
|`--port <PORT>`| Port to expose BAML on |`2024`|
31
27
|`--no-version-check`| Generate `baml_client` without checking for version mismatch |`false`|
32
-
|`--preview`| Enable the preview feature ||
33
28
34
29
## Description
35
30
@@ -41,14 +36,43 @@ The `serve` command performs the following actions:
41
36
## Endpoints
42
37
43
38
44
-
-`POST /call/:function_name`: Call a BAML function
39
+
`POST /call/:function_name`: Call a BAML function
40
+
41
+
```bash curl
42
+
curl \
43
+
-X POST \
44
+
"http://localhost:2024/call/MyFunctionName" \
45
+
-H "Content-Type: application/json" \
46
+
-d '{"arg1": "value1", "arg2": "value2"}'
47
+
```
48
+
49
+
`POST /stream/:function_name`: Stream results from a BAML function
50
+
51
+
```bash curl
52
+
curl \
53
+
-X POST \
54
+
"http://localhost:2024/stream/MyFunctionName" \
55
+
-H "Content-Type: application/json" \
56
+
-d '{"arg1": "value1", "arg2": "value2"}'
57
+
```
45
58
46
59
**Debugging**
47
60
-`GET /docs`: Interactive API documentation (Swagger UI)
48
61
-`GET /openapi.json`: OpenAPI specification for the BAML functions
49
62
-`GET /_debug/ping`: Health check endpoint
50
63
-`GET /_debug/status`: Server status and authentication check
51
64
65
+
## Stability
66
+
67
+
`baml-cli serve` is currently in Tier 2 stability. This means that the CLI and
68
+
the HTTP APIs are stable, but there are a number of features which are
69
+
not yet available:
70
+
71
+
- the [TypeBuilder API](/ref/baml_client/type-builder)
72
+
- the [Collector API](/guide/baml-advanced/collector-track-tokens)
73
+
- the [Modular API](/guide/baml-advanced/modular-api)
74
+
- custom trace annotations for [Boundary Studio](/guide/boundary-cloud/observability/tracking-usage)
75
+
52
76
## Authentication
53
77
54
78
We support the header: `x-baml-api-key`
@@ -78,12 +102,19 @@ To test the server, you can use the following `curl` commands:
78
102
79
103
2. Call a function:
80
104
```bash
81
-
curl -X POST http://localhost:2024/call/MyFunctionName -d '{"arg1": "value1", "arg2": "value2"}'
0 commit comments