Compare commits

...

3 Commits

Author SHA1 Message Date
3609f9a9fb Merge 4e56cccea5 into f37686189e 2025-02-01 07:51:17 +00:00
f37686189e feat(output-parsers): add empty check 2025-01-31 17:51:16 +05:30
4e56cccea5 watch command support 2024-09-23 02:20:58 +03:00
3 changed files with 24 additions and 1 deletions

View File

@ -29,6 +29,15 @@ services:
networks:
- perplexica-network
restart: unless-stopped
develop:
watch:
- action: sync
path: ./backend
target: /home/perplexica
ignore:
- node_modules/
- action: rebuild
path: backend.dockerfile
perplexica-frontend:
build:
@ -45,6 +54,16 @@ services:
networks:
- perplexica-network
restart: unless-stopped
develop:
watch:
- action: sync
path: ./frontend
target: /app
ignore:
- node_modules/
- .next/
- action: rebuild
path: app.dockerfile
networks:
perplexica-network:

View File

@ -19,6 +19,8 @@ class LineOutputParser extends BaseOutputParser<string> {
lc_namespace = ['langchain', 'output_parsers', 'line_output_parser'];
async parse(text: string): Promise<string> {
text = text.trim() || '';
const regex = /^(\s*(-|\*|\d+\.\s|\d+\)\s|\u2022)\s*)+/;
const startKeyIndex = text.indexOf(`<${this.key}>`);
const endKeyIndex = text.indexOf(`</${this.key}>`);

View File

@ -19,11 +19,13 @@ class LineListOutputParser extends BaseOutputParser<string[]> {
lc_namespace = ['langchain', 'output_parsers', 'line_list_output_parser'];
async parse(text: string): Promise<string[]> {
text = text.trim() || '';
const regex = /^(\s*(-|\*|\d+\.\s|\d+\)\s|\u2022)\s*)+/;
const startKeyIndex = text.indexOf(`<${this.key}>`);
const endKeyIndex = text.indexOf(`</${this.key}>`);
if (startKeyIndex === -1 && endKeyIndex === -1) {
if (startKeyIndex === -1 || endKeyIndex === -1) {
return [];
}