golem-invoke-agent-scala

Invokes methods on deployed Scala Golem agents from the command line.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-invoke-agent-scala
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-invoke-agent-scala
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/scala/golem-invoke-agent-scala
Command: npx skills add https://github.com/golemcloud/golem --skill golem-invoke-agent-scala

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Calling a method on a deployed Golem agent requires knowing the correct CLI syntax, agent ID format, and Scala value encoding, which is error-prone when done by hand. This Skill provides the exact commands and conventions for invoking Scala Golem agent methods with golem agent invoke.

Core Features & Use Cases

  • Agent Method Invocation: Run golem agent invoke <AGENT_ID> <FUNCTION_NAME> [ARGUMENTS...] to call a method and wait for its result, with automatic agent creation on first invocation.
  • Streaming and Session Management: Pipe stream parameters via stdin, render stream results as values or raw bytes, and resume detached invocations with --save-session and --resume-session.
  • Scala Value Syntax: Pass arguments using Scala syntax such as Some(value), records with named fields, enums, tuples, and WitResult.Ok/Err.
  • Use Case: Invoke a chat agent method by running golem agent invoke 'ChatRoom("general")' sendMessage '"Hello, world!"' and receive the rendered result directly in the terminal.

Quick Start

Ask the AI to invoke the getStatus method on the agent MyAgent() using the golem CLI and show the result.

Frequently Asked Questions about golem-invoke-agent-scala

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I invoke a Golem agent method from the CLI?

Run golem agent invoke <AGENT_ID> <FUNCTION_NAME> [ARGUMENTS...] to call a method and wait for its result. The agent is created automatically on first invocation, and stdout, stderr, and logs stream live to the terminal.

How to pass arguments to a Scala Golem agent method?

Arguments use Scala syntax: Some(value) or None for options, MyRecord(fieldOne = 1) for records, MyEnum.VariantName for enums, and tuples like (1, "hello"). Quote string arguments so the shell passes them through correctly.

What is the agent ID format for golem agent invoke?

The agent ID is AgentTypeName(param1, param2), optionally prefixed with env/, app/env/, or account/app/env/ paths. Agents without constructor parameters use empty parentheses, such as MyAgent().

Can I stream data to and from a Golem agent invocation?

Yes, use - as the argument for one direct stream parameter to bind it to stdin, with --stdin-format value or raw. Use --stdout-format value or raw to control how stream results are rendered.

What happens if a streaming Golem invocation disconnects?

Streaming invocation is durable: disconnecting or pressing Ctrl-C detaches the transport without cancelling the invocation. Use --save-session on the initial call, then --resume-session to reattach or --takeover-session to fence an attached transport.

Does golem agent invoke deploy the component automatically?

Yes, if the agent's component has not been deployed and the CLI runs from an application directory, golem agent invoke automatically builds and deploys the component before invoking the method.