Skip to content

Commit

Permalink
Reorganise files
Browse files Browse the repository at this point in the history
  • Loading branch information
taichimaeda committed Apr 19, 2024
1 parent ba7b979 commit bb6c590
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/api/clients/gemini.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { APIClient } from '..';
import { ChatMessage } from '../../types';
import { APIClient } from '../client';

// TODO:
// Implement API client for Gemini.
Expand Down
2 changes: 1 addition & 1 deletion src/api/clients/ollama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Notice } from 'obsidian';
import OpenAI from 'openai';
import Markpilot from 'src/main';
import { validateURL } from 'src/utils';
import { APIClient } from '../client';
import { APIClient } from '..';
import { CostsTracker } from '../costs';
import { OpenAICompatibleAPIClient } from './openai-compatible';

Expand Down
2 changes: 1 addition & 1 deletion src/api/clients/openai-compatible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { getEncoding } from 'js-tiktoken';
import { Notice } from 'obsidian';
import OpenAI from 'openai';
import Markpilot from 'src/main';
import { APIClient } from '..';
import { ChatMessage } from '../../types';
import { APIClient } from '../client';
import { CostsTracker } from '../costs';

export abstract class OpenAICompatibleAPIClient implements APIClient {
Expand Down
2 changes: 1 addition & 1 deletion src/api/clients/openai.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Notice } from 'obsidian';
import OpenAI from 'openai';
import Markpilot from 'src/main';
import { APIClient } from '../client';
import { APIClient } from '..';
import { CostsTracker } from '../costs';
import { OpenAICompatibleAPIClient } from './openai-compatible';

Expand Down
2 changes: 1 addition & 1 deletion src/api/clients/openrouter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Notice } from 'obsidian';
import OpenAI from 'openai';
import Markpilot from 'src/main';
import { APIClient } from '../client';
import { APIClient } from '..';
import { CostsTracker } from '../costs';
import { OpenAICompatibleAPIClient } from './openai-compatible';

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/api/proxies/memory-cache.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createHash } from 'crypto';
import Markpilot from 'src/main';
import { APIClient } from '..';
import { ChatMessage } from '../../types';
import { APIClient } from '../client';

export class MemoryCacheProxy implements APIClient {
private store: Map<string, string> = new Map();
Expand Down
2 changes: 1 addition & 1 deletion src/api/proxies/usage-monitor.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Notice } from 'obsidian';
import Markpilot from 'src/main';
import { getThisMonthAsString } from 'src/utils';
import { APIClient } from '..';
import { ChatMessage } from '../../types';
import { APIClient } from '../client';

export class UsageMonitorProxy implements APIClient {
constructor(
Expand Down
10 changes: 10 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@ declare module '*.svg' {
const content: string;
export default content;
}

declare module '*.md' {
const content: string;
export default content;
}

declare module '*.txt' {
const content: string;
export default content;
}
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
setIcon,
WorkspaceLeaf,
} from 'obsidian';
import { APIClient } from './api/client';
import { APIClient } from './api';
import { OllamaAPIClient } from './api/clients/ollama';
import { OpenAIAPIClient } from './api/clients/openai';
import { OpenRouterAPIClient } from './api/clients/openrouter';
Expand Down

0 comments on commit bb6c590

Please sign in to comment.