OverviewFilesCommitsIssuesDocsReleasesPeers

ollama_semantic_function_calling commits / 393cfa8

Hardcode room key and add documentation on extracting room keys from pear link invites
393cfa8ebf296e410a36e91c89b56fab47a1bffb
by fleeky.ashatron <fleeky@7rnx.net> · 2025-04-21T17:56:20.000Z

Changed files (2) +69 -3

ollamatools-new/keet_cmd_run +47 -1
……@@ -5,7 +5,53 @@ Command-line script to run the Keet CLI agent.
55
66import asyncio
77import sys
8from ollamatools.plugins.integrations.keet.keet_cmd_agent import main
8import argparse
9from ollamatools.plugins.integrations.keet.keet_cmd_agent import KeetCmdAgent
10
11# Default room key from the pear link invite
12DEFAULT_ROOM_KEY = "yrb6mha3b4u5f1mm3jns44m3athon6was4pbums6awmns8ygsqs9ufop31z6d3n4qrqb7eerqp6f9zga5hb6ug9demezyftfarhnu3q57tz9sgde"
13
14async def main():
15 """Main entry point for the Keet CLI agent."""
16 # Set up argument parser
17 parser = argparse.ArgumentParser(description="Keet Command-line Agent")
18 parser.add_argument("--storage", type=str, help="Path to store Keet data")
19 parser.add_argument("--room-key", type=str, default=DEFAULT_ROOM_KEY,
20 help="Room key or invite link to join (default: hardcoded room key)")
21 parser.add_argument("--name", type=str, default="KeetBot", help="Display name for the agent")
22 parser.add_argument("--model", type=str, default="llama3", help="Ollama model to use")
23 parser.add_argument("--mock", action="store_true", help="Use the mock implementation")
24 parser.add_argument("--verbose", action="store_true", help="Enable verbose logging")
25
26 args = parser.parse_args()
27
28 # Extract room key from invite link if needed
29 room_key = args.room_key
30 if room_key.startswith("pear://keet/"):
31 room_key = room_key[len("pear://keet/"):]
32
33 # Create the agent
34 agent = KeetCmdAgent(
35 storage_path=args.storage,
36 room_key=room_key,
37 name=args.name,
38 model=args.model,
39 mock=args.mock,
40 verbose=args.verbose
41 )
42
43 # Start the agent
44 try:
45 await agent.start()
46
47 # Keep the agent running until interrupted
48 while True:
49 await asyncio.sleep(1)
50 except KeyboardInterrupt:
51 print("\nInterrupted by user")
52 finally:
53 # Stop the agent
54 await agent.stop()
955
1056if __name__ == "__main__":
1157 sys.exit(asyncio.run(main()))
ollamatools-new/ollamatools/plugins/integrations/keet/README_KEET_CMD.md +22 -2
……@@ -2,6 +2,22 @@
22
33A minimal CLI agent for Keet that can join a room, name itself, and respond to user messages using Ollama.
44
5## Room Keys and Pear Link Invites
6
7Keet uses "pear link invites" to share room access. These links start with `pear://keet/` followed by the room key. For example:
8
9```
10pear://keet/yrb6mha3b4u5f1mm3jns44m3athon6was4pbums6awmns8ygsqs9ufop31z6d3n4qrqb7eerqp6f9zga5hb6ug9demezyftfarhnu3q57tz9sgde
11```
12
13The room key is everything after the `pear://keet/` prefix:
14
15```
16yrb6mha3b4u5f1mm3jns44m3athon6was4pbums6awmns8ygsqs9ufop31z6d3n4qrqb7eerqp6f9zga5hb6ug9demezyftfarhnu3q57tz9sgde
17```
18
19You can use either the full pear link invite or just the room key with the Keet CLI agent. The agent will automatically extract the room key from the pear link invite if needed.
20
521## Features
622
723- Join a Keet room using a room key or invite link
……@@ -27,13 +43,17 @@ The Keet CLI agent is part of the ollamatools package. If you have ollamatools i
2743You can run the Keet CLI agent from the command line using the `keet_cmd_run` script:
2844
2945```bash
30./keet_cmd_run --room-key <room_key> --name <bot_name> --model <ollama_model>
46# Use the default hardcoded room key
47./keet_cmd_run --name <bot_name> --model <ollama_model>
48
49# Or specify a different room key or pear link invite
50./keet_cmd_run --room-key <room_key_or_pear_link> --name <bot_name> --model <ollama_model>
3151```
3252
3353### Options
3454
3555- `--storage`: Path to store Keet data. If not provided, a default path will be used.
36- `--room-key`: Room key or invite link to join. If not provided, the most recent room will be used.
56- `--room-key`: Room key or invite link to join. If not provided, the default hardcoded room key will be used.
3757- `--name`: Display name for the agent. Default is "KeetBot".
3858- `--model`: Ollama model to use for generating responses. Default is "llama3".
3959- `--mock`: Use the mock implementation (for testing).