Skip to content

Commit

Permalink
compile again
Browse files Browse the repository at this point in the history
  • Loading branch information
sxlijin committed Dec 19, 2024
1 parent a6bcd67 commit 5e439b4
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 42 deletions.
8 changes: 1 addition & 7 deletions engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ anyhow = "1.0"
array-macro = "2"
askama = "0.12.1"
baml-cli = { path = "cli" }
baml-types = { path = "baml-lib/baml-types" }
base64 = "0.22.1"
bstd = { path = "bstd" }
btrace = { path = "btrace" }
bytes = "1.6.0"
cfg-if = "1.0.0"
clap = { version = "4.4.6", features = ["cargo", "derive"] }
Expand All @@ -50,6 +52,12 @@ http = "1.1.0"
http-body = "1.0.0"
indexmap = { version = "2.1.0", features = ["serde"] }
indoc = "2.0.5"
jsonish = { path = "baml-lib/jsonish" }
internal-baml-codegen = { path = "language_client_codegen" }
internal-baml-core = { path = "baml-lib/baml-core" }
internal-baml-jinja = { path = "baml-lib/jinja-runtime" }
internal-baml-schema-ast = { path = "baml-lib/schema-ast" }
internal-llm-client = { path = "baml-lib/llm-client" }
log = "0.4.20"
# TODO: disable imports, etc
minijinja = { version = "1.0.16", default-features = false, features = [
Expand Down Expand Up @@ -92,11 +100,6 @@ uuid = { version = "1.8.0", features = ["v4", "v7", "serde"] }
walkdir = "2.5.0"
web-time = "1.1.0"

baml-types = { path = "baml-lib/baml-types" }
internal-baml-codegen = { path = "language_client_codegen" }
internal-baml-core = { path = "baml-lib/baml-core" }
internal-baml-jinja = { path = "baml-lib/jinja" }
internal-baml-schema-ast = { path = "baml-lib/schema-ast" }

[workspace.package]
version = "0.70.1"
Expand Down
12 changes: 6 additions & 6 deletions engine/baml-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ unused_variables = "allow"
[dependencies]
anyhow.workspace = true
base64.workspace = true
btrace.workspace = true
bytes.workspace = true
cfg-if.workspace = true
clap.workspace = true
Expand All @@ -37,15 +38,14 @@ indexmap.workspace = true
indoc.workspace = true
# instant = "0.1" # do not use this or wasm-timer - use web-time instead
json_comments = "0.2.2"
jsonish = { path = "../baml-lib/jsonish" }
jsonish.workspace = true
internal-baml-codegen.workspace = true
baml-types = { path = "../baml-lib/baml-types" }
internal-llm-client = { path = "../baml-lib/llm-client" }
internal-baml-core = { path = "../baml-lib/baml-core" }
internal-baml-jinja = { path = "../baml-lib/jinja-runtime" }
baml-types.workspace = true
internal-llm-client.workspace = true
internal-baml-core.workspace = true
internal-baml-jinja.workspace = true
log.workspace = true
minijinja.workspace = true
nonempty = "0.11.0"
pin-project-lite.workspace = true
reqwest-eventsource = "0.6.0"
scopeguard.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod stream;
use serde_json::json;
use web_time::Duration; // Add this line

use crate::btrace::WithTraceContext;
use btrace::WithTraceContext;
use crate::RenderCurlSettings;
use crate::{
internal::prompt_renderer::PromptRenderer, runtime_interface::InternalClientLookup,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use anyhow::Result;
use async_std::stream::StreamExt;
use baml_types::BamlValue;
use btrace::WithTraceContext;
use internal_baml_core::ir::repr::IntermediateRepr;
use jsonish::BamlValueWithFlags;
use serde_json::json;
use web_time::Duration;

use crate::{
btrace::{self, WithTraceContext},
internal::{
llm_client::{
parsed_value_to_response,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::{
btrace::{self, WithTraceContext},
internal::llm_client::{
traits::{ToProviderMessage, ToProviderMessageExt, WithClientProperties},
ResolveMediaUrls,
},
use crate::internal::llm_client::{
traits::{ToProviderMessage, ToProviderMessageExt, WithClientProperties},
ResolveMediaUrls,
};
use btrace::WithTraceContext;
use std::collections::HashMap;

use anyhow::{Context, Result};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use serde_json::{json, Map};
use web_time::Instant;
use web_time::SystemTime;

use crate::btrace::WithTraceContext;
use crate::client_registry::ClientProperty;
use crate::internal::llm_client::traits::{ToProviderMessageExt, WithClientProperties};
use crate::internal::llm_client::{
Expand All @@ -35,8 +34,9 @@ use crate::internal::llm_client::{
ErrorCode, LLMCompleteResponse, LLMCompleteResponseMetadata, LLMErrorResponse, LLMResponse,
ModelFeatures, ResolveMediaUrls,
};
use btrace::WithTraceContext;

use crate::{btrace, RenderCurlSettings, RuntimeContext};
use crate::{RenderCurlSettings, RuntimeContext};

// represents client that interacts with the Anthropic API
pub struct AwsClient {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use crate::btrace::WithTraceContext;
use crate::client_registry::ClientProperty;
use crate::internal::llm_client::traits::{
ToProviderMessage, ToProviderMessageExt, WithClientProperties,
};
use crate::internal::llm_client::ResolveMediaUrls;
use crate::{btrace, RuntimeContext};
use crate::RuntimeContext;
use crate::{
internal::llm_client::{
primitive::{
Expand All @@ -22,6 +21,7 @@ use crate::{
};
use anyhow::{Context, Result};
use baml_types::{BamlMap, BamlMedia, BamlMediaContent};
use btrace::WithTraceContext;
use eventsource_stream::Eventsource;
use futures::StreamExt;
use http::header;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::collections::HashMap;

use crate::btrace::WithTraceContext;
use crate::internal::llm_client::ResolveMediaUrls;
use anyhow::Result;
use baml_types::{BamlMap, BamlMedia, BamlMediaContent, BamlMediaType};
use btrace::WithTraceContext;
use internal_baml_core::ir::ClientWalker;
use internal_baml_jinja::{ChatMessagePart, RenderContext_Client, RenderedChatMessage};
use internal_llm_client::openai::ResolvedOpenAI;
Expand Down Expand Up @@ -31,7 +31,7 @@ use crate::internal::llm_client::{
};

use crate::request::create_client;
use crate::{btrace, RuntimeContext};
use crate::RuntimeContext;
use eventsource_stream::Eventsource;
use futures::StreamExt;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use crate::btrace::WithTraceContext;
use crate::client_registry::ClientProperty;
use crate::internal::llm_client::traits::{
ToProviderMessage, ToProviderMessageExt, WithClientProperties,
};
use crate::internal::llm_client::ResolveMediaUrls;
#[cfg(target_arch = "wasm32")]
use crate::internal::wasm_jwt::{encode_jwt, JwtError};
use crate::{btrace, RuntimeContext};
use crate::RuntimeContext;
use crate::{
internal::llm_client::{
primitive::{
Expand All @@ -23,6 +22,7 @@ use crate::{
request::create_client,
};
use anyhow::{Context, Result};
use btrace::WithTraceContext;
use chrono::{Duration, Utc};
use futures::StreamExt;
use internal_llm_client::vertex::{ResolvedServiceAccountDetails, ResolvedVertex, ServiceAccount};
Expand Down
3 changes: 2 additions & 1 deletion engine/baml-runtime/src/internal/llm_client/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ pub use self::{
completion::{WithCompletion, WithNoCompletion, WithStreamCompletion},
};
use super::{primitive::request::RequestBuilder, LLMResponse, ModelFeatures};
use crate::{btrace::WithTraceContext, internal::llm_client::ResolveMediaUrls, RenderCurlSettings};
use crate::{internal::llm_client::ResolveMediaUrls, RenderCurlSettings};
use crate::{internal::prompt_renderer::PromptRenderer, RuntimeContext};
use baml_types::{BamlMedia, BamlMediaContent, BamlMediaType, BamlValue, MediaBase64, MediaUrl};
use base64::{prelude::BASE64_STANDARD, Engine};
use btrace::WithTraceContext;
use futures::stream::StreamExt;
use infer;
use internal_baml_core::ir::repr::IntermediateRepr;
Expand Down
1 change: 0 additions & 1 deletion engine/baml-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pub mod internal;
#[cfg(not(feature = "internal"))]
pub(crate) mod internal;

pub mod btrace;
#[cfg(not(target_arch = "wasm32"))]
pub mod cli;
pub mod client_registry;
Expand Down
1 change: 0 additions & 1 deletion engine/baml-runtime/src/runtime/runtime_interface.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{collections::HashMap, path::PathBuf, sync::Arc};

use super::InternalBamlRuntime;
use crate::btrace;
use crate::internal::llm_client::traits::WithClientProperties;
use crate::internal::llm_client::LLMResponse;
use crate::{
Expand Down
2 changes: 1 addition & 1 deletion engine/baml-runtime/src/runtime_interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ use crate::internal::llm_client::llm_provider::LLMProvider;
use crate::internal::llm_client::orchestrator::{OrchestrationScope, OrchestratorNode};
use crate::tracing::{BamlTracer, TracingSpan};
use crate::types::on_log_event::LogEventCallbackSync;
use crate::{btrace, RenderCurlSettings, RuntimeContextManager};
use crate::{
internal::{ir_features::IrFeatures, llm_client::retry_policy::CallablePolicy},
runtime::InternalBamlRuntime,
types::FunctionResultStream,
FunctionResult, RuntimeContext,
};
use crate::{RenderCurlSettings, RuntimeContextManager};

pub(crate) trait RuntimeConstructor {
#[cfg(not(target_arch = "wasm32"))]
Expand Down
2 changes: 1 addition & 1 deletion engine/baml-runtime/src/types/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use serde_json::json;
use std::sync::Arc;

use crate::{
btrace::{self, WithTraceContext},
client_registry::ClientRegistry,
internal::{
llm_client::orchestrator::{orchestrate_stream, OrchestratorNodeIterator},
Expand All @@ -16,6 +15,7 @@ use crate::{
type_builder::TypeBuilder,
FunctionResult, RuntimeContextManager,
};
use btrace::WithTraceContext;

/// Wrapper that holds a stream of responses from a BAML function call.
///
Expand Down
2 changes: 1 addition & 1 deletion engine/btrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ crate-type = ["cdylib", "rlib"]
RSTEST_TIMEOUT = "10"

[lints.rust]
dead_code = "deny"
dead_code = "warn"
unused_imports = "deny"
unused_variables = "deny"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use crate::btrace::InstrumentationScope;

use super::TraceEvent;
pub struct TracerThread {
rx: tokio::sync::mpsc::UnboundedReceiver<TraceEvent>,
Expand Down

0 comments on commit 5e439b4

Please sign in to comment.