Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path
import json

from bespoken import chat
from bespoken import Chat
from bespoken.tools import FileTool, TodoTools
from bespoken.prompts import marimo_prompt
from bespoken import ui
Expand All @@ -26,15 +26,29 @@ def debug_reason():
return out


chat(
# Define tools for different modes
file_tool = FileTool("edit.py")
todo_tools = TodoTools()

Chat(
model_name="anthropic/claude-3-5-sonnet-20240620",
tools=[FileTool("edit.py"), TodoTools()],
tools={
"development": [file_tool, todo_tools], # Full development capabilities
"review": [file_tool], # Code review mode - can read files but no todo management
"planning": [], # Planning mode - no tools, pure discussion
},
mode_switch_messages={
"development": "You are now in development mode. You can edit files and manage todos. Focus on implementing features and fixing bugs.",
"review": "You are now in review mode. You can read files to understand the codebase but cannot make changes. Focus on analyzing code and providing feedback.",
"planning": "You are now in planning mode. You cannot access files or tools. Focus on high-level discussion, architecture planning, and strategic thinking.",
},
system_prompt=marimo_prompt,
debug=True,
initial_mode="development",
slash_commands={
"/thinking": "Let me think through this step by step:",
"/role": set_role,
"/debug_prompt": debug_reason,
},
history_callback=lambda x: srsly.write_jsonl(Path("logs.json"), x, append=True, append_new_line=False)
)
).run()
4 changes: 2 additions & 2 deletions src/bespoken/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import importlib.metadata

from .__main__ import chat
from .__main__ import chat, Chat

# Get version dynamically from package metadata
try:
__version__ = importlib.metadata.version("bespoken")
except:
__version__ = "unknown"

__all__ = ["chat", "__version__"]
__all__ = ["chat", "Chat", "__version__"]
Loading