Skip to content

Commit

Permalink
fix: docs imports and refs
Browse files Browse the repository at this point in the history
  • Loading branch information
mateobelanger committed Nov 3, 2024
1 parent a1be7c4 commit 3fb10d6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
5 changes: 1 addition & 4 deletions rig-core/examples/gemini_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ use rig::{
completion::Prompt,
providers::gemini::{self, completion::gemini_api_types::GenerationConfig},
};

use std::panic;
use tracing::debug;

#[tracing::instrument(ret)]
#[tokio::main]

async fn main() -> Result<(), anyhow::Error> {
tracing_subscriber::fmt()
.with_max_level(tracing::Level::DEBUG)
Expand Down
8 changes: 4 additions & 4 deletions rig-core/src/providers/gemini/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ impl Client {
}

/// Create a completion model with the given name.
/// Gemini-specific parameters can be set using the [GenerationConfig](crate::providers::gemini::completion::GenerationConfig) struct.
/// https://ai.google.dev/api/generate-content#generationconfig
/// Gemini-specific parameters can be set using the [GenerationConfig](crate::providers::gemini::completion::gemini_api_types::GenerationConfig) struct.
/// [Gemini API Reference](https://ai.google.dev/api/generate-content#generationconfig)
pub fn completion_model(&self, model: &str) -> CompletionModel {
CompletionModel::new(self.clone(), model)
}

/// Create an agent builder with the given completion model.
/// Gemini-specific parameters can be set using the [GenerationConfig](crate::providers::gemini::completion::GenerationConfig) struct.
/// https://ai.google.dev/api/generate-content#generationconfig
/// Gemini-specific parameters can be set using the [GenerationConfig](crate::providers::gemini::completion::gemini_api_types::GenerationConfig) struct.
/// [Gemini API Reference](https://ai.google.dev/api/generate-content#generationconfig)
/// # Example
/// ```
/// use rig::providers::gemini::{Client, self};
Expand Down
10 changes: 5 additions & 5 deletions rig-core/src/providers/gemini/completion.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ================================================================
//! Google Gemini Completion Integration
//! https://ai.google.dev/api/generate-content
//! From [Gemini API Reference](https://ai.google.dev/api/generate-content)
// ================================================================

/// `gemini-1.5-flash` completion model
Expand Down Expand Up @@ -374,7 +374,7 @@ pub mod gemini_api_types {
Model,
}

/// A datatype containing media that is part of a multi-part [Content](Content) message.
/// A datatype containing media that is part of a multi-part [Content] message.
/// A Part consists of data which has an associated datatype. A Part can only contain one of the accepted types in Part.data.
/// A Part must have a fixed IANA MIME type identifying the type and subtype of the media if the inlineData field is filled with raw bytes.
#[derive(Debug, Default, Deserialize, Serialize)]
Expand Down Expand Up @@ -573,7 +573,7 @@ pub mod gemini_api_types {
}

/// Gemini API Configuration options for model generation and outputs. Not all parameters are
/// configurable for every model. https://ai.google.dev/api/generate-content#generationconfig
/// configurable for every model. From [[Gemini API Reference]](https://ai.google.dev/api/generate-content#generationconfig)
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GenerationConfig {
Expand Down Expand Up @@ -653,7 +653,7 @@ pub mod gemini_api_types {
}
/// The Schema object allows the definition of input and output data types. These types can be objects, but also
/// primitives and arrays. Represents a select subset of an OpenAPI 3.0 schema object.
/// https://ai.google.dev/api/caching#Schema
/// From [Gemini API Reference](https://ai.google.dev/api/caching#Schema)
#[derive(Debug, Deserialize, Serialize)]
pub struct Schema {
pub r#type: String,
Expand Down Expand Up @@ -748,7 +748,7 @@ pub mod gemini_api_types {
/// to learn how to incorporate safety considerations in your AI applications.
pub safety_settings: Option<Vec<SafetySetting>>,
/// Optional. Developer set system instruction(s). Currently, text only.
/// https://ai.google.dev/gemini-api/docs/system-instructions?lang=rest
/// From [Gemini API Reference](https://ai.google.dev/gemini-api/docs/system-instructions?lang=rest)
pub system_instruction: Option<Content>,
// cachedContent: Optional<String>
}
Expand Down
2 changes: 1 addition & 1 deletion rig-core/src/providers/gemini/embedding.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ================================================================
//! Google Gemini Embeddings Integration
//! https://ai.google.dev/api/embeddings
//! From [Gemini API Reference](https://ai.google.dev/api/embeddings)
// ================================================================

use serde_json::json;
Expand Down

0 comments on commit 3fb10d6

Please sign in to comment.