Skip to content

Commit 843dfde

Browse files
aaronvgsxlijinseawatts
authored
Boundary studio v2 model changes (#2048)
- Boundary studiov2 model changes <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Enhance BAML runtime tracing and logging, add HTTP request/response handling, and improve BAML source hashing performance. > > - **Tracing and Logging Enhancements**: > - Add `FunctionType` and `FunctionStart` to `tracing::events` for better function call tracing. > - Implement `IntoRpcEvent` for converting trace data to RPC events in `rpc_converters`. > - Add `make_trace_event_for_response()` in `llm_response_to_log_event.rs` to create trace events from LLM responses. > - **HTTP Handling**: > - Add `HTTPRequest` and `HTTPResponse` handling in Python, Ruby, and TypeScript clients. > - Implement header redaction for sensitive information in `tracing/events.rs`. > - **Performance Improvements**: > - Add `baml_src_hash()` in `AstSignatureWrapper` for deterministic hashing of BAML source code. > - Add performance tests for BAML source hashing in `publisher/mod.rs`. > - **Miscellaneous**: > - Comment out unused code in `upload-traces-main.rs`. > - Update `Cargo.lock` with new dependencies and versions. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for fdc64e0. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN --> --------- Co-authored-by: Sam Lijin <sam@boundaryml.com> Co-authored-by: Chris Watts <chris@boundaryml.com>
1 parent 1771164 commit 843dfde

45 files changed

Lines changed: 3836 additions & 2202 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

engine/Cargo.lock

Lines changed: 1162 additions & 1120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/baml-lib/baml-core/src/ir/ir_hasher/mod.rs

Lines changed: 233 additions & 173 deletions
Large diffs are not rendered by default.

engine/baml-lib/baml-types/src/ir_type/mod.rs

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ mod display;
1010
pub mod type_meta;
1111
mod union_type;
1212

13+
// Types, depending on the context, have different metadata attached to them.
14+
// When you define a type in BAML you have the IR rep of the type.
15+
// Sometimes you use them in streaming or nonstreaming contexts.
1316
/// The building block of IR types in BAML.
1417
#[derive(Debug, Clone, PartialEq, serde::Serialize, Eq, Hash)]
1518
pub enum TypeGeneric<T> {
@@ -343,29 +346,35 @@ impl<T> TypeGeneric<T> {
343346
return vec![self];
344347
} else {
345348
match self {
346-
TypeGeneric::Primitive(..) |
347-
TypeGeneric::Enum { .. } |
348-
TypeGeneric::Literal(..) |
349-
TypeGeneric::Class { .. } |
350-
TypeGeneric::RecursiveTypeAlias { .. } => vec![],
349+
TypeGeneric::Primitive(..)
350+
| TypeGeneric::Enum { .. }
351+
| TypeGeneric::Literal(..)
352+
| TypeGeneric::Class { .. }
353+
| TypeGeneric::RecursiveTypeAlias { .. } => vec![],
351354
TypeGeneric::List(inner, _) => inner.find_if(predicate),
352355
TypeGeneric::Map(type_generic, type_generic1, _) => {
353356
let mut res = type_generic.find_if(predicate);
354357
res.extend(type_generic1.find_if(predicate));
355358
res
356-
},
357-
TypeGeneric::Tuple(type_generics, _) => {
358-
type_generics.iter().flat_map(|t| t.find_if(predicate)).collect()
359-
},
360-
TypeGeneric::Union(union_type_generic, _) => {
361-
union_type_generic.iter_skip_null().iter().flat_map(|t| t.find_if(predicate)).collect()
362-
},
359+
}
360+
TypeGeneric::Tuple(type_generics, _) => type_generics
361+
.iter()
362+
.flat_map(|t| t.find_if(predicate))
363+
.collect(),
364+
TypeGeneric::Union(union_type_generic, _) => union_type_generic
365+
.iter_skip_null()
366+
.iter()
367+
.flat_map(|t| t.find_if(predicate))
368+
.collect(),
363369
TypeGeneric::Arrow(arrow_generic, _) => {
364-
let res = arrow_generic.param_types.iter().flat_map(|t| t.find_if(predicate));
370+
let res = arrow_generic
371+
.param_types
372+
.iter()
373+
.flat_map(|t| t.find_if(predicate));
365374
let mut returned = arrow_generic.return_type.find_if(predicate);
366375
returned.extend(res);
367376
returned
368-
},
377+
}
369378
}
370379
}
371380
}

engine/baml-lib/baml-types/src/tracing/errors.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ pub enum BamlError<'a> {
4040
},
4141
}
4242

43-
impl<'a> From<&anyhow::Error> for BamlError<'a> {
44-
fn from(e: &anyhow::Error) -> Self {
45-
if let Some(baml_error) = e.downcast_ref::<BamlError>() {
46-
baml_error.clone()
47-
} else {
48-
BamlError::External {
49-
message: Cow::Owned(e.to_string()),
50-
}
51-
}
52-
}
53-
}
43+
// impl<'a> From<&anyhow::Error> for BamlError<'a> {
44+
// fn from(e: &anyhow::Error) -> Self {
45+
// if let Some(baml_error) = e.downcast_ref::<BamlError>() {
46+
// baml_error.clone()
47+
// } else {
48+
// BamlError::External {
49+
// message: Cow::Owned(e.to_string()),
50+
// }
51+
// }
52+
// }
53+
// }

0 commit comments

Comments
 (0)