origin_gamedb/lib.rs
1//! # Origin GameDB
2//!
3//! Rust SDK for the Origin GameDB service, a knowledge graph API built on top
4//! of Cognee for ingesting game design data and querying it semantically.
5//!
6//! ## Quick Start
7//!
8//! ```rust,no_run
9//! use origin_gamedb::{CognifyOptions, GameDbClient, SearchOptions, SearchType};
10//!
11//! #[tokio::main]
12//! async fn main() -> origin_gamedb::Result<()> {
13//! let gamedb = GameDbClient::new("ca_xxx_token");
14//!
15//! gamedb.create_dataset("combat-design").await?;
16//! gamedb
17//! .add_text("combat-design", "Poise breaks after repeated heavy attacks.")
18//! .await?;
19//!
20//! gamedb
21//! .cognify(&CognifyOptions {
22//! datasets: Some(vec!["combat-design".into()]),
23//! run_in_background: Some(true),
24//! ..Default::default()
25//! })
26//! .await?;
27//!
28//! let results = gamedb
29//! .search(
30//! "What systems interact with poise?",
31//! Some(SearchOptions {
32//! search_type: Some(SearchType::Summaries),
33//! top_k: Some(5),
34//! ..Default::default()
35//! }),
36//! )
37//! .await?;
38//!
39//! println!("{results}");
40//! Ok(())
41//! }
42//! ```
43
44pub mod client;
45pub mod error;
46pub mod transport;
47pub mod types;
48
49pub use client::GameDbClient;
50pub use error::{OriginError, Result};
51pub use types::*;
52
53/// Default GameDB API endpoint.
54pub const DEFAULT_BASE_URL: &str = "https://cogneeapi.origingame.dev";