Skip to content

Commit

Permalink
Unproxy function call arguments set on agent state in codegen agent
Browse files Browse the repository at this point in the history
Firestore was failing when trying to save a non-simple object
  • Loading branch information
danielcampagnolitg committed Jan 16, 2025
1 parent 4bc939d commit 8ebab5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/agent/codeGenAgentRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export async function runCodeGenAgent(agent: AgentContext): Promise<AgentExecuti
for (const schema of schemas) {
const [className, method] = schema.name.split(FUNC_SEP);
jsGlobals[schema.name] = async (...args) => {
// // Un-proxy any JsProxy objects. https://pyodide.org/en/stable/usage/type-conversions.html
// args = args.map(arg => typeof arg.toJs === 'function' ? arg.toJs() : arg)
// Un-proxy any JsProxy objects. https://pyodide.org/en/stable/usage/type-conversions.html
args = args.map((arg) => (typeof arg?.toJs === 'function' ? arg.toJs() : arg));

// Convert arg array to parameters name/value map
const parameters: { [key: string]: any } = {};
Expand Down

0 comments on commit 8ebab5a

Please sign in to comment.