Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(openhuman-embed): supply model metadata in example inference stub

Steven Enamakeld59dc9d8f153
diff --git a/crates/openhuman-embed/examples/support/mod.rs b/crates/openhuman-embed/examples/support/mod.rs
index 37b1b2c6ac..e33ebb57ec 100644
--- a/crates/openhuman-embed/examples/support/mod.rs
+++ b/crates/openhuman-embed/examples/support/mod.rs
@@ -230,6 +230,7 @@ impl PointedInference {
pub fn install(base_url: &str) {
use openhuman_embed::__host::inference_registry::{
register_chat_model, ChatModelEntry, ChatModelRequest, ProviderContext,
+ ProviderModelMetadata,
PROVIDER_OPENHUMAN,
};
use tinyinference_llm::providers::openai::OpenAiModel;
@@ -258,7 +259,33 @@ impl PointedInference {
ChatModelEntry {
build: std::sync::Arc::new(build),
probe: None,
- models: None,
+ models: Some(ProviderModelMetadata {
+ default_model: std::sync::Arc::new(|| Some("embed-test-model".to_string())),
+ role_for_model: std::sync::Arc::new(|_| None),
+ is_alias: std::sync::Arc::new(|_| false),
+ is_raw_model: std::sync::Arc::new(|model| {
+ !model.trim().is_empty() && !model.starts_with("hint:")
+ }),
+ supports_vision: std::sync::Arc::new(|_| false),
+ resolve_model: std::sync::Arc::new(|_, config, model| {
+ model
+ .map(str::trim)
+ .filter(|model| !model.is_empty() && !model.starts_with("hint:"))
+ .map(str::to_string)
+ .or_else(|| {
+ config
+ .config
+ .default_model
+ .as_deref()
+ .filter(|model| !model.trim().is_empty())
+ .map(str::to_string)
+ })
+ .or_else(|| Some("embed-test-model".to_string()))
+ }),
+ context_window: std::sync::Arc::new(|_| None),
+ default_pricing: std::sync::Arc::new(|| None),
+ without_reasoning: std::sync::Arc::new(|request| request),
+ }),
},
);
}