diff --git a/CHANGELOG.md b/CHANGELOG.md index 776b2fb..938023c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Unreleased - Fix: added pre-commit hooks to further maintain code consistency. +- Security: updated some deps because dependabot told me, good bot. +- Security: bump `async-openai` to 0.41.1 (feature-gated types, transcription API rename; removes `backoff` transitive dep) - Refactor: deduplicated test database setup across common/src/storage/. - Refactor: split knowledge-graph.js monolith into focused functions. - Evaluations: simplified crate layout — linear pipeline, sharded-only converted store, in-memory ingestion, `db/` and `cli/` modules; namespace reuse state in corpus manifest (removed `cache/snapshots/`); no legacy JSON/history compatibility (re-run `--warm` after upgrade) diff --git a/Cargo.lock b/Cargo.lock index 1c2c9be..93be920 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -453,35 +453,37 @@ dependencies = [ [[package]] name = "async-openai" -version = "0.29.6" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58fd812d4b7152e0f748254c03927f27126a5d83fccf265b2baddaaa1aeea41" +checksum = "3007014661d5b98168b7b6f1014147bce8b1362a194783543eeb9f6117a20be9" dependencies = [ "async-openai-macros", - "backoff", "base64 0.22.1", "bytes", "derive_builder", "eventsource-stream", "futures", + "getrandom 0.3.4", "rand 0.9.2", - "reqwest", - "reqwest-eventsource", + "reqwest 0.13.4", "secrecy", "serde", "serde_json", + "serde_urlencoded", "thiserror 2.0.18", "tokio", "tokio-stream", "tokio-util", + "tower", "tracing", + "url", ] [[package]] name = "async-openai-macros" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81872a8e595e8ceceab71c6ba1f9078e313b452a1e31934e6763ef5d308705e4" +checksum = "492a944774207eed3acf425214eadbd6ce84a2b89331164ff1c11bae92b26302" dependencies = [ "proc-macro2", "quote", @@ -606,6 +608,28 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "aws-lc-rs" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ec2f1fc3ec205783a5da9a7e6c1509cc69dedf09a1949e412c1e18469326d00" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a2f9779ce85b93ab6170dd940ad0169b5766ff848247aff13bb788b832fe3f4" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + [[package]] name = "axum" version = "0.8.8" @@ -683,9 +707,9 @@ dependencies = [ [[package]] name = "axum_session" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbd59ac11f92412bd86308ce6c9d579e4a6ab627a2c7074afa5e4ef7144900d" +checksum = "7815c0f6c12768f5f1fb1f1340d21c8b3ce9139bb0b8eb07a211b30f85fa1d50" dependencies = [ "aes-gcm", "async-trait", @@ -700,7 +724,7 @@ dependencies = [ "hmac", "http", "http-body", - "rand 0.8.5", + "rand 0.9.2", "serde", "serde_json", "sha2", @@ -714,9 +738,9 @@ dependencies = [ [[package]] name = "axum_session_auth" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7302ab5019fe9d4138d91647205ca1f69c54211df7491847f4117efe91d473e" +checksum = "30ce1f03d6a0649a4ecb34a26f044a2d0bc0a38afcb5b413de1346549e835132" dependencies = [ "anyhow", "async-recursion", @@ -738,13 +762,14 @@ dependencies = [ [[package]] name = "axum_session_surreal" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e438a543bd3ebc957fd6c4fbad0b00b481e6477e88a9ea349e7584e65656b58" +checksum = "746ea7d3e931122129ca70c2eb3a1b5f4c6b7d32a2d0c1b0be4099a3fda2d30e" dependencies = [ "async-trait", "axum_session", "chrono", + "serde", "surrealdb", ] @@ -783,20 +808,6 @@ dependencies = [ "ubyte", ] -[[package]] -name = "backoff" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" -dependencies = [ - "futures-core", - "getrandom 0.2.17", - "instant", - "pin-project-lite", - "rand 0.8.5", - "tokio", -] - [[package]] name = "backtrace" version = "0.3.76" @@ -1303,6 +1314,15 @@ dependencies = [ "syn 2.0.115", ] +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + [[package]] name = "color-eyre" version = "0.6.5" @@ -1336,6 +1356,16 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "common" version = "0.1.0" @@ -1363,7 +1393,7 @@ dependencies = [ "minijinja-contrib", "minijinja-embed", "object_store 0.11.2", - "reqwest", + "reqwest 0.12.28", "serde", "serde_json", "sha2", @@ -2068,6 +2098,12 @@ dependencies = [ "dtoa", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "dyn-clone" version = "1.0.20" @@ -2495,12 +2531,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - [[package]] name = "futures-util" version = "0.3.31" @@ -2885,7 +2915,7 @@ dependencies = [ "log", "native-tls", "rand 0.9.2", - "reqwest", + "reqwest 0.12.28", "serde", "serde_json", "thiserror 2.0.18", @@ -3329,7 +3359,7 @@ dependencies = [ "headless_chrome", "lopdf 0.32.0", "pdf-extract", - "reqwest", + "reqwest 0.12.28", "retrieval-pipeline", "serde", "serde_json", @@ -3387,15 +3417,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - [[package]] name = "ipnet" version = "2.11.0" @@ -3486,6 +3507,55 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys", + "log", + "simd_cesu8", + "thiserror 2.0.18", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.115", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.115", +] + [[package]] name = "jobserver" version = "0.1.34" @@ -4056,15 +4126,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "nanoid" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" -dependencies = [ - "rand 0.8.5", -] - [[package]] name = "native-tls" version = "0.2.16" @@ -4319,7 +4380,7 @@ dependencies = [ "percent-encoding", "quick-xml", "rand 0.8.5", - "reqwest", + "reqwest 0.12.28", "ring", "serde", "serde_json", @@ -5020,6 +5081,7 @@ version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" dependencies = [ + "aws-lc-rs", "bytes", "getrandom 0.3.4", "lru-slab", @@ -5339,25 +5401,51 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", + "wasm-streams 0.4.2", "web-sys", "webpki-roots 1.0.6", ] [[package]] -name = "reqwest-eventsource" -version = "0.6.0" +name = "reqwest" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632c55746dbb44275691640e7b40c907c16a2dc1a5842aa98aaec90da6ec6bde" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" dependencies = [ - "eventsource-stream", + "base64 0.22.1", + "bytes", "futures-core", - "futures-timer", - "mime", - "nom 7.1.3", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "mime_guess", + "percent-encoding", "pin-project-lite", - "reqwest", - "thiserror 1.0.69", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams 0.5.0", + "web-sys", ] [[package]] @@ -5670,6 +5758,7 @@ version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ + "aws-lc-rs", "log", "once_cell", "ring", @@ -5701,12 +5790,40 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -6099,6 +6216,16 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" +[[package]] +name = "simd_cesu8" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f90157bb87cddf702797c5dadfa0be7d266cdf49e22da2fcaa32eff75b2c33" +dependencies = [ + "rustc_version", + "simdutf8", +] + [[package]] name = "simdutf8" version = "0.1.5" @@ -6413,9 +6540,9 @@ dependencies = [ [[package]] name = "surrealdb" -version = "2.6.1" +version = "2.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "085478c61364d88ad875a772944feefaba9f0fa24ddd12917f138ef23926ca94" +checksum = "3429154a8b5a98ca39100ba45ef49ae046fb1d0869dff78d78a2670b1b278982" dependencies = [ "arrayvec", "async-channel", @@ -6429,7 +6556,7 @@ dependencies = [ "path-clean", "pharos", "reblessive", - "reqwest", + "reqwest 0.12.28", "revision 0.11.0", "ring", "rust_decimal", @@ -6455,9 +6582,9 @@ dependencies = [ [[package]] name = "surrealdb-core" -version = "2.6.1" +version = "2.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87283061150fee74fc5e8be99495560b0bd11bc32db36412297544c73843c5c0" +checksum = "ba423d9e7e665e4c735a1d4669c3a067135e4a574edf88af215f7f2b815e70ed" dependencies = [ "addr", "affinitypool", @@ -6495,7 +6622,6 @@ dependencies = [ "lexicmp 0.1.0", "linfa-linalg", "md-5", - "nanoid", "ndarray 0.15.6", "ndarray-stats", "num-traits", @@ -6512,7 +6638,7 @@ dependencies = [ "rayon", "reblessive", "regex", - "reqwest", + "reqwest 0.12.28", "revision 0.11.0", "ring", "rmpv", @@ -7091,6 +7217,7 @@ dependencies = [ "pin-project-lite", "sync_wrapper", "tokio", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -7711,6 +7838,19 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wasmparser" version = "0.244.0" @@ -7768,6 +7908,15 @@ dependencies = [ "string_cache_codegen", ] +[[package]] +name = "webpki-root-certs" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "0.26.11" diff --git a/Cargo.toml b/Cargo.toml index ca8c315..6913f02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,13 +13,13 @@ resolver = "3" [workspace.dependencies] anyhow = "1.0.94" -async-openai = "0.29.3" +async-openai = { version = "0.41.1", features = ["chat-completion", "embedding", "audio", "model"] } async-stream = "0.3.6" async-trait = "0.1.88" axum-htmx = "0.7.0" -axum_session = "0.16" -axum_session_auth = "0.16" -axum_session_surreal = "0.4" +axum_session = "0.18" +axum_session_auth = "0.18" +axum_session_surreal = "0.6" axum_typed_multipart = "0.16" axum = { version = "0.8", features = ["multipart", "macros"] } chrono-tz = "0.10.1" @@ -39,8 +39,8 @@ reqwest = {version = "0.12.12", features = ["charset", "json"]} serde_json = "1.0.128" serde = { version = "1", features = ["derive"] } sha2 = "0.10.8" -surrealdb-migrations = "2.2.2" -surrealdb = { version = "2" } +surrealdb-migrations = "2.4.0" +surrealdb = { version = "2.6" } tempfile = "3.12.0" text-splitter = { version = "0.18.1", features = ["markdown", "tokenizers"] } tokenizers = { version = "0.20.4", features = ["http"] } diff --git a/common/src/utils/embedding.rs b/common/src/utils/embedding.rs index a052e2c..10732ad 100644 --- a/common/src/utils/embedding.rs +++ b/common/src/utils/embedding.rs @@ -9,7 +9,7 @@ use std::{ use serde::Serialize; use tracing::warn; -use async_openai::{types::CreateEmbeddingRequestArgs, Client}; +use async_openai::{types::embeddings::CreateEmbeddingRequestArgs, Client}; use fastembed::{EmbeddingModel, ModelTrait, TextEmbedding, TextInitOptions}; use tokio::sync::{OwnedSemaphorePermit, Semaphore}; diff --git a/html-router/package-lock.json b/html-router/package-lock.json index 024ddbc..30e8d63 100644 --- a/html-router/package-lock.json +++ b/html-router/package-lock.json @@ -958,9 +958,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "license": "MIT", "engines": { "node": ">=8.6" diff --git a/html-router/src/routes/admin/handlers.rs b/html-router/src/routes/admin/handlers.rs index bb36324..b06331d 100644 --- a/html-router/src/routes/admin/handlers.rs +++ b/html-router/src/routes/admin/handlers.rs @@ -1,4 +1,4 @@ -use async_openai::types::ListModelResponse; +use async_openai::types::models::ListModelResponse; use axum::{ extract::{Query, State}, Form, diff --git a/html-router/src/routes/chat/message_response_stream.rs b/html-router/src/routes/chat/message_response_stream.rs index 11bdab8..48801ae 100644 --- a/html-router/src/routes/chat/message_response_stream.rs +++ b/html-router/src/routes/chat/message_response_stream.rs @@ -234,7 +234,7 @@ fn build_chat_event_stream( state: HtmlState, openai_stream: impl Stream< Item = Result< - async_openai::types::CreateChatCompletionStreamResponse, + async_openai::types::chat::CreateChatCompletionStreamResponse, async_openai::error::OpenAIError, >, > + Send @@ -342,7 +342,7 @@ async fn prepare_chat_request( history: &[Message], ) -> Result< ( - async_openai::types::CreateChatCompletionRequest, + async_openai::types::chat::CreateChatCompletionRequest, Vec, ), SseResponse, diff --git a/ingestion-pipeline/src/pipeline/services.rs b/ingestion-pipeline/src/pipeline/services.rs index 7eb4485..a6d1571 100644 --- a/ingestion-pipeline/src/pipeline/services.rs +++ b/ingestion-pipeline/src/pipeline/services.rs @@ -3,7 +3,7 @@ use std::{ sync::{Arc, OnceLock}, }; -use async_openai::types::{ +use async_openai::types::chat::{ ChatCompletionRequestSystemMessage, ChatCompletionRequestUserMessage, CreateChatCompletionRequest, CreateChatCompletionRequestArgs, ResponseFormat, ResponseFormatJsonSchema, @@ -111,7 +111,7 @@ impl DefaultPipelineServices { json_schema: ResponseFormatJsonSchema { description: Some("Structured analysis of the submitted content".into()), name: "content_analysis".into(), - schema: Some(get_ingress_analysis_schema()), + schema: get_ingress_analysis_schema(), strict: Some(true), }, }; @@ -358,7 +358,7 @@ mod tests { use std::sync::Arc; use anyhow::Context; - use async_openai::{config::OpenAIConfig, types::ChatCompletionRequestMessage, Client}; + use async_openai::{config::OpenAIConfig, types::chat::ChatCompletionRequestMessage, Client}; use common::{ storage::{ db::SurrealDbClient, store::StorageManager, types::system_settings::SystemSettingsPatch, @@ -375,12 +375,12 @@ mod tests { use common::error::AppError; fn system_prompt_from_request( - request: &async_openai::types::CreateChatCompletionRequest, + request: &async_openai::types::chat::CreateChatCompletionRequest, ) -> anyhow::Result { let Some(ChatCompletionRequestMessage::System(system)) = request.messages.first() else { anyhow::bail!("expected first message to be system"); }; - let async_openai::types::ChatCompletionRequestSystemMessageContent::Text(text) = + let async_openai::types::chat::ChatCompletionRequestSystemMessageContent::Text(text) = &system.content else { anyhow::bail!("unexpected system message content: {:?}", system.content); diff --git a/ingestion-pipeline/src/utils/audio_transcription.rs b/ingestion-pipeline/src/utils/audio_transcription.rs index c528b6e..daf4d62 100644 --- a/ingestion-pipeline/src/utils/audio_transcription.rs +++ b/ingestion-pipeline/src/utils/audio_transcription.rs @@ -1,4 +1,4 @@ -use async_openai::types::{AudioResponseFormat, CreateTranscriptionRequestArgs}; +use async_openai::types::audio::{AudioResponseFormat, CreateTranscriptionRequestArgs}; use common::{ error::AppError, storage::{db::SurrealDbClient, types::system_settings::SystemSettings}, @@ -21,7 +21,8 @@ pub async fn transcribe_audio_file( let response = openai_client .audio() - .transcribe(request) + .transcription() + .create(request) .await .map_err(|e| AppError::Processing(format!("Audio transcription failed: {e}")))?; Ok(response.text) diff --git a/ingestion-pipeline/src/utils/image_parsing.rs b/ingestion-pipeline/src/utils/image_parsing.rs index f882f4d..844c0f7 100644 --- a/ingestion-pipeline/src/utils/image_parsing.rs +++ b/ingestion-pipeline/src/utils/image_parsing.rs @@ -1,4 +1,4 @@ -use async_openai::types::{ +use async_openai::types::chat::{ ChatCompletionRequestMessageContentPartImageArgs, ChatCompletionRequestMessageContentPartTextArgs, ChatCompletionRequestUserMessageArgs, CreateChatCompletionRequestArgs, ImageDetail, ImageUrlArgs, diff --git a/ingestion-pipeline/src/utils/pdf/vision.rs b/ingestion-pipeline/src/utils/pdf/vision.rs index 287c6a9..a36b059 100644 --- a/ingestion-pipeline/src/utils/pdf/vision.rs +++ b/ingestion-pipeline/src/utils/pdf/vision.rs @@ -1,6 +1,6 @@ //! Vision-LLM transcription of rendered PDF pages into Markdown. -use async_openai::types::{ +use async_openai::types::chat::{ ChatCompletionRequestMessageContentPartImageArgs, ChatCompletionRequestMessageContentPartTextArgs, ChatCompletionRequestUserMessageArgs, CreateChatCompletionRequest, CreateChatCompletionRequestArgs, ImageDetail, ImageUrlArgs, diff --git a/retrieval-pipeline/src/answer_retrieval.rs b/retrieval-pipeline/src/answer_retrieval.rs index 2fba43c..7ede797 100644 --- a/retrieval-pipeline/src/answer_retrieval.rs +++ b/retrieval-pipeline/src/answer_retrieval.rs @@ -2,7 +2,7 @@ use async_openai::{ error::OpenAIError, - types::{ + types::chat::{ ChatCompletionRequestSystemMessage, ChatCompletionRequestUserMessage, CreateChatCompletionRequest, CreateChatCompletionRequestArgs, ResponseFormat, ResponseFormatJsonSchema, @@ -107,7 +107,7 @@ pub fn create_chat_request( json_schema: ResponseFormatJsonSchema { description: Some("Query answering AI".into()), name: "query_answering_with_uuids".into(), - schema: Some(get_query_response_schema()), + schema: get_query_response_schema(), strict: Some(true), }, };