Skip to main content

casama_sdk 0.2.0 copy "casama_sdk: ^0.2.0" to clipboard
casama_sdk: ^0.2.0 copied to clipboard

Dart SDK for Casama, the self-hostable home for AI bots with their own computers. Typed API client, auth and live run event streams.

example/example.dart

import 'dart:io';

import 'package:casama_sdk/casama_sdk.dart';

/// Sends one message to a bot and prints the reply as it streams.
/// `dart run example/example.dart <api-url> <email> <password> <conversation-id> "message"`
Future<void> main(List<String> args) async {
  if (args.length < 5) {
    stderr.writeln('usage: example.dart <api-url> <email> <password> <conversation-id> <message>');
    exit(64);
  }
  final client = await CasamaClient.connect(args[0]);
  await client.signIn(args[1], args[2]);
  final sent = (await client.chat.sendMessage(id: args[3], sendMessageRequest: SendMessageRequest(text: args[4]))).data!;
  await for (final e in watchRun(client, sent.runId)) {
    if (e is MessageDeltaItem) stdout.write(e.event.payload.text);
    if (e is RunCompletedItem || e is RunFailedItem) break;
  }
  stdout.writeln();
}
0
likes
160
points
178
downloads

Documentation

API reference

Publisher

verified publishercasama.ai

Weekly Downloads

Dart SDK for Casama, the self-hostable home for AI bots with their own computers. Typed API client, auth and live run event streams.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#ai #agents #sdk #api-client

License

Apache-2.0 (license)

Dependencies

casama_api, crypto, dio, http

More

Packages that depend on casama_sdk