1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Moonshot AI (Kimi) endpoints and model identifiers.
//!
//! [`from_env`] and [`new`] build a client on the
//! [`MOONSHOT`](crate::providers::openai::wire::MOONSHOT) dialect, the module's
//! primary one; [`anthropic_from_env`] and [`anthropic_new`] build a
//! Messages-format client. Environment configuration reads `MOONSHOT_API_KEY`.
//!
//! ```no_run
//! use rig_core::providers::moonshot;
//!
//! # fn run() -> Result<(), Box<dyn std::error::Error>> {
//! let kimi = moonshot::from_env()?.chat(moonshot::KIMI_K3);
//! # let _ = kimi;
//! # Ok(())
//! # }
//! ```
/// Global OpenAI-compatible base URL.
pub const GLOBAL_API_BASE_URL: &str = "https://api.moonshot.ai/v1";
/// China OpenAI-compatible base URL.
pub const CHINA_API_BASE_URL: &str = "https://api.moonshot.cn/v1";
/// Anthropic-compatible base URL.
pub const ANTHROPIC_API_BASE_URL: &str = "https://api.moonshot.ai/anthropic";
/// China Anthropic-compatible base URL.
pub const CHINA_ANTHROPIC_API_BASE_URL: &str = "https://api.moonshot.cn/anthropic";
/// Identifier for the Kimi K3 model.
pub const KIMI_K3: &str = "kimi-k3";
/// Identifier for the Kimi K2.7 Code model.
pub const KIMI_K2_7_CODE: &str = "kimi-k2.7-code";
/// Identifier for the high-speed Kimi K2.7 Code model.
pub const KIMI_K2_7_CODE_HIGHSPEED: &str = "kimi-k2.7-code-highspeed";
/// Identifier for the Kimi K2.6 model.
pub const KIMI_K2_6: &str = "kimi-k2.6";
/// Whether Kimi `model` reads images: Kimi K2 before K2.5 and the
/// `moonshot-v1` text models do not; K2.5 and later, and `*-vision-*`, do.
/// Every wire Moonshot serves applies this rule to an id the catalog does
/// not list.
pub
/// The provider key: the dialect name, a reply's `Origin::provider` and
/// the typed provider-options key.
pub const PROVIDER_NAME: &str = "moonshot";
crateopenai_vendor!;
crateanthropic_vendor!;