mirror of
https://github.com/katanemo/plano.git
synced 2026-05-10 16:22:42 +02:00
support developer role in chat completions API (#867)
This commit is contained in:
parent
1d3f4d6c05
commit
7606c55b4b
7 changed files with 15 additions and 8 deletions
|
|
@ -762,7 +762,7 @@ impl ArchFunctionHandler {
|
|||
|
||||
// Keep system message if present
|
||||
if let Some(first) = messages.first() {
|
||||
if first.role == Role::System {
|
||||
if first.role == Role::System || first.role == Role::Developer {
|
||||
if let Some(MessageContent::Text(content)) = &first.content {
|
||||
num_tokens += content.len() / 4; // Approximate 4 chars per token
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ impl OrchestratorModel for OrchestratorModelV1 {
|
|||
.iter()
|
||||
.filter(|m| {
|
||||
m.role != Role::System
|
||||
&& m.role != Role::Developer
|
||||
&& m.role != Role::Tool
|
||||
&& !m.content.extract_text().is_empty()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ impl RouterModel for RouterModelV1 {
|
|||
.iter()
|
||||
.filter(|m| {
|
||||
m.role != Role::System
|
||||
&& m.role != Role::Developer
|
||||
&& m.role != Role::Tool
|
||||
&& !m.content.extract_text().is_empty()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue