context_servers: Pass env variables from settings (#17356)
Users can now pass an env dictionary of string: string mappings to a context server binary. Release Notes: - context_servers: Settings now allow the configuration of env variables that are passed to the server process
This commit is contained in:
parent
f38956943b
commit
74907cb3e6
1 changed files with 3 additions and 2 deletions
|
@ -39,6 +39,7 @@ pub struct ServerConfig {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
pub executable: String,
|
pub executable: String,
|
||||||
pub args: Vec<String>,
|
pub args: Vec<String>,
|
||||||
|
pub env: Option<HashMap<String, String>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Settings for ContextServerSettings {
|
impl Settings for ContextServerSettings {
|
||||||
|
@ -70,13 +71,13 @@ impl ContextServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn start(&self, cx: &AsyncAppContext) -> anyhow::Result<()> {
|
async fn start(&self, cx: &AsyncAppContext) -> anyhow::Result<()> {
|
||||||
log::info!("starting context server {}", self.config.id);
|
log::info!("starting context server {}", self.config.id,);
|
||||||
let client = Client::new(
|
let client = Client::new(
|
||||||
client::ContextServerId(self.config.id.clone()),
|
client::ContextServerId(self.config.id.clone()),
|
||||||
client::ModelContextServerBinary {
|
client::ModelContextServerBinary {
|
||||||
executable: Path::new(&self.config.executable).to_path_buf(),
|
executable: Path::new(&self.config.executable).to_path_buf(),
|
||||||
args: self.config.args.clone(),
|
args: self.config.args.clone(),
|
||||||
env: None,
|
env: self.config.env.clone(),
|
||||||
},
|
},
|
||||||
cx.clone(),
|
cx.clone(),
|
||||||
)?;
|
)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue