mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-08-03 14:28:40 +00:00
Compare commits
4 Commits
36683cae4e
...
5e5fc43075
Author | SHA1 | Date | |
---|---|---|---|
5e5fc43075 | |||
f37686189e | |||
521df60f86 | |||
77de9b776a |
12
config.toml
Normal file
12
config.toml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[GENERAL]
|
||||||
|
PORT = 3001 # Port to run the server on
|
||||||
|
SIMILARITY_MEASURE = "cosine" # "cosine" or "dot"
|
||||||
|
|
||||||
|
[API_KEYS]
|
||||||
|
OPENAI = "" # OpenAI API key - sk-1234567890abcdef1234567890abcdef
|
||||||
|
GROQ = "" # Groq API key - gsk_1234567890abcdef1234567890abcdef
|
||||||
|
ANTHROPIC = "" # Anthropic API key - sk-ant-1234567890abcdef1234567890abcdef
|
||||||
|
|
||||||
|
[API_ENDPOINTS]
|
||||||
|
SEARXNG = "http://SearxNG:8080" # SearxNG API URL
|
||||||
|
OLLAMA = "http://host.docker.internal:11434"
|
@ -41,7 +41,7 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- perplexica-backend
|
- perplexica-backend
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3010:3000
|
||||||
networks:
|
networks:
|
||||||
- perplexica-network
|
- perplexica-network
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
@ -10,5 +10,5 @@ ANTHROPIC = "" # Anthropic API key - sk-ant-1234567890abcdef1234567890abcdef
|
|||||||
GEMINI = "" # Gemini API key - sk-1234567890abcdef1234567890abcdef
|
GEMINI = "" # Gemini API key - sk-1234567890abcdef1234567890abcdef
|
||||||
|
|
||||||
[API_ENDPOINTS]
|
[API_ENDPOINTS]
|
||||||
SEARXNG = "http://localhost:32768" # SearxNG API URL
|
SEARXNG = "http://SearxNG:8080" # SearxNG API URL
|
||||||
OLLAMA = "" # Ollama API URL - http://host.docker.internal:11434
|
OLLAMA = "" # Ollama API URL - http://host.docker.internal:11434
|
@ -19,6 +19,8 @@ class LineOutputParser extends BaseOutputParser<string> {
|
|||||||
lc_namespace = ['langchain', 'output_parsers', 'line_output_parser'];
|
lc_namespace = ['langchain', 'output_parsers', 'line_output_parser'];
|
||||||
|
|
||||||
async parse(text: string): Promise<string> {
|
async parse(text: string): Promise<string> {
|
||||||
|
text = text.trim() || '';
|
||||||
|
|
||||||
const regex = /^(\s*(-|\*|\d+\.\s|\d+\)\s|\u2022)\s*)+/;
|
const regex = /^(\s*(-|\*|\d+\.\s|\d+\)\s|\u2022)\s*)+/;
|
||||||
const startKeyIndex = text.indexOf(`<${this.key}>`);
|
const startKeyIndex = text.indexOf(`<${this.key}>`);
|
||||||
const endKeyIndex = text.indexOf(`</${this.key}>`);
|
const endKeyIndex = text.indexOf(`</${this.key}>`);
|
||||||
|
@ -19,11 +19,13 @@ class LineListOutputParser extends BaseOutputParser<string[]> {
|
|||||||
lc_namespace = ['langchain', 'output_parsers', 'line_list_output_parser'];
|
lc_namespace = ['langchain', 'output_parsers', 'line_list_output_parser'];
|
||||||
|
|
||||||
async parse(text: string): Promise<string[]> {
|
async parse(text: string): Promise<string[]> {
|
||||||
|
text = text.trim() || '';
|
||||||
|
|
||||||
const regex = /^(\s*(-|\*|\d+\.\s|\d+\)\s|\u2022)\s*)+/;
|
const regex = /^(\s*(-|\*|\d+\.\s|\d+\)\s|\u2022)\s*)+/;
|
||||||
const startKeyIndex = text.indexOf(`<${this.key}>`);
|
const startKeyIndex = text.indexOf(`<${this.key}>`);
|
||||||
const endKeyIndex = text.indexOf(`</${this.key}>`);
|
const endKeyIndex = text.indexOf(`</${this.key}>`);
|
||||||
|
|
||||||
if (startKeyIndex === -1 && endKeyIndex === -1) {
|
if (startKeyIndex === -1 || endKeyIndex === -1) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user