refactor: rename to chain:studio-plugin WIT + provider chain
Tracks the platform's fai->chain rename: provider chain, WIT ABI chain:studio-plugin / chain:platform (binding paths/accessors), SDK pin. Signed-off-by: flemming-it <sf@flemming.it>
This commit is contained in:
parent
3f1fc1eae8
commit
7b7709b6b1
2 changed files with 7 additions and 7 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
schema_version: 3
|
schema_version: 3
|
||||||
provider: fai
|
provider: chain
|
||||||
name: studio-translate-ollama
|
name: studio-translate-ollama
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
|
|
||||||
|
|
|
||||||
12
src/lib.rs
12
src/lib.rs
|
|
@ -19,16 +19,16 @@
|
||||||
|
|
||||||
use fai_plugin_sdk::{bindings, export_plugin};
|
use fai_plugin_sdk::{bindings, export_plugin};
|
||||||
|
|
||||||
type ColorScheme = bindings::fai::studio_plugin::plugin_types::ColorScheme;
|
type ColorScheme = bindings::chain::studio_plugin::plugin_types::ColorScheme;
|
||||||
type PluginError = bindings::fai::studio_plugin::plugin_types::PluginError;
|
type PluginError = bindings::chain::studio_plugin::plugin_types::PluginError;
|
||||||
type RenderedOutput = bindings::fai::studio_plugin::plugin_types::RenderedOutput;
|
type RenderedOutput = bindings::chain::studio_plugin::plugin_types::RenderedOutput;
|
||||||
|
|
||||||
const DEFAULT_ENDPOINT: &str = "http://localhost:11434/api/chat";
|
const DEFAULT_ENDPOINT: &str = "http://localhost:11434/api/chat";
|
||||||
const DEFAULT_MODEL: &str = "qwen2.5:14b";
|
const DEFAULT_MODEL: &str = "qwen2.5:14b";
|
||||||
|
|
||||||
struct OllamaTranslatePlugin;
|
struct OllamaTranslatePlugin;
|
||||||
|
|
||||||
impl bindings::exports::fai::studio_plugin::translate::Guest for OllamaTranslatePlugin {
|
impl bindings::exports::chain::studio_plugin::translate::Guest for OllamaTranslatePlugin {
|
||||||
fn translate(
|
fn translate(
|
||||||
text: String,
|
text: String,
|
||||||
from_locale: String,
|
from_locale: String,
|
||||||
|
|
@ -54,7 +54,7 @@ impl bindings::exports::fai::studio_plugin::translate::Guest for OllamaTranslate
|
||||||
// the others; the hub falls back to its built-in renderer or
|
// the others; the hub falls back to its built-in renderer or
|
||||||
// the [EN] badge.
|
// the [EN] badge.
|
||||||
|
|
||||||
impl bindings::exports::fai::studio_plugin::theme::Guest for OllamaTranslatePlugin {
|
impl bindings::exports::chain::studio_plugin::theme::Guest for OllamaTranslatePlugin {
|
||||||
fn theme_for(_brightness: String) -> Result<ColorScheme, PluginError> {
|
fn theme_for(_brightness: String) -> Result<ColorScheme, PluginError> {
|
||||||
Err(PluginError::Declined(
|
Err(PluginError::Declined(
|
||||||
"studio.translate.ollama is a translate plugin, not a theme plugin".to_string(),
|
"studio.translate.ollama is a translate plugin, not a theme plugin".to_string(),
|
||||||
|
|
@ -62,7 +62,7 @@ impl bindings::exports::fai::studio_plugin::theme::Guest for OllamaTranslatePlug
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bindings::exports::fai::studio_plugin::output_view::Guest for OllamaTranslatePlugin {
|
impl bindings::exports::chain::studio_plugin::output_view::Guest for OllamaTranslatePlugin {
|
||||||
fn render(_mime_type: String, _data: Vec<u8>) -> Result<RenderedOutput, PluginError> {
|
fn render(_mime_type: String, _data: Vec<u8>) -> Result<RenderedOutput, PluginError> {
|
||||||
Err(PluginError::Declined(
|
Err(PluginError::Declined(
|
||||||
"studio.translate.ollama is a translate plugin, not an output viewer".to_string(),
|
"studio.translate.ollama is a translate plugin, not an output viewer".to_string(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue