wip
This commit is contained in:
parent
db949546cf
commit
073227ec41
6 changed files with 50 additions and 10 deletions
|
@ -2639,7 +2639,11 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
fn prompt_capabilities(&self) -> acp::PromptCapabilities {
|
||||
fn prompt_capabilities(
|
||||
&self,
|
||||
_session: &acp::SessionId,
|
||||
_cx: &mut App,
|
||||
) -> acp::PromptCapabilities {
|
||||
acp::PromptCapabilities {
|
||||
image: true,
|
||||
audio: true,
|
||||
|
|
|
@ -38,7 +38,11 @@ pub trait AgentConnection {
|
|||
cx: &mut App,
|
||||
) -> Task<Result<acp::PromptResponse>>;
|
||||
|
||||
fn prompt_capabilities(&self) -> acp::PromptCapabilities;
|
||||
fn prompt_capabilities(
|
||||
&self,
|
||||
session: &acp::SessionId,
|
||||
cx: &mut App,
|
||||
) -> acp::PromptCapabilities;
|
||||
|
||||
fn resume(
|
||||
&self,
|
||||
|
@ -348,7 +352,11 @@ mod test_support {
|
|||
Task::ready(Ok(thread))
|
||||
}
|
||||
|
||||
fn prompt_capabilities(&self) -> acp::PromptCapabilities {
|
||||
fn prompt_capabilities(
|
||||
&self,
|
||||
_session: &acp::SessionId,
|
||||
_cx: &mut App,
|
||||
) -> acp::PromptCapabilities {
|
||||
acp::PromptCapabilities {
|
||||
image: true,
|
||||
audio: true,
|
||||
|
|
|
@ -26,7 +26,7 @@ use std::collections::HashMap;
|
|||
use std::path::Path;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
use util::ResultExt;
|
||||
use util::{ResultExt, maybe};
|
||||
|
||||
const RULES_FILE_NAMES: [&str; 9] = [
|
||||
".rules",
|
||||
|
@ -925,9 +925,23 @@ impl acp_thread::AgentConnection for NativeAgentConnection {
|
|||
})
|
||||
}
|
||||
|
||||
fn prompt_capabilities(&self) -> acp::PromptCapabilities {
|
||||
fn prompt_capabilities(
|
||||
&self,
|
||||
session: &acp::SessionId,
|
||||
cx: &mut App,
|
||||
) -> acp::PromptCapabilities {
|
||||
let model = maybe!({
|
||||
let thread = self
|
||||
.0
|
||||
.read(cx)
|
||||
.sessions
|
||||
.get(session)
|
||||
.map(|session| session.thread.clone())?;
|
||||
thread.read(cx).model().cloned()
|
||||
});
|
||||
let image = model.map_or(true, |model| model.supports_images());
|
||||
acp::PromptCapabilities {
|
||||
image: true,
|
||||
image,
|
||||
audio: false,
|
||||
embedded_context: true,
|
||||
}
|
||||
|
|
|
@ -279,7 +279,12 @@ impl AgentConnection for AcpConnection {
|
|||
})
|
||||
}
|
||||
|
||||
fn prompt_capabilities(&self) -> acp::PromptCapabilities {
|
||||
fn prompt_capabilities(
|
||||
&self,
|
||||
_session: &acp::SessionId,
|
||||
_cx: &mut App,
|
||||
) -> acp::PromptCapabilities {
|
||||
// TODO: support ACP sending prompt capabilities per session?
|
||||
self.prompt_capabilities
|
||||
}
|
||||
|
||||
|
|
|
@ -319,7 +319,11 @@ impl AgentConnection for ClaudeAgentConnection {
|
|||
cx.foreground_executor().spawn(async move { end_rx.await? })
|
||||
}
|
||||
|
||||
fn prompt_capabilities(&self) -> acp::PromptCapabilities {
|
||||
fn prompt_capabilities(
|
||||
&self,
|
||||
_session: &acp::SessionId,
|
||||
_cx: &mut App,
|
||||
) -> acp::PromptCapabilities {
|
||||
acp::PromptCapabilities {
|
||||
image: true,
|
||||
audio: false,
|
||||
|
|
|
@ -471,8 +471,9 @@ impl AcpThreadView {
|
|||
Ok(thread) => {
|
||||
let action_log = thread.read(cx).action_log().clone();
|
||||
|
||||
let session = thread.read(cx).session_id().clone();
|
||||
this.prompt_capabilities
|
||||
.set(connection.prompt_capabilities());
|
||||
.set(connection.prompt_capabilities(&session, cx));
|
||||
|
||||
let count = thread.read(cx).entries().len();
|
||||
this.list_state.splice(0..0, count);
|
||||
|
@ -5316,7 +5317,11 @@ pub(crate) mod tests {
|
|||
&[]
|
||||
}
|
||||
|
||||
fn prompt_capabilities(&self) -> acp::PromptCapabilities {
|
||||
fn prompt_capabilities(
|
||||
&self,
|
||||
_session: &acp::SessionId,
|
||||
_cx: &mut App,
|
||||
) -> acp::PromptCapabilities {
|
||||
acp::PromptCapabilities {
|
||||
image: true,
|
||||
audio: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue