golem-create-agent-instance-scala

Creates Scala Golem agent instances with constructor parameters, environment variables, and configuration.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers need to pre-create Golem agent instances with specific environment variables, configuration, or WASI config before any method invocation, rather than relying on implicit creation during the first invoke call.

Core Features & Use Cases

  • Explicit Agent Creation: Pre-create agents with golem agent new using typed constructor parameters in Scala syntax, including records, enums, options, and tuples.
  • Runtime Configuration: Attach environment variables, typed configuration entries, and WASI config values at creation time.
  • Auto-Deploy: Automatically builds and deploys the agent's component when run from an application directory if not yet deployed.
  • Use Case: Create a ChatRoom("general") agent in a staging environment with database credentials and retry configuration set before any client connects.

Quick Start

Ask the assistant to create a new Golem agent instance with a given agent ID and any required environment variables or configuration values.

Frequently Asked Questions about golem-create-agent-instance-scala

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

FAQPage Schema
How do I create a Golem agent instance without invoking a method?

Use `golem agent new` followed by the agent ID, such as `golem agent new 'MyAgent()'`. This initializes the agent with its constructor parameters in an idle state, ready to receive invocations later.

What is the difference between golem agent new and golem agent invoke?

golem agent new explicitly pre-creates an agent with environment variables or configuration before any call, while golem agent invoke calls a method and implicitly creates the agent on first invocation. An agent created with new can be invoked later using the same agent ID.

How do I pass constructor parameters to a Golem Scala agent?

Include parameters in the agent ID using Scala syntax, like `golem agent new 'ChatRoom("general")'`. Records use named fields, options use Some(value) or None, and enums use MyEnum.VariantName.

Can I set environment variables when creating a Golem agent?

Yes, use the repeatable `--env KEY=VALUE` flag, for example `golem agent new 'MyAgent("user-123")' --env API_KEY=sk-abc123`. You can also set typed config with `--config` and WASI config with `--wasi-config`.

Does golem agent new deploy the component automatically?

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