-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New documentation structure --------- Co-authored-by: Vaibhav Gupta <[email protected]> Co-authored-by: Antonio Sarosi <[email protected]>
- Loading branch information
1 parent
625895d
commit bab2767
Showing
309 changed files
with
11,589 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1 @@ | ||
# Fern Configuration | ||
|
||
View the documentation [here](https://boundary.docs.buildwithfern.com). | ||
|
||
## Updating your Docs | ||
|
||
### Local Development server | ||
|
||
To run a local development server with hot-reloading you can run the following command | ||
|
||
```sh | ||
fern docs dev | ||
``` | ||
|
||
### Hosted URL | ||
|
||
Documentation is automatically updated when you push to main via the `fern generate` command. | ||
|
||
```sh | ||
npm install -g fern-api # only required once | ||
fern generate --docs | ||
``` | ||
If you're looking for docs, go to the [fern/](../fern) directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: Switching LLMs | ||
--- | ||
|
||
Switch LLMs using the `client` property. You can use the shorthand form, or the longer form with a named client. | ||
|
||
The shorthand form is `<provider>/<model>`: | ||
|
||
which uses ANTHROPIC_API_KEY or OPENAI_API_KEY environment variables as the defaults. | ||
|
||
```rust BAML | ||
function MakeHaiku(topic: string) -> string { | ||
client "openai/gpt-4o" // or anthropic/claude-3-5-sonnet-20241022 | ||
prompt #" | ||
Write a haiku about {{ topic }}. | ||
"# | ||
} | ||
``` | ||
|
||
The longer form uses a named client, and supports adding any parameters supported by the provider or changing the temperature, top_p, etc. | ||
|
||
```rust BAML | ||
client<llm> MyClient { | ||
provider "openai" | ||
options { | ||
model "gpt-4o" | ||
api_key env.OPENAI_API_KEY | ||
// other params like temperature, top_p, etc. | ||
temperature 0.5 | ||
base_url "https://my-custom-endpoint.com/v1" | ||
// add headers | ||
headers { | ||
"anthropic-beta" "prompt-caching-2024-07-31" | ||
} | ||
} | ||
|
||
} | ||
|
||
function MakeHaiku(topic: string) -> string { | ||
client MyClient | ||
prompt #" | ||
Write a haiku about {{ topic }}. | ||
"# | ||
} | ||
``` | ||
|
||
Consult the [provider documentation](#fields) for a list of supported providers | ||
and models, the default options, and setting [retry policies](/docs/reference/retry-policy). | ||
|
||
<Tip> | ||
If you want to specify which client to use at runtime, in your Python/TS/Ruby code, | ||
you can use the [client registry](/docs/calling-baml/client-registry) to do so. | ||
|
||
This can come in handy if you're trying to, say, send 10% of your requests to a | ||
different model. | ||
</Tip> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Fern Configuration | ||
|
||
View the documentation [here](https://boundary.docs.buildwithfern.com). | ||
|
||
## Updating your Docs | ||
|
||
### Local Development server | ||
|
||
To run a local development server with hot-reloading you can run the following command | ||
|
||
```sh | ||
fern docs dev | ||
``` | ||
|
||
### Hosted URL | ||
|
||
Documentation is automatically updated when you push to main via the `fern generate` command. | ||
|
||
```sh | ||
npm install -g fern-api # only required once | ||
fern generate --docs | ||
``` |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Cursor | ||
--- | ||
Refer to the [Cursor Extension Installation Guide](https://www.cursor.com/how-to-install-extension) to install the extension in Cursor. | ||
|
||
<Warning> | ||
You may need to update BAML extension manually using the process above. Auto-update does not seem to be working well for many extensions in Cursor. | ||
</Warning> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
We don't currently have any tier support for any other editors. | ||
|
||
* JetBrains IDEs | ||
* Helix | ||
* Zed | ||
* Vim | ||
* Emacs | ||
* Sublime Text | ||
* Atom | ||
|
||
|
||
Since the extension is a language server, we can technically pull out the language server and syntax highlighter and support any editor supporting the language server protocol. | ||
If you're interested in contributing to the project and supporting another editor, [please reach out](/contact). | ||
|
||
An alternative is to edit your files in our [Playground](https://www.promptfiddle.com/), and copy the code into your editor, but we recommend using VSCode to edit BAML files for now. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
We provide a BAML VSCode extension: https://marketplace.visualstudio.com/items?itemName=Boundary.baml-extension | ||
|
||
|
||
|
||
| Feature | Supported | | ||
|---------|-----------| | ||
| Syntax highlighting for BAML files | ✅ | | ||
| Code snippets for BAML | ✅ | | ||
| LLM playground for testing BAML functions | ✅ | | ||
| Jump to definition for BAML files | ✅ | | ||
| Jump to definition between Python/TS files and BAML files | ✅ | | ||
| Auto generate `baml_client` on save | ✅ | | ||
| BAML formatter | ❌ | | ||
|
||
## Opening BAML Playground | ||
|
||
Once you open a `.baml` file, in VSCode, you should see a small button over every BAML function: `Open Playground`. | ||
|
||
<img src="/assets/vscode/code-lens.png" /> | ||
|
||
Or type `BAML Playground` in the VSCode Command Bar (`CMD + Shift + P` or `CTRL + Shift + P`) to open the playground. | ||
|
||
<img src="/assets/vscode/open-playground.png" /> | ||
|
||
## Setting Env Variables | ||
|
||
Click on the `Settings` button in top right of the playground and set the environment variables. | ||
|
||
It should have an indicator saying how many unset variables are there. | ||
|
||
<img src="/assets/vscode/playground-preview.png" /> | ||
|
||
The playground should persist the environment variables between closing and opening VSCode. | ||
|
||
<Tip> | ||
You can set environment variables lazily. If anything is unset you'll get an error when you run the function. | ||
</Tip> | ||
|
||
<Info> | ||
Environment Variables are stored in VSCode's local storage! We don't save any additional data to disk, or send them across the network. | ||
</Info> | ||
|
||
|
||
## Running Tests | ||
|
||
- Click on the `Run All Tests` button in the playground. | ||
|
||
- Press the `▶️` button next to an individual test case to run that just that test case. | ||
|
||
|
||
## Switching Functions | ||
|
||
The playground will automatically switch to the function you're currently editing. | ||
|
||
To manually change it, click on the current function name in the playground (next to the dropdown) and search for your desired function. | ||
|
||
## Switching Test Cases | ||
|
||
The test case with the highlighted background is the currently rendered test case. Clicking on a different test case will render that test case. | ||
|
||
<img src="/assets/vscode/test-cases.png" /> | ||
|
||
You can toggle between seeing the results of all test cases or all test cases for the current function. | ||
|
||
<img src="/assets/vscode/test-case-buttons.png" /> |
Oops, something went wrong.