Code Monkey home page Code Monkey logo

awesome-llm-apps's Introduction

Hi there, I'm Shubham ๐Ÿ‘‹

visitors

About Me

Connect with me ๐Ÿค

๐Ÿฆ Twitter โ€ข ๐Ÿ’ผ LinkedIn โ€ข ๐Ÿ–‹๏ธ Medium โ€ข ๐Ÿ“บ YouTube

My Blog Posts

awesome-llm-apps's People

Contributors

ideal avatar shubhamsaboo avatar vadiml1024 avatar xushun007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awesome-llm-apps's Issues

AttributeError: module 'ollama' has no attribute 'chat'

Error while executing the Program.

Inititally it was throwing if the model name is given as llama3. Then i changed with the modelname displaying in ollama:list.

Then it ran and displayed " Web Page Successfully Loaded". Then after made an attempt to chat then it was throwing below error.

module 'ollama' has no attribute 'chat'

Get a bad credentials exception when trying to use chat with git

I tried both the classic and beta versions of the git access tokens both give me the same exception

BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"}

Searching data from github: 0%| | 0/1 [00:00<?, ?it/s]
2024-05-13 08:03:51.346 Uncaught app exception
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.dict)
File "/Users/jessewhite/Documents/source/awesome-llm-apps/chat_with_github/chat_github.py", line 29, in
app.add("repo:" + git_repo + " " + "type:repo", data_type="github", loader=loader)
File "/usr/local/lib/python3.11/site-packages/embedchain/embedchain.py", line 176, in add
documents, metadatas, _ids, new_chunks = self._load_and_embed(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/embedchain.py", line 309, in _load_and_embed
embeddings_data = chunker.create_chunks(loader, src, app_id=app_id, config=add_config.chunker)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/chunkers/base_chunker.py", line 33, in create_chunks
data_result = loader.load_data(src)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 305, in load_data
for search_data in tqdm(futures_map, total=len(search_types), desc="Searching data from github"):
File "/Users/jessewhite/Library/Python/3.11/lib/python/site-packages/tqdm/std.py", line 1182, in iter
for obj in iterable:
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 237, in _search_github_data
data = self._github_search_repo(query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 117, in _github_search_repo
data = self._get_github_repo_data(updated_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 72, in _get_github_repo_data
repo = self.client.get_repo(repo_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/MainClass.py", line 363, in get_repo
headers, data = self.__requester.requestJsonAndCheck("GET", url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/Requester.py", line 442, in requestJsonAndCheck
return self.__check(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/Requester.py", line 487, in __check
raise self.__createException(status, responseHeaders, data)
github.GithubException.BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"}
Searching data from github: 0%| | 0/1 [00:00<?, ?it/s]
2024-05-13 08:06:02.039 Uncaught app exception
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.dict)
File "/Users/jessewhite/Documents/source/awesome-llm-apps/chat_with_github/chat_github.py", line 29, in
app.add("repo:" + git_repo + " " + "type:repo", data_type="github", loader=loader)
File "/usr/local/lib/python3.11/site-packages/embedchain/embedchain.py", line 176, in add
documents, metadatas, _ids, new_chunks = self._load_and_embed(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/embedchain.py", line 309, in _load_and_embed
embeddings_data = chunker.create_chunks(loader, src, app_id=app_id, config=add_config.chunker)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/chunkers/base_chunker.py", line 33, in create_chunks
data_result = loader.load_data(src)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 305, in load_data
for search_data in tqdm(futures_map, total=len(search_types), desc="Searching data from github"):
File "/Users/jessewhite/Library/Python/3.11/lib/python/site-packages/tqdm/std.py", line 1182, in iter
for obj in iterable:
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 237, in _search_github_data
data = self._github_search_repo(query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 117, in _github_search_repo
data = self._get_github_repo_data(updated_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 72, in _get_github_repo_data
repo = self.client.get_repo(repo_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/MainClass.py", line 363, in get_repo
headers, data = self.__requester.requestJsonAndCheck("GET", url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/Requester.py", line 442, in requestJsonAndCheck
return self.__check(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/Requester.py", line 487, in __check
raise self.__createException(status, responseHeaders, data)
github.GithubException.BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"}
Searching data from github: 0%| | 0/1 [00:00<?, ?it/s]
2024-05-13 08:06:31.520 Uncaught app exception
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.dict)
File "/Users/jessewhite/Documents/source/awesome-llm-apps/chat_with_github/chat_github.py", line 29, in
app.add("repo:" + git_repo + " " + "type:repo", data_type="github", loader=loader)
File "/usr/local/lib/python3.11/site-packages/embedchain/embedchain.py", line 176, in add
documents, metadatas, _ids, new_chunks = self._load_and_embed(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/embedchain.py", line 309, in _load_and_embed
embeddings_data = chunker.create_chunks(loader, src, app_id=app_id, config=add_config.chunker)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/chunkers/base_chunker.py", line 33, in create_chunks
data_result = loader.load_data(src)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 305, in load_data
for search_data in tqdm(futures_map, total=len(search_types), desc="Searching data from github"):
File "/Users/jessewhite/Library/Python/3.11/lib/python/site-packages/tqdm/std.py", line 1182, in iter
for obj in iterable:
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 237, in _search_github_data
data = self._github_search_repo(query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 117, in _github_search_repo
data = self._get_github_repo_data(updated_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 72, in _get_github_repo_data
repo = self.client.get_repo(repo_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/MainClass.py", line 363, in get_repo
headers, data = self.__requester.requestJsonAndCheck("GET", url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/Requester.py", line 442, in requestJsonAndCheck
return self.__check(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/Requester.py", line 487, in __check
raise self.__createException(status, responseHeaders, data)
github.GithubException.BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"}
Searching data from github: 0%| | 0/1 [00:00<?, ?it/s]
2024-05-13 08:07:09.764 Uncaught app exception
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.dict)
File "/Users/jessewhite/Documents/source/awesome-llm-apps/chat_with_github/chat_github.py", line 29, in
app.add("repo:" + git_repo + " " + "type:repo", data_type="github", loader=loader)
File "/usr/local/lib/python3.11/site-packages/embedchain/embedchain.py", line 176, in add
documents, metadatas, _ids, new_chunks = self._load_and_embed(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/embedchain.py", line 309, in _load_and_embed
embeddings_data = chunker.create_chunks(loader, src, app_id=app_id, config=add_config.chunker)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/chunkers/base_chunker.py", line 33, in create_chunks
data_result = loader.load_data(src)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 305, in load_data
for search_data in tqdm(futures_map, total=len(search_types), desc="Searching data from github"):
File "/Users/jessewhite/Library/Python/3.11/lib/python/site-packages/tqdm/std.py", line 1182, in iter
for obj in iterable:
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/Cellar/[email protected]/3.11.7_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 237, in _search_github_data
data = self._github_search_repo(query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 117, in _github_search_repo
data = self._get_github_repo_data(updated_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/embedchain/loaders/github.py", line 72, in _get_github_repo_data
repo = self.client.get_repo(repo_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/MainClass.py", line 363, in get_repo
headers, data = self.__requester.requestJsonAndCheck("GET", url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/Requester.py", line 442, in requestJsonAndCheck
return self.__check(
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/github/Requester.py", line 487, in __check
raise self.__createException(status, responseHeaders, data)
github.GithubException.BadCredentialsException: 401 {"message": "Bad credentials", "documentation_url": "https://docs.github.com/rest"}

Issue in running llama3_local_rag

Getting below error.

ValueError: Error raised by inference endpoint: HTTPConnectionPool(host='localhost', port=11434): Max retries exceeded with url: /api/embeddings (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x124e0a310>: Failed to establish a new connection: [Errno 61] Connection refused'))

GitGuardian

Hi, i think this is probably a false negative, but, GitGuardian show me in ai_journalist_agent/journalist_agent.py

instructions=[
"Given a topic, first generate a list of 3 search terms related to that topic.",
"For each search term, search_google and analyze the results."
"From the results of all searcher, return the 10 most relevant URLs to the topic.",
"Remember: you are writing for the New York Times, so the quality of the sources is important.",
],
tools=[SerpApiTools(api_key="649ee0e7d64c6704b8ff92f3b01a424accfe6dbece128d043b17641b875e5f69")],
add_datetime_to_instructions=True,

0f1be80

Problem accessing github repo for chat_githib_llama3

I'm getting following traceback when trying to access this project repo:
File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script exec(code, module.__dict__) File "/Users/vadim/work/awesome-llm-apps/chat_with_github/chat_github_llama3.py", line 36, in <module> app.add("repo:" + git_repo + " " + "type:repo", data_type="github", loader=loader) File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/embedchain.py", line 176, in add documents, metadatas, _ids, new_chunks = self._load_and_embed( ^^^^^^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/embedchain.py", line 309, in _load_and_embed embeddings_data = chunker.create_chunks(loader, src, app_id=app_id, config=add_config.chunker) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/chunkers/base_chunker.py", line 33, in create_chunks data_result = loader.load_data(src) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/loaders/github.py", line 305, in load_data for search_data in tqdm(futures_map, total=len(search_types), desc="Searching data from github"): File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/tqdm/std.py", line 1181, in __iter__ for obj in iterable: File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 619, in result_iterator yield _result_or_cancel(fs.pop()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 317, in _result_or_cancel return fut.result(timeout) ^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 456, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/loaders/github.py", line 237, in _search_github_data data = self._github_search_repo(query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/loaders/github.py", line 117, in _github_search_repo data = self._get_github_repo_data(updated_query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/loaders/github.py", line 72, in _get_github_repo_data repo = self.client.get_repo(repo_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/github/MainClass.py", line 363, in get_repo headers, data = self.__requester.requestJsonAndCheck("GET", url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/github/Requester.py", line 442, in requestJsonAndCheck return self.__check( ^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/github/Requester.py", line 487, in __check raise self.__createException(status, responseHeaders, data)

Ollama on Windows has an issue - NotImplementedError on asyncio/base_events.py

Asyncio has issues with the app. Will be great to have some guidance and a fix.

self._proc = await asyncio.create_subprocess_exec(
File "C:\Python310\lib\asyncio\subprocess.py", line 218, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File "C:\Python310\lib\asyncio\base_events.py", line 1667, in subprocess_exec
transport = await self._make_subprocess_transport(
File "C:\Python310\lib\asyncio\base_events.py", line 498, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError
2024-05-17 12:38:05.898 Uncaught app exception

hit rate rate limit for 'chat with git' almost right away

I got rate limited after 4 questions.
Not sure what's happening under the hood to hit the rate limit so fast but it's probably best to do this sort of thing using a local clone

RateLimitExceededException: 403 {"message": "API rate limit exceeded for user ID xxxx. If you reach out to GitHub Support for help, please include the request ID xxxxxxxx and timestamp 2024-05-13 16:51:22 UTC.", "documentation_url": "https://docs.github.com/rest/overview/rate-limits-for-the-rest-api"}

Problem running chat with pdf

I'm getting following:
You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501
Network URL: http://192.168.0.9:8501

2024-05-02 19:07:35.047 Uncaught app exception
Traceback (most recent call last):
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1971, in _exec_single_context
self.dialect.do_execute(
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 919, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: table ec_chat_history already exists

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 584, in _run_script
exec(code, module.dict)
File "/home/vadim/Work/awesome-llm-apps/chat_with_pdf/chat_pdf.py", line 29, in
app = embedchain_bot(db_path, access_token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vadim/Work/awesome-llm-apps/chat_with_pdf/chat_pdf.py", line 10, in embedchain_bot
return App.from_config(
^^^^^^^^^^^^^^^^
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/embedchain/app.py", line 381, in from_config
init_db()
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/embedchain/core/db/database.py", line 80, in init_db
alembic_upgrade()
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/embedchain/core/db/database.py", line 76, in alembic_upgrade
command.upgrade(alembic_cfg, "head")
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/command.py", line 403, in upgrade
script.run_env()
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/script/base.py", line 583, in run_env
util.load_python_file(self.dir, "env.py")
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
module = load_module_py(module_id, path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
spec.loader.exec_module(module) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/embedchain/migrations/env.py", line 68, in
run_migrations_online()
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/embedchain/migrations/env.py", line 62, in run_migrations_online
context.run_migrations()
File "", line 8, in run_migrations
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/runtime/environment.py", line 948, in run_migrations
self.get_context().run_migrations(**kw)
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/runtime/migration.py", line 627, in run_migrations
step.migration_fn(**kw)
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/embedchain/migrations/versions/40a327b3debd_create_initial_migrations.py", line 23, in upgrade
op.create_table(
File "", line 8, in create_table
File "", line 3, in create_table
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/operations/ops.py", line 1311, in create_table
return operations.invoke(op)
^^^^^^^^^^^^^^^^^^^^^
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/operations/base.py", line 445, in invoke
return fn(self, operation)
^^^^^^^^^^^^^^^^^^^
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/operations/toimpl.py", line 131, in create_table
operations.impl.create_table(table)
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/ddl/impl.py", line 366, in create_table
self._exec(schema.CreateTable(table))
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/alembic/ddl/impl.py", line 207, in _exec
return conn.execute(construct, multiparams)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1422, in execute
return meth(
^^^^^
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/sql/ddl.py", line 180, in _execute_on_connection
return connection._execute_ddl(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1533, in _execute_ddl
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1850, in _execute_context
return self._exec_single_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1990, in _exec_single_context
self._handle_dbapi_exception(
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2357, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1971, in _exec_single_context
self.dialect.do_execute(
File "/home/vadim/Work/awesome-llm-apps/.env/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 919, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) table ec_chat_history already exists
[SQL:
CREATE TABLE ec_chat_history (
app_id VARCHAR NOT NULL,
id VARCHAR NOT NULL,
session_id VARCHAR NOT NULL,
question TEXT,
answer TEXT,
metadata TEXT,
created_at TIMESTAMP,
PRIMARY KEY (app_id, id, session_id)
)

]
(Background on this error at: https://sqlalche.me/e/20/e3q8)

chat with pdf giving "none" answer for each question

import os
import tempfile
import time
import openai
import streamlit as st
from embedchain import App

OpenAI API Key

OPENAI_API_KEY = "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"

Function to retry API calls with rate limit handling

def chat_with_retry(app, prompt, retries=3, delay=5):
for attempt in range(retries):
try:
answer = app.chat(prompt)
if not answer:
print(f"Attempt {attempt + 1}: No response received for prompt: {prompt}")
return answer
except Exception as e:
print(f"Attempt {attempt + 1}: Error: {str(e)}")
if "rate limit" in str(e).lower():
if attempt < retries - 1:
st.warning(f"Rate limit exceeded. Retrying in {delay} seconds...")
time.sleep(delay)
else:
st.error("Max retries reached. Unable to get response from OpenAI API.")
raise

Function to initialize Embedchain bot

def embedchain_bot(db_path, api_key):
print(f"Initializing embedchain bot with db_path: {db_path}")
return App.from_config(
config={
"llm": {"provider": "openai", "config": {"api_key": api_key}},
"vectordb": {"provider": "chroma", "config": {"dir": db_path}},
"embedder": {"provider": "openai", "config": {"api_key": api_key}},
}
)

Function to extract and log PDF content

def extract_pdf_content(pdf_path):
try:
import PyPDF2

    with open(pdf_path, "rb") as file:
        reader = PyPDF2.PdfReader(file)
        text = ""
        for page in reader.pages:
            text += page.extract_text()
    print(f"Extracted PDF Content: {text[:500]}...")  # Log the first 500 characters for verification
    return text
except Exception as e:
    print(f"Error extracting PDF content: {e}")
    return None

Main function to run the application

def main():
st.title("Chat with PDF")

db_path = tempfile.mkdtemp()
app = embedchain_bot(db_path, OPENAI_API_KEY)

pdf_file = st.file_uploader("Upload a PDF file", type="pdf")

if pdf_file:
    with tempfile.NamedTemporaryFile(delete=False, suffix=".pdf") as f:
        f.write(pdf_file.getvalue())
        print(f"Adding PDF to knowledge base: {f.name}")
        
        # Extract and log PDF content
        pdf_content = extract_pdf_content(f.name)
        if pdf_content:
            print(f"PDF Content:\n{pdf_content}")  # Log the full content for debugging
            app.add(f.name, data_type="pdf_file")
            st.success(f"Added {pdf_file.name} to knowledge base!")
        else:
            st.error("Failed to extract PDF content.")
        
    os.remove(f.name)

prompt = st.text_input("Ask a question about the PDF")

if prompt:
    answer = chat_with_retry(app, prompt)
    if answer:
        st.write(answer)
    else:
        st.warning("No response received. Please check if the content is correctly indexed and the prompt is relevant.")

if name == "main":
main()

base_url

Hello,

I would like to know how to change the base URL. The idea is to be able to use OpenRouter, which is compatible with OpenAI, and they offer free models.

Thank you very much!

Exception when loading a repo

I get following stacktrace:
Traceback (most recent call last): File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script exec(code, module.__dict__) File "/Users/vadim/work/awesome-llm-apps/chat_with_github/chat_github_llama3.py", line 29, in <module> app = embedchain_bot(db_path) ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/chat_github_llama3.py", line 15, in embedchain_bot return App.from_config( ^^^^^^^^^^^^^^^^ File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/app.py", line 381, in from_config init_db() File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/core/db/database.py", line 80, in init_db alembic_upgrade() File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/embedchain/core/db/database.py", line 76, in alembic_upgrade command.upgrade(alembic_cfg, "head") File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/alembic/command.py", line 394, in upgrade with EnvironmentContext( File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/alembic/runtime/environment.py", line 218, in __exit__ self._remove_proxy() File "/Users/vadim/work/awesome-llm-apps/chat_with_github/.venv/lib/python3.12/site-packages/alembic/util/langhelpers.py", line 87, in _remove_proxy del globals_[attr_name] ~~~~~~~~^^^^^^^^^^^ KeyError: 'config' 2024-05-21 06:40:01.049 Uncaught app exception
I' ve edited the offending line to be:

  if attr_name in globals_: 
     del globals_[attr_name]

This allowed me to proceed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.