reafctor: all code without stream
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
impl From<crate::core::llm::ChatRole> for crate::databases::postgres::chat::types::MessageRole {
|
||||
fn from(m: crate::core::llm::ChatRole) -> Self {
|
||||
match m {
|
||||
crate::core::llm::ChatRole::System => {
|
||||
crate::databases::postgres::chat::types::MessageRole::System
|
||||
}
|
||||
crate::core::llm::ChatRole::Assistant => {
|
||||
crate::databases::postgres::chat::types::MessageRole::Assistant
|
||||
}
|
||||
crate::core::llm::ChatRole::User => {
|
||||
crate::databases::postgres::chat::types::MessageRole::User
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<crate::core::auth::api_key::KeyRole>
|
||||
for crate::databases::postgres::api_key::types::Role
|
||||
{
|
||||
fn from(role: crate::core::auth::api_key::KeyRole) -> Self {
|
||||
match role {
|
||||
crate::core::auth::api_key::KeyRole::User => {
|
||||
crate::databases::postgres::api_key::types::Role::User
|
||||
}
|
||||
crate::core::auth::api_key::KeyRole::Admin => {
|
||||
crate::databases::postgres::api_key::types::Role::Admin
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user