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
This commit is contained in:
tidely 2025-04-28 16:58:10 +03:00 committed by GitHub
parent f735c90c3f
commit 8a717abe0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,6 @@
use anyhow::{Context as _, Result, anyhow}; use anyhow::{Context as _, Result, anyhow};
use futures::{AsyncBufReadExt, AsyncReadExt, StreamExt, io::BufReader, stream::BoxStream}; use futures::{AsyncBufReadExt, AsyncReadExt, StreamExt, io::BufReader, stream::BoxStream};
use http_client::{AsyncBody, HttpClient, Method, Request as HttpRequest, http}; use http_client::{AsyncBody, HttpClient, Method, Request as HttpRequest, http};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::{Value, value::RawValue}; use serde_json::{Value, value::RawValue};
use std::{convert::TryFrom, sync::Arc, time::Duration}; use std::{convert::TryFrom, sync::Arc, time::Duration};
@ -39,7 +38,8 @@ impl From<Role> 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)] #[serde(untagged)]
pub enum KeepAlive { pub enum KeepAlive {
/// Keep model alive for N seconds /// Keep model alive for N seconds