Skip to content

Commit

Permalink
fix: overlength gen
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Feb 21, 2025
1 parent c42e39f commit 528a634
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions jina-ai/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
"maxTokens": 8000
},
"tools": {
"coder": { "temperature": 0.7 },
"coder": { "temperature": 0.7, "maxTokens": 1000 },
"searchGrounding": { "temperature": 0 },
"dedup": { "temperature": 0.1 },
"evaluator": {},
"errorAnalyzer": {},
"queryRewriter": { "temperature": 0.1 },
"evaluator": {"maxTokens": 500},
"errorAnalyzer": {"maxTokens": 500},
"queryRewriter": { "temperature": 0.1, "maxTokens": 500 },
"agent": { "temperature": 0.7 },
"agentBeastMode": { "temperature": 0.7 },
"fallback": { "temperature": 0 }
"fallback": { "temperature": 0, "maxTokens": 1000}
}
},
"openai": {
Expand Down
2 changes: 1 addition & 1 deletion src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function getSchema(allowReflect: boolean, allowRead: boolean, allowAnswer: boole
const actions: string[] = [];
const properties: Record<string, z.ZodTypeAny> = {
action: z.enum(['placeholder']), // Will update later with actual actions
think: z.string().describe(`Explain why choose this action, what's the chain-of-thought behind choosing this action, use the first-person narrative.`)
think: z.string().describe(`Explain why choose this action, what's the chain-of-thought behind choosing this action, use the first-person narrative.`).max(500)
};

if (allowSearch) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/dedup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ObjectGeneratorSafe} from "../utils/safe-generator";


const responseSchema = z.object({
think: z.string().describe('Strategic reasoning about the overall deduplication approach'),
think: z.string().describe('Strategic reasoning about the overall deduplication approach').max(500),
unique_queries: z.array(z.string().describe('Unique query that passed the deduplication process, must be less than 30 characters'))
.describe('Array of semantically unique queries').max(3)
});
Expand Down
6 changes: 3 additions & 3 deletions src/tools/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {ActionTracker} from "../utils/action-tracker";

const baseSchema = {
pass: z.boolean().describe('Whether the answer passes the evaluation criteria defined by the evaluator'),
think: z.string().describe('Explanation the thought process why the answer does not pass the evaluation criteria')
think: z.string().describe('Explanation the thought process why the answer does not pass the evaluation criteria').max(500)
};

const definitiveSchema = z.object({
Expand Down Expand Up @@ -263,8 +263,8 @@ Answer: ${JSON.stringify(answer)}`;
const questionEvaluationSchema = z.object({
needsFreshness: z.boolean().describe('Whether the question requires freshness check'),
needsPlurality: z.boolean().describe('Whether the question requires plurality check'),
think: z.string().describe('Explanation of why these checks are needed or not needed'),
languageStyle: z.string().describe('The language being used and the overall vibe/mood of the question'),
think: z.string().describe('Explanation of why these checks are needed').max(500),
languageStyle: z.string().describe('The language being used and the overall vibe/mood of the question').max(50),
});

function getQuestionEvaluationPrompt(question: string): string {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/query-rewriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {ObjectGeneratorSafe} from "../utils/safe-generator";


const responseSchema = z.object({
think: z.string().describe('Strategic reasoning about query complexity and search approach'),
think: z.string().describe('Strategic reasoning about query complexity and search approach').max(500),
queries: z.array(z.string().describe('keyword-based search query, 2-3 words preferred, total length < 30 characters'))
.min(1)
.max(3)
Expand Down

0 comments on commit 528a634

Please sign in to comment.