Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
545 changes: 261 additions & 284 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ opsml-client = { path = "crates/opsml_client" }
opsml-colors = { path = "crates/opsml_colors" }
opsml-events = { path = "crates/opsml_events" }
opsml-interfaces = { path = "crates/opsml_interfaces" }
opsml-genai = { path = "crates/opsml_genai" }
opsml-registry = { path = "crates/opsml_registry" }
opsml-experiment = { path = "crates/opsml_experiment" }
opsml-mcp = { path = "crates/opsml_mcp" }
Expand Down Expand Up @@ -74,7 +73,7 @@ futures-util = "0.*"
gcloud-storage = { version = "1.*", features = ["auth"] }
gcloud-auth = { version = "1.*" }
headers = { version = "0.*" }
hkdf = "0.*"
hkdf = "0.12.*"
jsonwebtoken = "9.*"
metrics = { version = "0.*", default-features = false }
metrics-exporter-prometheus = { version = "0.*", default-features = false }
Expand All @@ -88,7 +87,7 @@ owo-colors = "4.*"
password-auth = "1.*"
pbkdf2 = { version = "0.*", features = ["hmac"] }
potato-head = "0.*"
pyo3 = { version = "0.27.2", features = ["abi3-py310", "extension-module", "anyhow", "serde", "chrono"] }
pyo3 = { version = "0.28.*", features = ["abi3-py310", "extension-module", "anyhow", "serde", "chrono"] }
rand = { version = "0.9.1"}
rayon = "1.*"
regex = "1.*"
Expand All @@ -98,7 +97,7 @@ rusty-logging = "0.*"
pythonize = { version = "0.*" }
# we cant use crates.io because scouter relies on a fork of linfa at the moment
scouter-client = { git = "https://github.com/demml/scouter", branch = "main" }
sha2 = "0.10"
sha2 = "0.10.*"
semver = "1.*"
serde = { version = "1.*", features = ["derive"] }
serde_json = "1.*"
Expand Down
2 changes: 1 addition & 1 deletion crates/opsml_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn create_service_reloader(
/// - An optional reloader that is responsible for reloading the ServiceCard and its associated
/// resources when changes are detected
/// The service and queue are put behind Arc RWLocks to ensure thread safety when updating using the reloader
#[pyclass]
#[pyclass(skip_from_py_object)]
#[derive(Debug)]
pub struct AppState {
pub service: Arc<RwLock<Py<ServiceCard>>>,
Expand Down
2 changes: 1 addition & 1 deletion crates/opsml_app/src/reloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn is_past_scheduled_reload(scheduled_reload: &DateTime<Utc>) -> bool {
*scheduled_reload <= now
}

#[pyclass]
#[pyclass(from_py_object)]
#[derive(Clone, Debug)]
pub struct ReloadConfig {
#[pyo3(get, set)]
Expand Down
4 changes: 2 additions & 2 deletions crates/opsml_cards/src/data/datacard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn interface_from_metadata<'py>(
}
}

#[pyclass]
#[pyclass(from_py_object)]
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub struct DataCardMetadata {
#[pyo3(get, set)]
Expand All @@ -56,7 +56,7 @@ pub struct DataCardMetadata {
pub interface_metadata: DataInterfaceMetadata,
}

#[pyclass]
#[pyclass(skip_from_py_object)]
pub struct DataCard {
#[pyo3(get, set)]
pub interface: Option<Py<PyAny>>,
Expand Down
4 changes: 2 additions & 2 deletions crates/opsml_cards/src/experiment/experimentcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use serde::{
ser::SerializeStruct,
};

#[pyclass]
#[pyclass(from_py_object)]
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub struct UidMetadata {
#[pyo3(get, set)]
Expand All @@ -41,7 +41,7 @@ pub struct UidMetadata {
pub experimentcard_uids: Vec<String>,
}

#[pyclass]
#[pyclass(skip_from_py_object)]
pub struct ExperimentCard {
#[pyo3(get, set)]
pub space: String,
Expand Down
4 changes: 2 additions & 2 deletions crates/opsml_cards/src/model/modelcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn interface_from_metadata<'py>(
}
}

#[pyclass]
#[pyclass(from_py_object)]
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub struct ModelCardMetadata {
#[pyo3(get, set)]
Expand Down Expand Up @@ -86,7 +86,7 @@ impl ModelCardMetadata {
}
}

#[pyclass]
#[pyclass(skip_from_py_object)]
pub struct ModelCard {
#[pyo3(get, set)]
pub interface: Option<Py<PyAny>>,
Expand Down
32 changes: 16 additions & 16 deletions crates/opsml_cards/src/prompt/promptcard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use pyo3::types::PyList;
use scouter_client::AssertionTasks;
use scouter_client::ProfileRequest;
use scouter_client::TasksFile;
use scouter_client::{DriftType, GenAIEvalConfig, GenAIEvalProfile};
use scouter_client::{AgentEvalConfig, AgentEvalProfile, DriftType};
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use sha2::{Digest, Sha256};
Expand Down Expand Up @@ -43,7 +43,7 @@ pub fn deserialize_from_path<T: DeserializeOwned>(path: PathBuf) -> Result<T, Ca
Ok(item)
}

#[pyclass]
#[pyclass(from_py_object)]
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub struct PromptCardMetadata {
#[pyo3(get, set)]
Expand All @@ -56,7 +56,7 @@ pub struct PromptCardMetadata {
pub drift_profile_uri_map: Option<HashMap<String, DriftProfileUri>>,
}

#[pyclass]
#[pyclass(from_py_object)]
#[derive(Debug, Serialize, Clone)]
pub struct PromptCard {
pub prompt: Prompt,
Expand Down Expand Up @@ -95,7 +95,7 @@ pub struct PromptCard {
pub opsml_version: String,

#[pyo3(get, set)]
pub eval_profile: Option<GenAIEvalProfile>,
pub eval_profile: Option<AgentEvalProfile>,
}

impl ProfileExt for PromptCard {
Expand Down Expand Up @@ -177,7 +177,7 @@ impl PromptCard {
name: Option<&str>,
version: Option<&str>,
tags: Option<Vec<String>>,
eval_profile: Option<GenAIEvalProfile>,
eval_profile: Option<AgentEvalProfile>,
) -> Result<Self, CardError> {
let prompt = prompt.extract::<Prompt>().inspect_err(|e| {
error!("Failed to extract prompt: {e}");
Expand Down Expand Up @@ -273,10 +273,10 @@ impl PromptCard {
&mut self,
alias: String,
tasks: &Bound<'_, PyList>,
config: Option<GenAIEvalConfig>,
config: Option<AgentEvalConfig>,
) -> Result<(), CardError> {
debug!("Creating eval profile");
self.eval_profile = Some(GenAIEvalProfile::new_py(tasks, config, Some(alias))?);
self.eval_profile = Some(AgentEvalProfile::new_py(tasks, config, Some(alias))?);
Ok(())
}

Expand Down Expand Up @@ -345,7 +345,7 @@ impl PromptCard {

#[derive(Debug, Deserialize)]
pub struct EvaluationConfig {
pub config: Option<GenAIEvalConfig>,
pub config: Option<AgentEvalConfig>,
pub tasks: TasksFile,
pub alias: String,
}
Expand Down Expand Up @@ -382,12 +382,12 @@ impl PromptConfig {
let tasks: AssertionTasks = AssertionTasks::from_tasks_file(evaluation.tasks);

debug!(
"Building GenAIEvalProfile with alias and tasks: {} - tasks: {:?}",
"Building AgentEvalProfile with alias and tasks: {} - tasks: {:?}",
evaluation.alias, tasks
);
let profile = GenAIEvalProfile::build_from_parts(config, tasks, Some(evaluation.alias))
let profile = AgentEvalProfile::build_from_parts(config, tasks, Some(evaluation.alias))
.inspect_err(|e| {
error!("Failed to build GenAIEvalProfile: {e}");
error!("Failed to build AgentEvalProfile: {e}");
})?;
card.eval_profile = Some(profile);
}
Expand All @@ -410,7 +410,7 @@ pub struct PromptCardInternal {
pub created_at: DateTime<Utc>,
pub is_card: bool,
pub opsml_version: String,
pub eval_profile: Option<GenAIEvalProfile>,
pub eval_profile: Option<AgentEvalProfile>,
}

#[derive(Debug, Deserialize)]
Expand Down Expand Up @@ -463,7 +463,7 @@ impl PromptCard {
name: Option<&str>,
version: Option<&str>,
tags: Option<Vec<String>>,
eval_profile: Option<GenAIEvalProfile>,
eval_profile: Option<AgentEvalProfile>,
) -> Result<Self, CardError> {
let registry_type = RegistryType::Prompt;
let base_args = BaseArgs::create_args(name, space, version, None, &registry_type)?;
Expand Down Expand Up @@ -514,7 +514,7 @@ impl PromptCard {
let relative_path = save_dir.join(alias.clone()).with_extension(Suffix::Json);
let full_path = path.join(&relative_path);

let drift_type = DriftType::GenAI;
let drift_type = DriftType::Agent;
profile.save_to_json(Some(full_path))?;

drift_url_map.insert(
Expand Down Expand Up @@ -556,8 +556,8 @@ impl PromptCard {
let file = std::fs::read_to_string(&filepath)?;

match drift_profile_uri.drift_type {
DriftType::GenAI => {
let profile = GenAIEvalProfile::model_validate_json(file);
DriftType::Agent => {
let profile = AgentEvalProfile::model_validate_json(file);
self.eval_profile = Some(profile);
}
_ => {
Expand Down
8 changes: 4 additions & 4 deletions crates/opsml_cards/src/service/card_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type OptionalPyBound<'py> = Option<PyBoundAny<'py>>;
type ExtractedKwargs<'py> = (OptionalPyBound<'py>, OptionalPyBound<'py>);

#[derive(PartialEq, Debug, Clone)]
#[pyclass(eq)]
#[pyclass(eq, from_py_object)]
pub struct ServiceInfo {
pub space: String,
pub name: String,
Expand All @@ -53,7 +53,7 @@ impl ServiceInfo {
}
}

#[pyclass]
#[pyclass(skip_from_py_object)]
struct CardListIter {
inner: std::vec::IntoIter<Card>,
}
Expand All @@ -76,7 +76,7 @@ impl CardListIter {
///
/// # Attributes
/// * `cards`: A vector of `Card` objects
#[pyclass(eq)]
#[pyclass(eq, skip_from_py_object)]
#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
pub struct CardList {
#[pyo3(get)]
Expand Down Expand Up @@ -142,7 +142,7 @@ impl CardList {

/// ServiceCard is a collection of cards that can be associated and loaded in one call
/// aka a ServiceCard. We use ServiceCard for consistency with developing "Applications".
#[pyclass(subclass)]
#[pyclass(subclass, skip_from_py_object)]
#[derive(Debug)]
pub struct ServiceCard {
#[pyo3(get, set)]
Expand Down
2 changes: 1 addition & 1 deletion crates/opsml_cards/src/skill/card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub fn parse_skill_markdown(
)
}

#[pyclass]
#[pyclass(skip_from_py_object)]
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub struct SkillCard {
pub skill: AgentSkillStandard,
Expand Down
10 changes: 5 additions & 5 deletions crates/opsml_cli/src/actions/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use crate::actions::utils::{create_service_card_local, register_service_card};
use crate::cli::arg::{DownloadCard, IntoQueryArgs};
use crate::download_service;
use crate::error::CliError;
use opsml_registry::download::download_card_from_registry;
use opsml_cards::ServiceCard;
use opsml_colors::Colorize;
use opsml_registry::download::download_card_from_registry;
use opsml_registry::download::download_service_sub_cards;
use opsml_registry::error::RegistryError;
use opsml_registry::{CardRegistries, CardRegistry};
Expand Down Expand Up @@ -290,10 +290,10 @@ fn download_service_artifacts(
) -> Result<(), CliError> {
for artifact in lockfile.artifact {
let write_path = if let Some(path) = write_path.as_ref() {
path.to_path_buf()
} else {
std::env::current_dir()?
};
path.to_path_buf()
} else {
std::env::current_dir()?
};
let args = DownloadCard {
space: Some(artifact.space),
name: Some(artifact.name),
Expand Down
4 changes: 2 additions & 2 deletions crates/opsml_cli/src/cli/arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl IntoQueryArgs for ListCards {
}

#[derive(Args, Clone)]
#[pyclass]
#[pyclass(skip_from_py_object)]
pub struct DownloadCard {
/// Card space
#[arg(long = "space")]
Expand Down Expand Up @@ -230,7 +230,7 @@ pub struct KeyArgs {
}

#[derive(Args, Clone)]
#[pyclass]
#[pyclass(skip_from_py_object)]
pub struct ScouterArgs {
/// Space name
#[arg(long = "space")]
Expand Down
2 changes: 1 addition & 1 deletion crates/opsml_experiment/src/experiment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn extract_code(
Ok(())
}

#[pyclass]
#[pyclass(skip_from_py_object)]
pub struct Experiment {
pub experiment: Py<PyAny>,
pub registries: CardRegistries,
Expand Down
21 changes: 0 additions & 21 deletions crates/opsml_genai/Cargo.toml

This file was deleted.

28 changes: 0 additions & 28 deletions crates/opsml_genai/src/error.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/opsml_genai/src/lib.rs

This file was deleted.

2 changes: 1 addition & 1 deletion crates/opsml_interfaces/src/data/base/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use scouter_client::{DataProfile, DataProfiler};
use std::collections::HashMap;
use std::path::{Path, PathBuf};

#[pyclass(extends=DataInterface, subclass)]
#[pyclass(extends=DataInterface, subclass, skip_from_py_object)]
#[derive(Debug)]
pub struct ArrowData {
#[pyo3(get)]
Expand Down
Loading
Loading