nimbleboxai / chainfury Goto Github PK
View Code? Open in Web Editor NEW๐ฆ Production grade chaining engine behind TuneChat. Self host today!
Home Page: https://nimbleboxai.github.io/ChainFury/
License: Apache License 2.0
๐ฆ Production grade chaining engine behind TuneChat. Self host today!
Home Page: https://nimbleboxai.github.io/ChainFury/
License: Apache License 2.0
Hello, just went to try out this project and found that the docker builds appear to be broken:
docker-compose --profile chainfury build chainfury
[+] Building 7.1s (1/1) FINISHED docker:default
=> ERROR [chainfury internal] load git source https://github.com/NimbleBoxAI/ChainFury.git#main 7.0s
------
> [chainfury internal] load git source https://github.com/NimbleBoxAI/ChainFury.git#main:
0.031 Initialized empty Git repository in /var/lib/docker/overlay2/kmi7v6n43ang13uzaq6g3rjro/diff/
0.711 e7042bfab103e005478225775f9a31d3ed64529e refs/heads/main
1.090 From https://github.com/NimbleBoxAI/ChainFury
1.090 * [new branch] main -> main
1.090 * [new branch] main -> origin/main
4.789 Submodule 'cf_internal' (https://github.com/NimbleBoxAI/cf_internal.git) registered for path 'cf_internal'
4.791 Cloning into '/var/lib/docker/overlay2/6tdttt9znbsg1g44v8zpu0gzd/diff/cf_internal'...
5.098 fatal: could not read Username for 'https://github.com': terminal prompts disabled
5.100 fatal: clone of 'https://github.com/NimbleBoxAI/cf_internal.git' into submodule path '/var/lib/docker/overlay2/6tdttt9znbsg1g44v8zpu0gzd/diff/cf_internal' failed
5.100 Failed to clone 'cf_internal'. Retry scheduled
5.102 Cloning into '/var/lib/docker/overlay2/6tdttt9znbsg1g44v8zpu0gzd/diff/cf_internal'...
5.408 fatal: could not read Username for 'https://github.com': terminal prompts disabled
5.410 fatal: clone of 'https://github.com/NimbleBoxAI/cf_internal.git' into submodule path '/var/lib/docker/overlay2/6tdttt9znbsg1g44v8zpu0gzd/diff/cf_internal' failed
5.410 Failed to clone 'cf_internal' a second time, aborting
------
failed to solve: failed to read dockerfile: failed to update submodules for https://github.com/NimbleBoxAI/ChainFury.git: exit status 1
I think the key thing here is:
5.098 fatal: could not read Username for 'https://github.com': terminal prompts disabled
I suspect the docker image perhaps isn't setup to be run non-interactively?
I have a simple question, where can I add code so people can log the responses back to their systems. Ex. I want to log a few things to the NBX-LMAOv4 via nbox
(probably).
Here's the structure I have followed elsewhere:
./
โโโ plugins/
โ โโโ __init__.py
โ โโโ graphana.py # file for those that can do it in a file
โ โโโ nbx/ # folder for those who need it, doesn't matter
โ โ โโโ __init__.py
โ โ โโโ lmao_logger.py
โ โ โโโ auth.py
โ โโโ plugin_amazon.py
โโโ server/
โโโ __init__.py
โโโ plugins/ # A separate system for managing plugins
โโโ plugin_middleware.py # Contains the fastAPI middleware
โโโ plugin_handler.py # Configurable handler initialised during start sequence
โโโ plugin_base.py # Interface for plugin builders
Some requirements from server:
Some requirements from plugins:
Here's the code for:
from server.plugins.plugin_base import PluginBase, Event, PluginHandler
class GraphanaPlugin(PluginBase):
name: str = "graphana-v1"
import_name: str = "plugins.graphana"
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.graphana_logger = GraphanaLogger()
def _parse_to_grphan(self, event: Event) -> str:
# do something with the event
return "graphana string"
def handle_event(self, event: Event, handler: PluginManager):
# do something with the event
if event.type == "something-useful":
self.graphana_logger.log(
self._parse_to_grphan(event)
)
# or make a change the server via plugin handler
action = some_function(event)
if action == "disable_key":
handler.disable_key(action.data)
When starting from CLI (or somewhere from config):
python3 -m server.py --plugins="['graphana-v1','nbx-lmao-v1']"
In each function where we provide the ability to have a plugin, we can add a plugin_handler
argument, which is an instance of PluginHandler
(or something similar). This will allow the plugin to interact with the server.
# file: server/commons/langflow_utils.py
import plugin_handler
def get_prompt(chatbot_id: str, prompt: Prompt, db: Session):
# I would like to capture this data
plugin_handler.handle_event(
Event(
type="get_prompt",
data={
"chatbot_id": chatbot_id,
"prompt": prompt,
"db": db
}
)
)
...
You might be wondering why bother with the above one because you can use the APIs for it. But what if I want to capture some other part of the system, like the template
API?
# file: server/api/template.py
import plugin_handler
@template_router.get("/template/{template_id}", response_model=Template)
def get_template_by_id(...):
# I would also like to capture this data
plugin_handler.handle_event(
Event(
type="get_template",
data={
"template_id": template_id,
}
)
)
I can then join both of those from my end, and do something with it.
I can help building the interface and all. Let me know what you guys think!
I would love to see what this UI looks like before I go through the trouble of setting it up. Thanks!
This is the URL the link to try ChainFury goes to https://alpaca-irregulardensity.byocawsv0.on.nimblebox.ai/
I found another URL from your site to try it but the "Create Account" seems to be broken at least with the information I am using to SignUp here https://chainfury.nbox.ai/ui/signup
I am currently working on trying to customize LangFlow to use all Typescript (replacing the need for the python backend) so I can use it all within a single Next App but I'm at early stages. If your project seems like a better path to get up and running I might fork and contribute.
Hey,
sorry for this newbie question... I set up the Docker container on a VPS and have created a Let's Encrypt certificate.
Accessing the web interface with HTTP works perfectly but with HTTPS, I get an error that the site cannot provide a secure connection. It says: "domain.com sent an invalid response"
Is there a setting I need to update in the config of ChainFury or is this a hosting-related (Hetzner) issue?
file "commons/langflow_utils.py" requires langflow
installed. And so I cannot run the server:
(venv) โ server git:(main) โ uvicorn app:app --log-level=debug --host 0.0.0.0 --port 8000
2023-04-23 11:35:00,440 - commons.config - INFO - Using sqlite database
2023-04-23 11:35:00,449 - commons.config - INFO - Database opened successfully
Traceback (most recent call last):
File "/opt/homebrew/bin/uvicorn", line 8, in <module>
sys.exit(main())
File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/uvicorn/main.py", line 407, in main
run(
File "/opt/homebrew/lib/python3.10/site-packages/uvicorn/main.py", line 575, in run
server.run()
File "/opt/homebrew/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "/opt/homebrew/lib/python3.10/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/opt/homebrew/lib/python3.10/site-packages/uvicorn/config.py", line 479, in load
self.loaded_app = import_from_string(self.app)
File "/opt/homebrew/lib/python3.10/site-packages/uvicorn/importer.py", line 24, in import_from_string
raise exc from None
File "/opt/homebrew/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/opt/homebrew/Cellar/[email protected]/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/yashbonde/Desktop/ai/repos/ChainFury/server/./app.py", line 17, in <module>
from api.langflow import router as langflow_router
File "/Users/yashbonde/Desktop/ai/repos/ChainFury/server/./api/langflow.py", line 2, in <module>
from langflow.interface.types import build_langchain_types_dict
ModuleNotFoundError: No module named 'langflow'
Requirements has this line commented out:
# langflow==0.0.54
Even when I installed the above version manually I get the same error. When I installed the latest version langflow==0.0.57
I get the same error.
Can't fix it myself, please help.
could the existing tool implementation be extended to add new types of tools for drag and drop, or does it need extensive work for each tool. if you add that in readme documentation, how to add custom tools/agents/chains, developers can contribute PRs
Steps:
Open https://chainfury.nbox.ai/ui/login with firefox/chrome/brave and fill with admin/admin
After signing up, I return to the login page. With out any hint if it was successful or that I would receive an email.
When I try to sign in with the credentials I signed up with I get an 'invalid credentials' comment.
I didnt receive any email.
Email should have been sent to *@skiff.com
Maybe this is the problem?
Demo site is up and running now.
Sign up-
https://chainfury.nbox.ai/ui/signupOriginally posted by @chanh-1 in > #72 (comment)
I installed using pip commands (tried WSL2 and Windows 11)
I just get:
python3 -m chainfury_server
/usr/bin/python3: No module named chainfury_server.__main__; 'chainfury_server' is a package and cannot be directly executed
Any idea what am I doing wrong? all the dependencies seem to downloaded.
Once logged in I get -
No Chatsbots found.
Please create a chatbot to view the dashboard.
How do I do this?
Hi there, is there a way to integrate GitHub into the tools, so an Agent could use the functions provided within the API?
I think a simple / easy to use wrapper around github api is this:
https://github.com/PyGithub/PyGithub
Thanks in advance.
Greetings from Germany
Adding support for storage would give chainfury
an infinite breathing room for storing and processing information.
We plan to add the following in the first iteration:
qdrant
pinecone
milvus
I am planning that it will follow the same kind of registry pattern that we follow across the chainfury
. Note that I am giving a very high level overview here so focus more on the interface not the implementation.
class CFDB:
# some constants
VECTOR_TYPE = "vector"
SQL_TYPE = "sql"
def read(self, *args, **kwargs) -> Dict[str, List[str]]
def write(self, *args, **kwargs) -> bool?
# ser/deser
def from_dict(self, data: Dict[str, Any]) -> CFDB
def to_dict(self) -> Dict[str, Any]
def from_json(self, x: str) -> CFDB
def to_json(self) -> str
class DBRegistry:
def register(self, name: str, db_cls: CFDB) -> bool?
def get(self, name: str) -> CFDB
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.