Skip to content

Commit

Permalink
Add Moderation trait to OpenRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
zakiali committed Jan 9, 2025
1 parent ba24be7 commit 97aa29b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/goose/src/providers/openrouter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::time::Duration;

use super::base::ProviderUsage;
use super::base::{Provider, Usage};
use super::base::{Moderation, ModerationResult};
use super::configs::OpenAiProviderConfig;
use super::configs::{ModelConfig, ProviderModelConfig};
use super::model_pricing::cost;
Expand Down Expand Up @@ -73,7 +74,7 @@ impl Provider for OpenRouterProvider {
cost
)
)]
async fn complete(
async fn complete_internal(
&self,
system: &str,
messages: &[Message],
Expand Down Expand Up @@ -112,6 +113,13 @@ impl Provider for OpenRouterProvider {
}
}

#[async_trait]
impl Moderation for OpenRouterProvider {
async fn moderate_content(&self, content: &str) -> Result<ModerationResult> {

Check failure on line 118 in crates/goose/src/providers/openrouter.rs

View workflow job for this annotation

GitHub Actions / build

unused variable: `content`
Ok(ModerationResult::new(false, None, None))
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 97aa29b

Please sign in to comment.