BoundaryML / baml

BAML is a language that helps you get structured data from LLMs, with the best DX possible. Check out the promptfiddle.com playground
https://docs.boundaryml.com
Apache License 2.0
1.03k stars 27 forks source link

default_client_mode not allowed in generator #813

Closed villagab4 closed 2 months ago

villagab4 commented 2 months ago

With Baml VS Code Extension 0.51 installed and baml-py 0.51 installed, the following error appears when including the default_client_mode in the generator:

Property not known: "default_client_mode". Did you mean one of these: "output_type", "output_dir", "version"?baml

greptile-apps[bot] commented 2 months ago

To resolve the issue with default_client_mode not being recognized in the generator, follow these steps:

  1. Update the BAML CLI and VSCode Extension: Ensure both the BAML CLI and the VSCode extension are updated to the latest version.

  2. Modify the Generator Definition: Update the generator definition to include default_client_mode as shown below:

// Example for Python
 generator target {
    output_type "python/pydantic"
    output_dir "../"
    default_client_mode "sync"
    version "0.51.0"
}

// Example for TypeScript
 generator target {
    output_type "typescript"
    output_dir "../"
    default_client_mode "async"
    version "0.51.0"
}
  1. Check for Validation Errors: Ensure there are no validation errors in your BAML files. Refer to /engine/baml-lib/baml/tests/validation_files/generators/error.baml for examples of common errors and their fixes.

References

/docs/docs/calling-baml/generate-baml-client.mdx /typescript/vscode-ext/packages/vscode/fixtures/functions /typescript/vscode-ext/packages/README.md /docs/docs/get-started/deploying/docker.mdx /engine/baml-lib/baml/tests/validation_files/variants/require_client_field.baml /typescript/fiddle-frontend/public/_examples/prompt-engineering/all-prompting-techniques /typescript/fiddle-frontend/public/_examples/intro/images/baml_src /engine/baml-lib/baml/tests/validation_files/generators/error.baml /typescript/fiddle-frontend/public/_examples/prompt-engineering/all-prompting-techniques/baml_src /integ-tests/baml-README.md /docs/docs/get-started/quickstart/editors-vscode.mdx /typescript/fiddle-frontend/public/_examples/intro/images /typescript/fiddle-frontend/public/_examples/prompt-engineering/chain-of-thought/baml_src /typescript/fiddle-frontend/public/_examples/prompt-engineering/symbol-tuning/baml_src /typescript/vscode-ext/packages/package.json /docs/docs /integ-tests/python/baml-README.md /typescript/fiddle-frontend/public/_examples/intro/chat-roles /typescript/fiddle-frontend/public/_examples/prompt-engineering /docs /typescript/fiddle-frontend/public/_examples /engine/baml-lib/baml/tests/validation_files/generators/v0.baml /engine/baml-lib/baml/tests/validation_files/generators /typescript/fiddle-frontend/public/_examples/intro/chat-roles/baml_src /engine/baml-runtime/src/cli

#### About Greptile This response provides a starting point for your research, not a precise solution. Help us improve! Please leave a ๐Ÿ‘ if this is helpful and ๐Ÿ‘Ž if it is irrelevant. [Ask Greptile](https://app.greptile.com/chat/github/boundaryml/baml/canary) ยท [Edit Issue Bot Settings](https://app.greptile.com/apps/github)