Skip to content

Commit

Permalink
Release 0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
anpigon committed May 25, 2024
1 parent 86071b8 commit 82da9ad
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "max-chatbot",
"name": "MAX",
"version": "0.1.2",
"version": "0.1.3",
"minAppVersion": "1.5.0",
"description": "Generate and brainstorm ideas while creating your notes using Large Language Models (LLMs) from Ollama, LM Studio, Anthropic, OpenAI, Mistral AI, and more for Obsidian.",
"author": "anpigon",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "max-chatbot",
"version": "0.1.2",
"version": "0.1.3",
"description": "Generate and brainstorm ideas while creating your notes using Large Language Models (LLMs) from Ollama, LM Studio, Anthropic, OpenAI, Mistral AI, and more for Obsidian.",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const DEFAULT_SETTINGS: MAXSettings = {
[LLM_PROVIDERS.REST_API]: {
enable: false,
apiKey: '',
baseUrl: 'http://localhost:8000/v1',
baseUrl: '',
allowStream: false,
models: [],
},
Expand Down
2 changes: 1 addition & 1 deletion src/features/chatbot/hooks/use-llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const getChatModel = ({provider, model, options}: Pick<UseLLMProps, 'provider' |
if (provider === LLM_PROVIDERS.OLLAMA) {
return new ChatOllama({...options, model, baseUrl: options.baseUrl, verbose});
}
return new ChatOpenAI({model, apiKey: options.apiKey, configuration: {baseURL: options.baseUrl}, verbose});
return new ChatOpenAI({model, apiKey: options.apiKey || 'api-key', configuration: {baseURL: options.baseUrl}, verbose});
};

const createMessageHistory = (messages: UseChatMessage[], message: string) => {
Expand Down
12 changes: 3 additions & 9 deletions src/features/setting/components/general-setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ export const GeneralSetting = () => {

async function fetchModels(sourceType: LLM_PROVIDERS) {}

useEffect(() => {
console.log(settings.providers.OLLAMA.enable);
}, [settings.providers.OLLAMA.enable]);

const modelSources = [
{type: LLM_PROVIDERS.OLLAMA, condition: settings.providers.OLLAMA?.enable},
{
Expand Down Expand Up @@ -51,12 +47,10 @@ export const GeneralSetting = () => {
const loadModels = async () => {
const promises = modelSources.filter(({condition}) => condition).map(({type}) => fetchModels(type));
const settledResult = await Promise.allSettled(promises);
console.log('settledResult:', settledResult);
// const fulfilledResult = settledResult.filter(({status}) => status === 'fulfilled') as PromiseFulfilledResult<string[]>[];
console.log('fulfilledResult', fulfilledResult);
const loadedModels = fulfilledResult.map(({value}) => value).flat();
console.log('load models', loadedModels);
setModelList(prev => Array.from(new Set([...prev, ...loadedModels])));
// const loadedModels = fulfilledResult.map(({value}) => value).flat();
// console.log('load models', loadedModels);
// setModelList(prev => Array.from(new Set([...prev, ...loadedModels])));
};

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/features/setting/components/rest-api-setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const RestApiSetting = () => {
type="text"
spellCheck={false}
defaultValue={baseUrl}
placeholder={DEFAULT_SETTINGS.providers.REST_API.baseUrl}
placeholder='http://localhost:8000/v1'
onChange={event => {
const value = event.target.value?.trim();
setBaseUrl(value);
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"0.0.3": "1.5.0",
"0.1.0": "1.5.0",
"0.1.1": "1.5.0",
"0.1.2": "1.5.0"
"0.1.2": "1.5.0",
"0.1.3": "1.5.0"
}

0 comments on commit 82da9ad

Please sign in to comment.