-
Notifications
You must be signed in to change notification settings - Fork 61
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
base: canary
Are you sure you want to change the base?
bfcl patch #821
Conversation
hellovai
commented
Jul 22, 2024
- Adding some hooks to allow testing BFCL
- update builder
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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 toRenderedPrompt
andRenderContext_Client
, updatedrender_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
andz_unstable_ctx_manager
methods inBamlAsyncClient
for internal access. - engine/language_client_python/src/types/function_results.rs: Added
internals
method toFunctionResult
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
There was a problem hiding this 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
andTryFrom
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 thetyping
module; ensure no dependencies are affected.
3 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings
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) |
There was a problem hiding this comment.
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.