Fix a bug where a GPUI macro still used `ModelContext` Rename `AsyncAppContext` -> `AsyncApp` Rename update_model, read_model, insert_model, and reserve_model to update_entity, read_entity, insert_entity, and reserve_entity Release Notes: - N/A
This commit is contained in:
parent
83141d07e9
commit
a6b1514246
118 changed files with 708 additions and 757 deletions
|
@ -10,7 +10,7 @@ pub mod fake_provider;
|
|||
use anyhow::Result;
|
||||
use futures::FutureExt;
|
||||
use futures::{future::BoxFuture, stream::BoxStream, StreamExt, TryStreamExt as _};
|
||||
use gpui::{AnyElement, AnyView, App, AsyncAppContext, SharedString, Task, Window};
|
||||
use gpui::{AnyElement, AnyView, App, AsyncApp, SharedString, Task, Window};
|
||||
pub use model::*;
|
||||
use proto::Plan;
|
||||
pub use rate_limiter::*;
|
||||
|
@ -136,13 +136,13 @@ pub trait LanguageModel: Send + Sync {
|
|||
fn stream_completion(
|
||||
&self,
|
||||
request: LanguageModelRequest,
|
||||
cx: &AsyncAppContext,
|
||||
cx: &AsyncApp,
|
||||
) -> BoxFuture<'static, Result<BoxStream<'static, Result<LanguageModelCompletionEvent>>>>;
|
||||
|
||||
fn stream_completion_text(
|
||||
&self,
|
||||
request: LanguageModelRequest,
|
||||
cx: &AsyncAppContext,
|
||||
cx: &AsyncApp,
|
||||
) -> BoxFuture<'static, Result<LanguageModelTextStream>> {
|
||||
let events = self.stream_completion(request, cx);
|
||||
|
||||
|
@ -186,7 +186,7 @@ pub trait LanguageModel: Send + Sync {
|
|||
name: String,
|
||||
description: String,
|
||||
schema: serde_json::Value,
|
||||
cx: &AsyncAppContext,
|
||||
cx: &AsyncApp,
|
||||
) -> BoxFuture<'static, Result<BoxStream<'static, Result<String>>>>;
|
||||
|
||||
fn cache_configuration(&self) -> Option<LanguageModelCacheConfiguration> {
|
||||
|
@ -203,7 +203,7 @@ impl dyn LanguageModel {
|
|||
pub fn use_tool<T: LanguageModelTool>(
|
||||
&self,
|
||||
request: LanguageModelRequest,
|
||||
cx: &AsyncAppContext,
|
||||
cx: &AsyncApp,
|
||||
) -> impl 'static + Future<Output = Result<T>> {
|
||||
let schema = schemars::schema_for!(T);
|
||||
let schema_json = serde_json::to_value(&schema).unwrap();
|
||||
|
@ -218,7 +218,7 @@ impl dyn LanguageModel {
|
|||
pub fn use_tool_stream<T: LanguageModelTool>(
|
||||
&self,
|
||||
request: LanguageModelRequest,
|
||||
cx: &AsyncAppContext,
|
||||
cx: &AsyncApp,
|
||||
) -> BoxFuture<'static, Result<BoxStream<'static, Result<String>>>> {
|
||||
let schema = schemars::schema_for!(T);
|
||||
let schema_json = serde_json::to_value(&schema).unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue