Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: make dynamic clients discoverable #837

Open
wants to merge 8 commits into
base: canary
Choose a base branch
from
Open

Conversation

sxlijin
Copy link
Collaborator

@sxlijin sxlijin commented Jul 24, 2024

No description provided.

Copy link

vercel bot commented Jul 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baml ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2024 8:28pm

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This pull request introduces significant changes across multiple files, focusing on reorganization, dependency updates, and removal of certain functionalities.

  • Reorganization of Documentation:

    • docs/docs.yml: Reordered navigation structure for better logical flow.
    • docs/docs/snippets/client-constructor.mdx: Added new section for special providers (fallback, round-robin).
  • Dependency and Build Script Updates:

    • engine/Cargo.toml: Added internal-baml-schema-ast dependency.
    • engine/baml-fmt/Cargo.toml: Removed colored dependency; added internal-baml-core and internal-baml-schema-ast.
  • Functionality Removal:

    • engine/baml-fmt/build.rs: Deleted build script for storing Git commit hash.
    • engine/baml-fmt/src/lib.rs: Commented out entire file, disabling all functionality.
    • engine/baml-fmt/src/main.rs: Simplified to an empty main function, removing CLI options.
  • Code Modularization:

    • engine/baml-lib/schema-ast/src/parser/mod.rs: Modularized parsing logic into sub-modules for better maintainability.
  • File Cleanup:

    • engine/baml-runtime/.turbo/daemon/eeecc271d7c9d7d2-turbo.log.2024-06-10: Removed log file to prevent clutter.
    • integ-tests/typescript/test-report.html: Deleted test report file, indicating a change in test result visibility.

These changes should be reviewed carefully to ensure they align with project goals and do not disrupt existing workflows.

12 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@sxlijin sxlijin changed the title Sam/undo fuckery docs: document dynamic clients better Jul 24, 2024
@sxlijin sxlijin changed the title docs: document dynamic clients better docs: make dynamic clients discoverable Jul 24, 2024
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The pull request enhances the discoverability of dynamic clients by introducing new structures and methods across multiple files.

  • New Structs and Methods:

    • engine/baml-lib/baml-core/src/ir/repr.rs: Added TestCaseFunction struct and updated TestCase struct to include TestCaseFunction nodes.
    • engine/baml-schema-wasm/src/runtime_wasm/mod.rs: Added WasmParentFunction and WasmTestCase structs for better test case handling.
  • Workspace Dependency:

    • engine/baml-schema-wasm/Cargo.toml: Added internal-baml-core as a workspace dependency.
  • Test Execution Enhancements:

    • typescript/playground-common/src/baml_wasm_web/EventListener.tsx: Added useRunHooks and run_test command for dynamic test execution.
  • Project Management Improvements:

    • typescript/vscode-ext/packages/language-server/src/lib/baml_project_manager.ts: Introduced list_testcases method and enhanced error handling.
  • VSCode Integration:

    • typescript/vscode-ext/packages/vscode/src/extension.ts: Added baml.runBamlTest command for running tests directly from the editor.

9 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

The pull request focuses on improving the discoverability and organization of BAML documentation, particularly for dynamic clients.

  • Documentation Structure:

    • docs/docs.yml: Enhanced navigation and added redirects for better user experience.
  • VSCode Extension Clarifications:

    • docs/docs/get-started/quickstart/python.mdx, ruby.mdx, typescript.mdx: Clarified automation provided by the VSCode extension.
  • New Documentation Snippet:

    • docs/docs/snippets/clients/accordion.mdx: Added for testing AccordionGroup component with various providers.
  • Provider Updates:

    • docs/docs/snippets/clients/providers/huggingface.mdx, ollama.mdx, together.mdx, vllm.mdx: Updated provider names and configurations for accuracy.
  • Validation File Removal:

    • engine/baml-fmt/src/validate.rs: Removed, indicating a significant refactor in validation handling.

14 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings


See https://docs.together.ai/docs/openai-api-compatibility for more information.

```baml BAML
client<llm> MyClient {
provider openai
provider openai-generi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: Typo in provider name openai-generi

Suggested change
provider openai-generi
provider openai-generic

@@ -0,0 +1,96 @@
function InputNone() -> int {
client "openai/gpt-4o"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic: Client openai/gpt-4o not found. Ensure the client is defined or replace with an existing client.

}

function InputSimple(a: string, b: int | bool) -> int {
client "openai/gpt-4o"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic: Client openai/gpt-4o not found. Ensure the client is defined or replace with an existing client.

}

function InputObject(email: Email) -> string {
client "openai/gpt-4o"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic: Client openai/gpt-4o not found. Ensure the client is defined or replace with an existing client.

}

function InputEnum(color: Color) -> string {
client "openai/gpt-4o"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic: Client openai/gpt-4o not found. Ensure the client is defined or replace with an existing client.


// Or else
{
client "openai/gpt-4o"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic: Client openai/gpt-4o not found. Ensure the client is defined or replace with an existing client.



function InputImage(image: image) -> string {
client "openai/gpt-4o"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic: Client openai/gpt-4o not found. Ensure the client is defined or replace with an existing client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant