From 8a717abe0d5abc293e4b81e112a41fa8ab13b821 Mon Sep 17 00:00:00 2001 From: tidely <43219534+tidely@users.noreply.github.com> Date: Mon, 28 Apr 2025 16:58:10 +0300 Subject: [PATCH] ollama: Fix build with default features (#29502) The `ollama` crate has a `use schemars::JsonSchema` statement even when building with default features, which doesn't include the `schemars` crate. Release Notes: - N/A --- crates/ollama/src/ollama.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ollama/src/ollama.rs b/crates/ollama/src/ollama.rs index 17a084d61d33fe55d7bddf8ebf1fd636c3dc3b86..2a032a68f4e6b3ace6335ba81dbf75c6cb732e2b 100644 --- a/crates/ollama/src/ollama.rs +++ b/crates/ollama/src/ollama.rs @@ -1,7 +1,6 @@ use anyhow::{Context as _, Result, anyhow}; use futures::{AsyncBufReadExt, AsyncReadExt, StreamExt, io::BufReader, stream::BoxStream}; use http_client::{AsyncBody, HttpClient, Method, Request as HttpRequest, http}; -use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use serde_json::{Value, value::RawValue}; use std::{convert::TryFrom, sync::Arc, time::Duration}; @@ -39,7 +38,8 @@ impl From for String { } } -#[derive(Clone, Serialize, Deserialize, Debug, Eq, PartialEq, JsonSchema)] +#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[derive(Clone, Serialize, Deserialize, Debug, Eq, PartialEq)] #[serde(untagged)] pub enum KeepAlive { /// Keep model alive for N seconds