Skip to content

Commit

Permalink
Fix tests / docs / pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
timonv committed Jan 11, 2025
1 parent bc312fd commit 1f6010b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: "Test"
run: cargo test -j 2 --all-features --tests
run: cargo test -j 2 --all-features --no-fail-fast
16 changes: 0 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ fastembed = "4.4"
flv-util = "0.5.2"
htmd = "0.1"
ignore = "0.4"
ollama-rs = "0.2.2"
proc-macro2 = "1.0"
quote = "1.0"
redis = "0.27"
Expand Down
2 changes: 1 addition & 1 deletion swiftide-agents/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//!
//! # Example
//!
//! ```no_run
//! ```ignore
//! # use swiftide_agents::Agent;
//! # use swiftide_integrations as integrations;
//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
Expand Down
2 changes: 1 addition & 1 deletion swiftide-core/src/search_strategies/custom_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type QueryGenerator<Q> = Arc<dyn Fn(&Query<states::Pending>) -> Result<Q> + Send
/// * `Q` - The retriever-specific query type (e.g., `sqlx::QueryBuilder` for `PostgreSQL`)
///
/// # Examples
/// ```rust
/// ```ignore
/// // Define search configuration
/// const MAX_SEARCH_RESULTS: i64 = 5;
///
Expand Down
5 changes: 2 additions & 3 deletions swiftide-integrations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ aws-sdk-bedrockruntime = { workspace = true, features = [
], optional = true }
secrecy = { workspace = true, optional = true }
reqwest = { workspace = true, optional = true }
ollama-rs = { workspace = true, optional = true }
deadpool = { workspace = true, features = [
"managed",
"rt_tokio_1",
Expand Down Expand Up @@ -127,8 +126,8 @@ tree-sitter = [
openai = ["dep:async-openai"]
# Groq prompting
groq = ["dep:async-openai", "dep:secrecy", "dep:reqwest"]
# Ollama prompting
ollama = ["dep:ollama-rs"]
# Ollama prompting, embedding, chatcompletion
ollama = ["dep:async-openai", "dep:secrecy", "dep:reqwest"]
# FastEmbed (by qdrant) for fast, local embeddings
fastembed = ["dep:fastembed"]
# Scraping via spider as loader and a html to markdown transformer
Expand Down
10 changes: 9 additions & 1 deletion swiftide-integrations/src/ollama/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use reqwest::header::HeaderMap;
use secrecy::Secret;
use serde::Deserialize;

const OLLAMA_API_BASE: &str = "http://localhost:11434";
const OLLAMA_API_BASE: &str = "http://localhost:11434/v1";

#[derive(Clone, Debug, Deserialize)]
#[serde(default)]
Expand All @@ -11,6 +11,14 @@ pub struct OllamaConfig {
api_key: Secret<String>,
}

impl OllamaConfig {
pub fn with_api_base(&mut self, api_base: &str) -> &mut Self {
self.api_base = api_base.to_string();

self
}
}

impl Default for OllamaConfig {
fn default() -> Self {
Self {
Expand Down

0 comments on commit 1f6010b

Please sign in to comment.