Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 1 addition & 55 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,61 +108,7 @@ class OllamaService {

async loadSettings() {
const result = await chrome.storage.sync.get('sideLlamaSettings');

// Default settings that match settings.js
const defaultSettings = {
ollamaUrl: 'http://localhost:11434',
enableToolCalls: true,
autoManageToolCalls: true, // Smart auto-configuration based on model capabilities
enableThinking: true, // Enable thinking mode for compatible models
defaultModel: 'qwen2.5:7b',
streamingEnabled: true,
systemPrompt: `You are SideLlama, a sophisticated and friendly AI assistant integrated into your browser. You are a knowledgeable and helpful companion for a wide range of tasks, from quick questions to in-depth research.

**Your Persona:**
- You are intelligent, kind, and proactive. You can lead the conversation and suggest new directions.
- You are a master of markdown and use it to create beautiful, easy-to-read responses.
- You enjoy thoughtful discussions about science, philosophy, and technology.

**Your Capabilities:**
- **Web Search:** You can search the web for up-to-date information.
- **Vision:** You can analyze images and screenshots.
- **Code Generation:** You can write and format code in various languages. You will always add comments to your code to explain what it does.
- **Markdown Formatting:** You can create beautiful and easy-to-read responses using markdown.

**Output Format:**
- Use markdown for all responses.
- Use headings, lists, and tables to organize information.
- Use code blocks for code snippets, and always add comments to your code.
- Use bold and italics to emphasize key points.
- Keep your responses concise and to the point.`,
contextLength: 128000,
searchEngine: 'serper',
serperApiKey: '',
maxSearchResults: 5,
autoPageContext: false,
saveHistory: true,
maxHistoryLength: 100,
maxApiMessages: 5, // Updated to ultra-focused
screenshotQuality: 90,
// Advanced Model Parameters
temperature: 0.8,
topP: 0.9,
topK: 20,
seed: null,
repeatPenalty: 1.1,
enableAdvancedParams: false,
// Structured Outputs
outputFormat: 'auto',
enableStructuredOutput: false,
jsonSchema: '',
// Performance Settings
keepAlive: '5m',
showPerformanceStats: false,
autoRefreshModels: false,
// Thinking Display
showThinkingProcess: true
};
const { default: defaultSettings } = await import('./src/defaultSettings.js');

this.settings = result.sideLlamaSettings || defaultSettings;

Expand Down
2 changes: 1 addition & 1 deletion settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,6 @@ <h2 class="text-lg font-semibold mb-4">🔧 Debug Settings</h2>
</div>

<script src="shared-utils.js"></script>
<script src="settings.js"></script>
<script type="module" src="settings.js"></script>
</body>
</html>
55 changes: 2 additions & 53 deletions settings.js
Original file line number Diff line number Diff line change
@@ -1,60 +1,9 @@
import defaultSettings from './src/defaultSettings.js';
// SideLlama Settings JavaScript

class SideLlamaSettings {
constructor() {
this.settings = {
ollamaUrl: 'http://localhost:11434',
enableToolCalls: true,
autoManageToolCalls: true, // Smart auto-configuration based on model capabilities
enableThinking: true, // Enable thinking mode for compatible models
defaultModel: 'qwen2.5:7b',
streamingEnabled: true, // Default to on - provides better UX
systemPrompt: `You are SideLlama, a sophisticated and friendly AI assistant integrated into your browser. You are a knowledgeable and helpful companion for a wide range of tasks, from quick questions to in-depth research.

**Your Persona:**
- You are intelligent, kind, and proactive. You can lead the conversation and suggest new directions.
- You are a master of markdown and use it to create beautiful, easy-to-read responses.
- You enjoy thoughtful discussions about science, philosophy, and technology.

**Your Capabilities:**
- **Web Search:** You can search the web for up-to-date information.
- **Vision:** You can analyze images and screenshots.
- **Code Generation:** You can write and format code in various languages. You will always add comments to your code to explain what it does.
- **Markdown Formatting:** You can create beautiful and easy-to-read responses using markdown.

**Output Format:**
- Use markdown for all responses.
- Use headings, lists, and tables to organize information.
- Use code blocks for code snippets, and always add comments to your code.
- Use bold and italics to emphasize key points.
- Keep your responses concise and to the point.`,
contextLength: 128000,
searchEngine: 'serper',
serperApiKey: 'd03c7ebd4196bf9562d419973ae064',
maxSearchResults: 5,
autoPageContext: false,
saveHistory: true,
maxHistoryLength: 100,
maxApiMessages: 10,
screenshotQuality: 90,
// Advanced Model Parameters
temperature: 0.8,
topP: 0.9,
topK: 20,
seed: null,
repeatPenalty: 1.1,
enableAdvancedParams: false,
// Structured Outputs
outputFormat: 'auto', // 'auto', 'json', 'schema'
enableStructuredOutput: false,
jsonSchema: '',
// Performance Settings
keepAlive: '5m',
showPerformanceStats: false,
autoRefreshModels: false,
// Thinking Display
showThinkingProcess: true
};
this.settings = { ...defaultSettings };

this.initializeElements();
this.loadSettings();
Expand Down
57 changes: 57 additions & 0 deletions src/defaultSettings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
export const defaultSettings = {
ollamaUrl: 'http://localhost:11434',
enableToolCalls: true,
autoManageToolCalls: true, // Smart auto-configuration based on model capabilities
enableThinking: true, // Enable thinking mode for compatible models
defaultModel: 'qwen2.5:7b',
streamingEnabled: true,
systemPrompt: `You are SideLlama, a sophisticated and friendly AI assistant integrated into your browser. You are a
knowledgeable and helpful companion for a wide range of tasks, from quick questions to in-depth research.

**Your Persona:**
- You are intelligent, kind, and proactive. You can lead the conversation and suggest new directions.
- You are a master of markdown and use it to create beautiful, easy-to-read responses.
- You enjoy thoughtful discussions about science, philosophy, and technology.

**Your Capabilities:**
- **Web Search:** You can search the web for up-to-date information.
- **Vision:** You can analyze images and screenshots.
- **Code Generation:** You can write and format code in various languages. You will always add comments to your code to explain
what it does.
- **Markdown Formatting:** You can create beautiful and easy-to-read responses using markdown.

**Output Format:**
- Use markdown for all responses.
- Use headings, lists, and tables to organize information.
- Use code blocks for code snippets, and always add comments to your code.
- Use bold and italics to emphasize key points.
- Keep your responses concise and to the point.`,
contextLength: 128000,
searchEngine: 'serper',
serperApiKey: '',
maxSearchResults: 5,
autoPageContext: false,
saveHistory: true,
maxHistoryLength: 100,
maxApiMessages: 5, // Updated to ultra-focused
screenshotQuality: 90,
// Advanced Model Parameters
temperature: 0.8,
topP: 0.9,
topK: 20,
seed: null,
repeatPenalty: 1.1,
enableAdvancedParams: false,
// Structured Outputs
outputFormat: 'auto',
enableStructuredOutput: false,
jsonSchema: '',
// Performance Settings
keepAlive: '5m',
showPerformanceStats: false,
autoRefreshModels: false,
// Thinking Display
showThinkingProcess: true
};

export default defaultSettings;