pub struct OpenAILikeLLMService { /* private fields */ }
Expand description
基于 Rig 的 OpenAI兼容 LLM 服务实现
Implementations§
Trait Implementations§
Source§impl LLMService for OpenAILikeLLMService
impl LLMService for OpenAILikeLLMService
Source§fn analyze_project<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
metadata: &'life1 ProjectMetadata,
config: &'life2 Config,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn analyze_project<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
metadata: &'life1 ProjectMetadata,
config: &'life2 Config,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
根据项目元数据和配置分析项目并返回生成的文档文本
Source§fn generate_response<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
system_prompt: &'life2 str,
config: &'life3 Config,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn generate_response<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
system_prompt: &'life2 str,
config: &'life3 Config,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
使用 system prompt + user prompt 调用 LLM 并返回生成结果(带重试机制)
Auto Trait Implementations§
impl Freeze for OpenAILikeLLMService
impl !RefUnwindSafe for OpenAILikeLLMService
impl Send for OpenAILikeLLMService
impl Sync for OpenAILikeLLMService
impl Unpin for OpenAILikeLLMService
impl !UnwindSafe for OpenAILikeLLMService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more