-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9439944
commit 9902849
Showing
38 changed files
with
807 additions
and
239 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Convenience script for running Aider | ||
source variables/local.env | ||
export VERTEXAI_PROJECT=$GCLOUD_PROJECT | ||
export VERTEXAI_LOCATION=$GCLOUD_REGION | ||
export VERTEXAI_LOCATION=$GCLOUD_CLAUDE_REGION | ||
echo $VERTEXAI_PROJECT $VERTEXAI_LOCATION | ||
aider --model vertex_ai/claude-3-5-sonnet@20240620 |
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
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,45 @@ | ||
import '#fastify/trace-init/trace-init'; // leave an empty line next so this doesn't get sorted from the first line | ||
|
||
import { writeFileSync } from 'fs'; | ||
import { agentContext, agentContextStorage, createContext } from '#agent/agentContextLocalStorage'; | ||
import { AgentContext } from '#agent/agentContextTypes'; | ||
import { mockLLMs } from '#llm/models/mock-llm.ts'; | ||
import { Blueberry } from '#llm/multi-agent/blueberry.ts'; | ||
import { initFirestoreApplicationContext } from '../app'; | ||
import { parseProcessArgs, saveAgentId } from './cli'; | ||
|
||
// Usage: | ||
// npm run blueberry | ||
|
||
async function main() { | ||
if (process.env.GCLOUD_PROJECT) await initFirestoreApplicationContext(); | ||
|
||
const { initialPrompt } = parseProcessArgs(); | ||
|
||
const context: AgentContext = createContext({ | ||
initialPrompt, | ||
agentName: 'blueberry', | ||
llms: mockLLMs(), | ||
functions: [], | ||
}); | ||
agentContextStorage.enterWith(context); | ||
|
||
const text = await new Blueberry().generateText(initialPrompt); | ||
|
||
writeFileSync('src/cli/blueberry-out', text); | ||
|
||
console.log(text); | ||
console.log('Wrote output to src/cli/blueberry-out'); | ||
console.log(`Cost USD$${agentContext().cost.toFixed(2)}`); | ||
|
||
// Save the agent ID after a successful run | ||
saveAgentId('blueberry', context.agentId); | ||
} | ||
|
||
main() | ||
.then(() => { | ||
console.log('done'); | ||
}) | ||
.catch((e) => { | ||
console.error(e); | ||
}); |
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.