From b2df70ab5870899a02998c7283c0543a88038669 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Wed, 10 Dec 2025 12:55:23 -0500 Subject: [PATCH] Clean up extension markdown for settings --- extensions/anthropic/src/anthropic.rs | 45 +++--------- extensions/copilot-chat/src/copilot_chat.rs | 36 +--------- extensions/google-ai/src/google_ai.rs | 39 +++-------- extensions/open-router/src/open_router.rs | 77 +++------------------ extensions/openai/src/openai.rs | 43 +++--------- 5 files changed, 37 insertions(+), 203 deletions(-) diff --git a/extensions/anthropic/src/anthropic.rs b/extensions/anthropic/src/anthropic.rs index 594505339f2e056e730c14a9af4a7d9cb35c8bc1..dc71c72b4e305f378163dde88a500f071b013eef 100644 --- a/extensions/anthropic/src/anthropic.rs +++ b/extensions/anthropic/src/anthropic.rs @@ -521,44 +521,17 @@ impl zed::Extension for AnthropicProvider { llm_get_credential("anthropic").is_some() } + fn llm_provider_authenticate(&mut self, _provider_id: &str) -> Result<(), String> { + if llm_get_credential("anthropic").is_some() { + Ok(()) + } else { + Err("No API key configured".to_string()) + } + } + fn llm_provider_settings_markdown(&self, _provider_id: &str) -> Option { Some( - r#"# Anthropic Setup - -Welcome to **Anthropic**! This extension provides access to Claude models. - -## Configuration - -Enter your Anthropic API key below. You can get your API key at [console.anthropic.com](https://console.anthropic.com/). - -## Available Models - -| Display Name | Real Model | Context | Output | -|--------------|------------|---------|--------| -| Claude Opus 4.5 | claude-opus-4-5 | 200K | 8K | -| Claude Opus 4.5 Thinking | claude-opus-4-5 | 200K | 8K | -| Claude Sonnet 4.5 | claude-sonnet-4-5 | 200K | 8K | -| Claude Sonnet 4.5 Thinking | claude-sonnet-4-5 | 200K | 8K | -| Claude Sonnet 4 | claude-sonnet-4 | 200K | 8K | -| Claude Sonnet 4 Thinking | claude-sonnet-4 | 200K | 8K | -| Claude Haiku 4.5 | claude-haiku-4-5 | 200K | 64K | -| Claude Haiku 4.5 Thinking | claude-haiku-4-5 | 200K | 64K | -| Claude 3.5 Sonnet | claude-3-5-sonnet | 200K | 8K | -| Claude 3.5 Haiku | claude-3-5-haiku | 200K | 8K | - -## Features - -- ✅ Full streaming support -- ✅ Tool/function calling -- ✅ Vision (image inputs) -- ✅ Extended thinking support -- ✅ All Claude models - -## Pricing - -Uses your Anthropic API credits. See [Anthropic pricing](https://www.anthropic.com/pricing) for details. -"# - .to_string(), + "To use Anthropic, you need an API key. You can create one [here](https://console.anthropic.com/settings/keys).".to_string(), ) } diff --git a/extensions/copilot-chat/src/copilot_chat.rs b/extensions/copilot-chat/src/copilot_chat.rs index 9d5730e85055a2ad3562199335541e986ca4365f..156e9497ca24f14328e4fd97898b457e7ec69d0f 100644 --- a/extensions/copilot-chat/src/copilot_chat.rs +++ b/extensions/copilot-chat/src/copilot_chat.rs @@ -447,41 +447,7 @@ impl zed::Extension for CopilotChatProvider { fn llm_provider_settings_markdown(&self, _provider_id: &str) -> Option { Some( - r#"# Copilot Chat Setup - -Welcome to **Copilot Chat**! This extension provides access to GitHub Copilot's chat models. - -## Authentication - -Click **Sign in with GitHub** to authenticate with your GitHub account. You'll be redirected to GitHub to authorize access. This requires an active GitHub Copilot subscription. - -Alternatively, you can set the `GH_COPILOT_TOKEN` environment variable with your token. - -## Available Models - -| Model | Context | Output | -|-------|---------|--------| -| GPT-4o | 128K | 16K | -| GPT-4o Mini | 128K | 16K | -| GPT-4.1 | 1M | 32K | -| o1 | 200K | 100K | -| o3-mini | 200K | 100K | -| Claude 3.5 Sonnet | 200K | 8K | -| Claude 3.7 Sonnet | 200K | 8K | -| Gemini 2.0 Flash | 1M | 8K | - -## Features - -- ✅ Full streaming support -- ✅ Tool/function calling -- ✅ Vision (image inputs) -- ✅ Multiple model providers via Copilot - -## Note - -This extension requires an active GitHub Copilot subscription. -"# - .to_string(), + "To use Copilot Chat, sign in with your GitHub account. This requires an active [GitHub Copilot subscription](https://github.com/features/copilot).".to_string(), ) } diff --git a/extensions/google-ai/src/google_ai.rs b/extensions/google-ai/src/google_ai.rs index 30c16e3b507fed6400816767d618f77f1062040a..10d8c9fe2d1383bf55c66b1405d8c9d0d7032a45 100644 --- a/extensions/google-ai/src/google_ai.rs +++ b/extensions/google-ai/src/google_ai.rs @@ -598,38 +598,17 @@ impl zed::Extension for GoogleAiProvider { llm_get_credential("google-ai").is_some() } + fn llm_provider_authenticate(&mut self, _provider_id: &str) -> Result<(), String> { + if llm_get_credential("google-ai").is_some() { + Ok(()) + } else { + Err("No API key configured".to_string()) + } + } + fn llm_provider_settings_markdown(&self, _provider_id: &str) -> Option { Some( - r#"# Google AI Setup - -Welcome to **Google AI**! This extension provides access to Google Gemini models. - -## Configuration - -Enter your Google AI API key below. You can get your API key at [aistudio.google.com/apikey](https://aistudio.google.com/apikey). - -## Available Models - -| Display Name | Real Model | Context | Output | -|--------------|------------|---------|--------| -| Gemini 2.5 Flash-Lite | gemini-2.5-flash-lite | 1M | 65K | -| Gemini 2.5 Flash | gemini-2.5-flash | 1M | 65K | -| Gemini 2.5 Pro | gemini-2.5-pro | 1M | 65K | -| Gemini 3 Pro | gemini-3-pro-preview | 1M | 65K | - -## Features - -- ✅ Full streaming support -- ✅ Tool/function calling with thought signatures -- ✅ Vision (image inputs) -- ✅ Extended thinking support -- ✅ All Gemini models - -## Pricing - -Uses your Google AI API credits. See [Google AI pricing](https://ai.google.dev/pricing) for details. -"# - .to_string(), + "To use Google AI, you need an API key. You can create one [here](https://aistudio.google.com/apikey).".to_string(), ) } diff --git a/extensions/open-router/src/open_router.rs b/extensions/open-router/src/open_router.rs index 1101f6b9abb0d3a1b71d49bdaabc05dbf94fa5dd..61c32022adbde691ffaa594d9f4d965c61137b72 100644 --- a/extensions/open-router/src/open_router.rs +++ b/extensions/open-router/src/open_router.rs @@ -566,76 +566,17 @@ impl zed::Extension for OpenRouterProvider { llm_get_credential("open_router").is_some() } + fn llm_provider_authenticate(&mut self, _provider_id: &str) -> Result<(), String> { + if llm_get_credential("open_router").is_some() { + Ok(()) + } else { + Err("No API key configured".to_string()) + } + } + fn llm_provider_settings_markdown(&self, _provider_id: &str) -> Option { Some( - r#"# OpenRouter Setup - -Welcome to **OpenRouter**! Access multiple AI models through a single API. - -## Configuration - -Enter your OpenRouter API key below. Get your API key at [openrouter.ai/keys](https://openrouter.ai/keys). - -## Available Models - -### Anthropic -| Model | Context | Output | -|-------|---------|--------| -| Claude Sonnet 4 | 200K | 8K | -| Claude Opus 4 | 200K | 8K | -| Claude Haiku 4 | 200K | 8K | -| Claude 3.5 Sonnet | 200K | 8K | - -### OpenAI -| Model | Context | Output | -|-------|---------|--------| -| GPT-4o | 128K | 16K | -| GPT-4o Mini | 128K | 16K | -| o1 | 200K | 100K | -| o3-mini | 200K | 100K | - -### Google -| Model | Context | Output | -|-------|---------|--------| -| Gemini 2.0 Flash | 1M | 8K | -| Gemini 2.5 Pro | 1M | 8K | - -### Meta -| Model | Context | Output | -|-------|---------|--------| -| Llama 3.3 70B | 128K | 4K | -| Llama 4 Maverick | 128K | 4K | - -### Mistral -| Model | Context | Output | -|-------|---------|--------| -| Mistral Large | 128K | 4K | -| Codestral | 32K | 4K | - -### DeepSeek -| Model | Context | Output | -|-------|---------|--------| -| DeepSeek V3 | 64K | 8K | -| DeepSeek R1 | 64K | 8K | - -### Qwen -| Model | Context | Output | -|-------|---------|--------| -| Qwen 3 235B | 40K | 8K | - -## Features - -- ✅ Full streaming support -- ✅ Tool/function calling (model dependent) -- ✅ Vision (model dependent) -- ✅ Access to 200+ models -- ✅ Unified billing - -## Pricing - -Pay-per-use based on model. See [openrouter.ai/models](https://openrouter.ai/models) for pricing. -"# - .to_string(), + "To use OpenRouter, you need an API key. You can create one [here](https://openrouter.ai/keys).".to_string(), ) } diff --git a/extensions/openai/src/openai.rs b/extensions/openai/src/openai.rs index a64b2502c115297bc647f8bee6a58998543262e8..a8896e8a81606abcddf9eab0fa0c70c0121649e8 100644 --- a/extensions/openai/src/openai.rs +++ b/extensions/openai/src/openai.rs @@ -476,42 +476,17 @@ impl zed::Extension for OpenAiProvider { llm_get_credential("openai").is_some() } + fn llm_provider_authenticate(&mut self, _provider_id: &str) -> Result<(), String> { + if llm_get_credential("openai").is_some() { + Ok(()) + } else { + Err("No API key configured".to_string()) + } + } + fn llm_provider_settings_markdown(&self, _provider_id: &str) -> Option { Some( - r#"# OpenAI Setup - -Welcome to **OpenAI**! This extension provides access to OpenAI GPT models. - -## Configuration - -Enter your OpenAI API key below. You can find your API key at [platform.openai.com/api-keys](https://platform.openai.com/api-keys). - -## Available Models - -| Display Name | Real Model | Context | Output | -|--------------|------------|---------|--------| -| GPT-4o | gpt-4o | 128K | 16K | -| GPT-4o-mini | gpt-4o-mini | 128K | 16K | -| GPT-4.1 | gpt-4.1 | 1M | 32K | -| GPT-4.1-mini | gpt-4.1-mini | 1M | 32K | -| GPT-5 | gpt-5 | 272K | 32K | -| GPT-5-mini | gpt-5-mini | 272K | 32K | -| o1 | o1 | 200K | 100K | -| o3 | o3 | 200K | 100K | -| o3-mini | o3-mini | 200K | 100K | - -## Features - -- ✅ Full streaming support -- ✅ Tool/function calling -- ✅ Vision (image inputs) -- ✅ All OpenAI models - -## Pricing - -Uses your OpenAI API credits. See [OpenAI pricing](https://openai.com/pricing) for details. -"# - .to_string(), + "To use OpenAI, you need an API key. You can create one [here](https://platform.openai.com/api-keys).".to_string(), ) }