Skip to content

bvisible/otto

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Otto logo

Otto

Automation intelligence for the Frappe ecosystem

Otto Session Viewer Screenshot

Warning

Otto is in very early stages of development, the application aspects of it are still under heavy experimentation.

Nevertheless, you may use it as library in your own Frappe app to manage interaction with LLMs.

Library documentation for reference.

Overview

Otto is a Frappe Framework app which will be used for adding intelligent automation capabilities to Frappe apps. It's still a work in progress that's being tested out internally.

Otto's app features are built on top of it's library. You may use this in your Frappe app to handle LLM integrations. (Docs)

Library Examples

Brief example of how the library can be used. Link to full library docs for more details.

import otto.lib as otto
from otto.lib.types import ToolUseUpdate


# 1. Fetch model matching some criteria
model = otto.get_model(supports_vision=True, size="Small", provider="OpenAI") # str model id


# 2. Create new session
session = otto.new(
    model=model,
    instruction="You are a helpful coding assistant",
    tools=[calculator_tool_schema],
)

# Save id to resume session later
session_id = session.id


# 3. Interact (streaming)
stream = session.interact("Calculate 15 * 23", stream=True)
for chunk in stream:
    print(chunk.get("text", ""), end="")
result = stream.item


# 4. Handle tool use
for tool in session.get_pending_tool_use():
    result = execute_tool(tool.name, tool.args) # execute tool

    # update session with tool result
    session.update_tool_use(
        ToolUseUpdate(id=tool.id, status="success", result=result)
    )

# Continue session with tool result
session.interact(stream=False)


# 5. Load and resume interaction (non-streaming)
session = otto.load(session_id)
response, _ = session.interact("What was the result?", stream=False)
if response:
    print(response["content"])

Local Installation

You can install this app using the bench CLI, first setup a Frappe bench directory and create a new site then:

# In you bench directory
bench get-app otto --branch develop
bench --site site-name install-app otto

Links



About

Coming later to a Frappe Cloud near you 🐢

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 68.1%
  • Vue 16.3%
  • JavaScript 12.3%
  • HTML 2.9%
  • CSS 0.4%