Comments (6)
I believe this issue may have been fixed by another set of changes that went in a few days ago. When I test now with docker run -e COHERE_API_KEY=<KEY> -p 8000:8000 -p 4000:4000 ghcr.io/cohere-ai/cohere-toolkit:latest
, everything is working for me. @moz-gh, can you give it another go?
from cohere-toolkit.
Please try adding a .env
file with the defaults. One way is to copy the .env-template
and rename it to .env
from cohere-toolkit.
Correct. Either add a .env
manually, or you can run make first-run
which will take care of everything for you.
from cohere-toolkit.
Copied the .env-template
to .env
and reran the command, getting a different error
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 146, in __init__
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3304, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 449, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 308, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 674, in __init__
self.__connect()
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 900, in __connect
with util.safe_reraise():
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
raise exc_value.with_traceback(exc_tb)
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 896, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 643, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 617, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: could not translate host name "db" to address: No address associated with hostname
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/workspace/.venv/bin/alembic", line 8, in <module>
sys.exit(main())
^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/alembic/config.py", line 641, in main
CommandLine(prog=prog).main(argv=argv)
File "/workspace/.venv/lib/python3.11/site-packages/alembic/config.py", line 631, in main
self.run_cmd(cfg, options)
File "/workspace/.venv/lib/python3.11/site-packages/alembic/config.py", line 608, in run_cmd
fn(
File "/workspace/.venv/lib/python3.11/site-packages/alembic/command.py", line 403, in upgrade
script.run_env()
File "/workspace/.venv/lib/python3.11/site-packages/alembic/script/base.py", line 583, in run_env
util.load_python_file(self.dir, "env.py")
File "/workspace/.venv/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
module = load_module_py(module_id, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
spec.loader.exec_module(module) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/workspace/./src/backend/alembic/env.py", line 88, in <module>
run_migrations_online()
File "/workspace/./src/backend/alembic/env.py", line 74, in run_migrations_online
with connectable.connect() as connection:
^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3280, in connect
return self._connection_cls(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 148, in __init__
Connection._handle_dbapi_exception_noconnection(
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2444, in _handle_dbapi_exception_noconnection
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 146, in __init__
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 3304, in raw_connection
return self.pool.connect()
^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 449, in connect
return _ConnectionFairy._checkout(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout
fairy = _ConnectionRecord.checkout(pool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 712, in checkout
rec = pool._do_get()
^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/impl.py", line 308, in _do_get
return self._create_connection()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 390, in _create_connection
return _ConnectionRecord(self)
^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 674, in __init__
self.__connect()
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 900, in __connect
with util.safe_reraise():
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in __exit__
raise exc_value.with_traceback(exc_tb)
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/pool/base.py", line 896, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 643, in connect
return dialect.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 617, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/.venv/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not translate host name "db" to address: No address associated with hostname
(Background on this error at: https://sqlalche.me/e/20/e3q8)
.env
looks like this:
# REQUIRED VARIABLES
NEXT_PUBLIC_API_HOSTNAME=http://backend:8000
DATABASE_URL=postgresql+psycopg2://postgres:postgres@db:5432
# TOOLS
PYTHON_INTERPRETER_URL=http://localhost:8080
TAVILY_API_KEY=<API_KEY_HERE>
WOLFRAM_ALPHA_APP_ID=<APP_ID_HERE>
# DEPLOYMENTS
# To use the Toolkit, at least one deployment must be setup, the simplest
# being the Cohere Platform. See the README.md for more details.
# 1 - Cohere Platform
COHERE_API_KEY=<API_KEY_HERE>
# 2 - SageMaker
SAGE_MAKER_PROFILE_NAME=<PROFILE NAME>
SAGE_MAKER_REGION_NAME=<REGION NAME>
SAGE_MAKER_ENDPOINT_NAME=<ENDPOINT NAME>
# 3 - Azure
AZURE_API_KEY=<API KEY>
AZURE_CHAT_ENDPOINT_URL=<ENDPOINT URL>
# Experimental features
USE_EXPERIMENTAL_LANGCHAIN=False
# Community features
USE_COMMUNITY_FEATURES='True'%
from cohere-toolkit.
I think the above error is because the Postgres container hasn't started with the backend. If you have the image pulled, can you try running docker compose watch
and seeing the output?
from cohere-toolkit.
@malexw looks like it's working for me as well 🥳
I'll close since it looks to be working as expected now
from cohere-toolkit.
Related Issues (20)
- CORS error or Content type error on Docker image HOT 4
- I followed the manual for the installation, but it simply doesn't work. It has wasted several days of my time. HOT 4
- Dependency llama-cpp in PR #77 won't build on M chip Mac HOT 3
- terrarium not working on x86_64 HOT 11
- Support for litellm provider HOT 1
- first run errors out after a terabyte of download :( HOT 4
- Support python>=3.12.0 HOT 2
- Error: pg_config executable not found on local install with `make first-run` HOT 3
- Tools not configured properly via CLI during `make-first run` when inserting API Key env variables HOT 2
- Does not work in Codespaces HOT 3
- Include citations in multihop tool use on Coral interface
- User management and authentication HOT 2
- Throwing error when run `make migrate` for the first time. HOT 4
- How to deploy cohere-toolkit in KVM VPS ? HOT 4
- Invalid API Token HOT 4
- Update ui to the latest from corel.com HOT 5
- Add csv file type for document upload HOT 2
- Docker setup not working locally
- Default python interpreter doesn't work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cohere-toolkit.