Refactor: Restructure collab main function to prepare for new subcommand: serve llm (#15824)

This is just a refactor that we're landing ahead of any functional
changes to make sure we haven't broken anything.

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Jason <jason@zed.dev>
This commit is contained in:
Max Brunsfeld 2024-08-05 12:07:38 -07:00 committed by GitHub
parent 705f7e7a03
commit 27779e33fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 142 additions and 85 deletions

16
crates/collab/src/llm.rs Normal file
View file

@ -0,0 +1,16 @@
use std::sync::Arc;
use crate::{executor::Executor, Config, Result};
pub struct LlmState {
pub config: Config,
pub executor: Executor,
}
impl LlmState {
pub async fn new(config: Config, executor: Executor) -> Result<Arc<Self>> {
let this = Self { config, executor };
Ok(Arc::new(this))
}
}