mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-12-03 10:18:15 +00:00
feat(app): fix type resolving issues
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import z from 'zod';
|
||||
import { ResearchAction } from '../../types';
|
||||
import { searchSearxng } from '@/lib/searxng';
|
||||
import { Chunk } from '@/lib/types';
|
||||
|
||||
const actionSchema = z.object({
|
||||
type: z.literal('web_search'),
|
||||
|
||||
@@ -2,6 +2,7 @@ import z from 'zod';
|
||||
import BaseLLM from '../../models/base/llm';
|
||||
import BaseEmbedding from '@/lib/models/base/embedding';
|
||||
import SessionManager from '@/lib/session';
|
||||
import { ChatTurnMessage, Chunk } from '@/lib/types';
|
||||
|
||||
export type SearchSources = 'web' | 'discussions' | 'academic';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { sql } from 'drizzle-orm';
|
||||
import { text, integer, sqliteTable } from 'drizzle-orm/sqlite-core';
|
||||
import { Block } from '../types';
|
||||
|
||||
export const messages = sqliteTable('messages', {
|
||||
id: integer('id').primaryKey(),
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { Chunk } from '@/lib/types';
|
||||
|
||||
abstract class BaseEmbedding<CONFIG> {
|
||||
constructor(protected config: CONFIG) {}
|
||||
abstract embedText(texts: string[]): Promise<number[][]>;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Ollama } from 'ollama';
|
||||
import BaseEmbedding from '../../base/embedding';
|
||||
import { Chunk } from '@/lib/types';
|
||||
|
||||
type OllamaConfig = {
|
||||
model: string;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import OpenAI from 'openai';
|
||||
import BaseEmbedding from '../../base/embedding';
|
||||
import { Chunk } from '@/lib/types';
|
||||
|
||||
type OpenAIConfig = {
|
||||
apiKey: string;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { ConfigModelProvider } from '../config/types';
|
||||
import BaseModelProvider, {
|
||||
createProviderInstance,
|
||||
} from './providers/baseProvider';
|
||||
import BaseModelProvider, { createProviderInstance } from './base/provider';
|
||||
import { getConfiguredModelProviders } from '../config/serverRegistry';
|
||||
import { providers } from './providers';
|
||||
import { MinimalProvider, ModelList } from './types';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import z from 'zod';
|
||||
import { ChatTurnMessage } from '../types';
|
||||
|
||||
type Model = {
|
||||
name: string;
|
||||
@@ -37,7 +38,7 @@ type GenerateOptions = {
|
||||
};
|
||||
|
||||
type GenerateTextInput = {
|
||||
messages: Message[];
|
||||
messages: ChatTurnMessage[];
|
||||
options?: GenerateOptions;
|
||||
};
|
||||
|
||||
@@ -54,7 +55,7 @@ type StreamTextOutput = {
|
||||
|
||||
type GenerateObjectInput = {
|
||||
schema: z.ZodTypeAny;
|
||||
messages: Message[];
|
||||
messages: ChatTurnMessage[];
|
||||
options?: GenerateOptions;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user