forked from TrafficGuard/typedai
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Display LLM id if not found in the llm map * Remove LLM.generateFunctionResponse function specific to xml agent * Update repo doc index building and file selection agent * Set Gemini 2 Flash costs to be that of 1.5 * Update Anthropic and Deepseek cost calculations for caching * Store typescript dts files in repo sophia directory * Add liveFiles properties
- Loading branch information
1 parent
5a481a1
commit 5a52fe8
Showing
25 changed files
with
1,058 additions
and
946 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { agentContext } from '#agent/agentContextLocalStorage'; | ||
import { func, funcClass } from '#functionSchema/functionDecorators'; | ||
|
||
export const LIVE_FILES_ADD = 'LiveFiles_addFiles'; | ||
|
||
export const LIVE_FILES_REMOVE = 'LiveFiles_removeFiles'; | ||
|
||
/** | ||
* Functions for the agent to add/remove files which always displays the current file contents in the agent control prompt | ||
*/ | ||
@funcClass(__filename) | ||
export class LiveFileFunctions { | ||
/** | ||
* Add files which will always have their current contents displayed in the <live-files> section (increasing LLM token costs) | ||
* @param {string[]} files the files to always include the current contents of in the prompt | ||
*/ | ||
@func() | ||
async addFiles(files: string[]): Promise<string> { | ||
const agent = agentContext(); | ||
agent.liveFiles = Array.from(new Set(...agent.liveFiles, ...files)); | ||
return ''; | ||
} | ||
|
||
/** | ||
* Remove files from the <live-files> section which are no longer required to reduce LLM token costs. | ||
* @param {string[]} files The files to remove | ||
*/ | ||
@func() | ||
async removeFiles(files: string[]): Promise<void> { | ||
const agent = agentContext(); | ||
const liveFiles = new Set(agent.liveFiles); | ||
for (const f of files) { | ||
liveFiles.delete(f); | ||
} | ||
agent.liveFiles = Array.from(liveFiles); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.