-
Notifications
You must be signed in to change notification settings - Fork 0
Config: Temperature Always to 0.7 and Vecto Store Ids not being stored in Config Body #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -212,19 +212,40 @@ function PromptEditorContent() { | |||||||||
|
|
||||||||||
| try { | ||||||||||
| // Build config blob (store prompt in instructions field) | ||||||||||
| // Extract tools array and flatten to direct params fields for backend compatibility | ||||||||||
| const tools = currentConfigBlob.completion.params.tools || []; | ||||||||||
|
|
||||||||||
| // Collect ALL knowledge_base_ids from ALL tools into a single array | ||||||||||
| const allKnowledgeBaseIds: string[] = []; | ||||||||||
| let maxNumResults = 20; // default | ||||||||||
|
|
||||||||||
| tools.forEach((tool) => { | ||||||||||
| // Add all knowledge_base_ids from this tool | ||||||||||
| allKnowledgeBaseIds.push(...tool.knowledge_base_ids); | ||||||||||
| // Use max_num_results from first tool (could be made configurable) | ||||||||||
| if (allKnowledgeBaseIds.length === tool.knowledge_base_ids.length) { | ||||||||||
| maxNumResults = tool.max_num_results; | ||||||||||
| } | ||||||||||
| }); | ||||||||||
|
|
||||||||||
Prajna1999 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
| const configBlob: ConfigBlob = { | ||||||||||
| completion: { | ||||||||||
| // provider: provider as 'openai' | 'anthropic' | 'google', | ||||||||||
| provider:provider as 'openai', | ||||||||||
| provider: currentConfigBlob.completion.provider, | ||||||||||
| params: { | ||||||||||
| model: currentConfigBlob.completion.params.model, | ||||||||||
| instructions: currentContent, // Store prompt as instructions | ||||||||||
| temperature: temperature, | ||||||||||
| ...(tools.length > 0 && { tools }), | ||||||||||
| temperature: currentConfigBlob.completion.params.temperature, | ||||||||||
| // Flatten tools array to direct fields for backend - support multiple knowledge bases | ||||||||||
| ...(allKnowledgeBaseIds.length > 0 && { | ||||||||||
| knowledge_base_ids: allKnowledgeBaseIds, | ||||||||||
| max_num_results: maxNumResults, | ||||||||||
| }), | ||||||||||
| }, | ||||||||||
| }, | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| console.log('[DEBUG] Config blob being sent:', JSON.stringify(configBlob, null, 2)); | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop or gate the debug config blob log. Line 247 logs the full config blob (including instructions) to the console. Consider removing or gating to non-production builds. 🧹 Suggested guard- console.log('[DEBUG] Config blob being sent:', JSON.stringify(configBlob, null, 2));
+ if (process.env.NODE_ENV !== 'production') {
+ console.log('[DEBUG] Config blob being sent:', JSON.stringify(configBlob, null, 2));
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| // Check if updating existing config (same name exists) | ||||||||||
| const existingConfig = savedConfigs.find(c => c.name === currentConfigName.trim()); | ||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think iska easy way vo sakta hai no need of iteration and all.
const maxNumResults = tools[0].max_num_results || 20 // since u are just considering the from the first tool .. idk what configurable u can do while performing iteration but this one line is enough
const allKnwledgebaseids. = tools.flatMap(tool => tool.knoweldge_base_ids)
aisa karenge toh let maxNumResults = 20 ki phi jarurat nhi padeghi
This suggestion is for just code readability .. u can ignore it if it doesn't make sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are correct but abhi lets merge it and refactor at a later time. Its possible all these code will be deleted entirely in 2 months.