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

bfcl patch #821

Draft
wants to merge 3 commits into
base: canary
Choose a base branch
from
Draft

bfcl patch #821

wants to merge 3 commits into from

Conversation

hellovai
Copy link
Contributor

  • Adding some hooks to allow testing BFCL
  • update builder

Copy link

vercel bot commented Jul 22, 2024

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

Name Status Preview Comments Updated (UTC)
baml ❌ Failed (Inspect) Jul 23, 2024 0:11am

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

The pull request introduces serialization capabilities and new methods for enhanced testing and debugging across various components.

  • engine/baml-lib/jinja/src/lib.rs: Added Serialize trait to RenderedPrompt and RenderContext_Client, updated render_prompt function for type safety, and included new unit tests.
  • engine/baml-runtime/src/internal/llm_client/mod.rs: Added Serialize trait to multiple structs and enums for better data handling.
  • engine/language_client_codegen/src/python/templates/async_client.py.j2: Introduced z_unstable_runtime and z_unstable_ctx_manager methods in BamlAsyncClient for internal access.
  • engine/language_client_python/src/types/function_results.rs: Added internals method to FunctionResult for JSON serialization of internal LLM responses.
  • engine/language_client_python/src/types/type_builder.rs: Enhanced type-building capabilities with new methods and imports from pyo3.

8 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 introduces a macro for reducing redundancy in Python client struct implementations and adds an unstable async client template.

  • engine/language-client-codegen/src/python/mod.rs: Introduced a macro to streamline From and TryFrom trait implementations for Python clients.
  • engine/language-client-codegen/src/python/templates/unstable_async_client.py.j2: Added UnstableBamlAsyncClient class for handling asynchronous BAML operations.
  • engine/language-client_python/python_src/baml_py/baml_py.pyi: Removed List import from the typing module; ensure no dependencies are affected.

3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

Comment on lines +70 to +73
if raw.is_ok() is None:
mdl = create_model("{{ fn.name }}ReturnType", inner=({{ fn.return_type }}, ...))
return raw, (True, coerce(mdl, raw.parsed()))
return raw, (False, None)
Copy link

Choose a reason for hiding this comment

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

Logic: The condition if raw.is_ok() is None seems incorrect. It should likely be if raw.is_ok() to check if the result is successful.

@hellovai hellovai marked this pull request as draft November 4, 2024 06:52
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