Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Swaggeroo/obsidian-ai-adapter

Repository files navigation

🚨 DEPRICATED 🚨

This plugin was denied by the Obsidian team: obsidianmd/obsidian-releases#5646 (comment)

This plugin has been integrated into the ai-image-analyzer plugin

AI Adapter Plugin for Obsidian

This plugin is a core dependency for AI plugins in Obsidian. It provides a simple API to interact with AI services.

Plugins using this adapter

Usage

Ollama Proxys

Just use the Ollama URL in the settings. For example using Open Web UI you can use the URL http://[URL:PORT]/ollama to access Ollama. You probably need to set a token (See Auth)

Auth

If your Proxy requires a token, you can set it in the settings. It sets a Authorization header with the value of the token: 'Authorization': 'Bearer [Token]'

Installation

You can download the latest release from the GitHub releases page and install it manually in Obsidian. In the future, this plugin will hopefully be available in the Obsidian community plugins.

Using AI image analyser as a dependency for your plugin

The exposed API:

// Add this type somewhere in your code
export type AIAdapterAPI = {
	query: (prompt: string) => Promise<string>;
	queryWithImage: (prompt: string, image: string) => Promise<string>;
};

// Then, you can just use this function to get the API
export function getAIAdapter(): AIAdapterAPI | undefined {
	return (app as any).plugins?.plugins?.["ai-adapter"]?.api;
}

// And use it like this
const text1 = await getAIAdapter()?.query(prompt);
const text2 = await getAIAdapter()?.queryWithImage(prompt, base64String);

Adding new providers

You can find a example provider in src/providers/exampleProvider.ts. Just create a new file in the src/providers folder and implement the Provider interface like in the example. Then search for [NEW PROVIDER] in the codebase and modify the code accordingly.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •