Everything is streaming (#7247)
Co-authored-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,21 +8,18 @@ use goose::providers::databricks::DATABRICKS_DEFAULT_MODEL;
|
||||
async fn main() -> Result<()> {
|
||||
dotenv().ok();
|
||||
|
||||
// Clear any token to force OAuth
|
||||
std::env::remove_var("DATABRICKS_TOKEN");
|
||||
|
||||
// Create the provider
|
||||
let provider =
|
||||
create_with_named_model("databricks", DATABRICKS_DEFAULT_MODEL, Vec::new()).await?;
|
||||
|
||||
// Create a simple message
|
||||
let message = Message::user().with_text("Tell me a short joke about programming.");
|
||||
|
||||
// Get a response
|
||||
let model_config = provider.get_model_config();
|
||||
let (response, usage) = provider
|
||||
.complete_with_model(
|
||||
None,
|
||||
&provider.get_model_config(),
|
||||
.complete(
|
||||
&model_config,
|
||||
"",
|
||||
"You are a helpful assistant.",
|
||||
&[message],
|
||||
&[],
|
||||
|
||||
@@ -62,10 +62,11 @@ async fn main() -> Result<()> {
|
||||
},
|
||||
}
|
||||
});
|
||||
let model_config = provider.get_model_config();
|
||||
let (response, usage) = provider
|
||||
.complete_with_model(
|
||||
None,
|
||||
&provider.get_model_config(),
|
||||
.complete(
|
||||
&model_config,
|
||||
"",
|
||||
"You are a helpful assistant. Please describe any text you see in the image.",
|
||||
&messages,
|
||||
&[Tool::new("view_image", "View an image", input_schema)],
|
||||
|
||||
Reference in New Issue
Block a user