mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-09-02 09:39:37 +00:00
Login flow
This commit is contained in:
+13
-2
@@ -5,6 +5,7 @@
|
||||
mod nearai;
|
||||
mod provider;
|
||||
mod reasoning;
|
||||
pub mod session;
|
||||
|
||||
pub use nearai::NearAiProvider;
|
||||
pub use provider::{
|
||||
@@ -12,6 +13,7 @@ pub use provider::{
|
||||
ToolCompletionRequest, ToolCompletionResponse, ToolDefinition, ToolResult,
|
||||
};
|
||||
pub use reasoning::{ActionPlan, Reasoning, ReasoningContext, ToolSelection};
|
||||
pub use session::{SessionConfig, SessionManager, create_session_manager};
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -19,6 +21,15 @@ use crate::config::LlmConfig;
|
||||
use crate::error::LlmError;
|
||||
|
||||
/// Create an LLM provider based on configuration.
|
||||
pub fn create_llm_provider(config: &LlmConfig) -> Result<Arc<dyn LlmProvider>, LlmError> {
|
||||
Ok(Arc::new(NearAiProvider::new(config.nearai.clone())))
|
||||
///
|
||||
/// Requires a session manager for authentication. Use `create_session_manager`
|
||||
/// to create one from the config.
|
||||
pub fn create_llm_provider(
|
||||
config: &LlmConfig,
|
||||
session: Arc<SessionManager>,
|
||||
) -> Result<Arc<dyn LlmProvider>, LlmError> {
|
||||
Ok(Arc::new(NearAiProvider::new(
|
||||
config.nearai.clone(),
|
||||
session,
|
||||
)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user