yoheinakajima / instagraph Goto Github PK
View Code? Open in Web Editor NEWConverts text input or URL into knowledge graph and displays
License: MIT License
Converts text input or URL into knowledge graph and displays
License: MIT License
At present, the page is displayed after waiting for all messages to reply. Can we continuously display the page content based on the streaming output, so that we don't need to wait for a long time
Following function is never used:
def scrape_text_from_url(url):
response = requests.get(url)
if response.status_code != 200:
return "Error: Could not retrieve content from URL."
soup = BeautifulSoup(response.text, "html.parser")
paragraphs = soup.find_all("p")
text = " ".join([p.get_text() for p in paragraphs])
print("web scrape done")
return text`
Collecting neo4j==5.12.0
Downloading neo4j-5.12.0.tar.gz (190 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 190.9/190.9 KB 2.0 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
WARNING: Generating metadata for package neo4j produced metadata for project name unknown. Fix your #egg=neo4j fragments.
Discarding https://files.pythonhosted.org/packages/19/11/9af80c8621ba433039bf47acd7b037998138516eb86fdb9ba492c49ee844/neo4j-5.12.0.tar.gz#sha256=00a776a687267150f9e1950017316b751cf63db7b734a699b1405ac20fd4a731 (from https://pypi.org/simple/neo4j/) (requires-python:>=3.7): Requested unknown from https://files.pythonhosted.org/packages/19/11/9af80c8621ba433039bf47acd7b037998138516eb86fdb9ba492c49ee844/neo4j-5.12.0.tar.gz#sha256=00a776a687267150f9e1950017316b751cf63db7b734a699b1405ac20fd4a731 (from -r requirements.txt (line 6)) has inconsistent name: filename has 'neo4j', but metadata has 'unknown'
ERROR: Could not find a version that satisfies the requirement neo4j==5.12.0 (from versions: 1.7.0b1, 1.7.0b2, 1.7.0b3, 1.7.0b4, 1.7.0rc1, 1.7.0rc2, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 4.0.0a1, 4.0.0a2, 4.0.0a3, 4.0.0a4, 4.0.0b1, 4.0.0b2, 4.0.0rc1, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.1.0rc1, 4.1.0rc2, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.2.0a1, 4.2.0, 4.2.1, 4.3.0a1, 4.3.0b1, 4.3.0rc1, 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.3.4, 4.3.5, 4.3.6, 4.3.7, 4.3.8, 4.3.9, 4.4.0a1, 4.4.0b1, 4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.4.4, 4.4.5, 4.4.6, 4.4.7, 4.4.8, 4.4.9, 4.4.10, 4.4.11, 5.0.0a1, 5.0.0a2, 5.0.0, 5.0.1, 5.1.0, 5.2.0, 5.2.1, 5.3.0, 5.4.0, 5.5.0, 5.6.0, 5.7.0, 5.8.0, 5.8.1, 5.9.0, 5.10.0, 5.11.0, 5.12.0)
ERROR: No matching distribution found for neo4j==5.12.0
Many prefer to run the code on docker so they didn't require to manually install the requirements.
Assign me I will complete.
Describe the bug
I'm getting the following error when trying to open the link
$ python3 main.py
* Serving Flask app 'main'
* Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:8080
* Running on http://192.168.1.132:8080
Press CTRL+C to quit
[2023-09-22 03:59:57,400] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1487, in full_dispatch_request
return self.finalize_request(rv)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1508, in finalize_request
response = self.process_response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2002, in process_response
response = self.ensure_sync(func)(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/workspace/instagraph/main.py", line 66, in add_header
if check_if_free_plan():
^^^^^^^^^^^^^^^^^^^^
File "/home/guy/workspace/instagraph/main.py", line 61, in check_if_free_plan
return user_plan == 'free'
^^^^^^^^^
NameError: name 'user_plan' is not defined
[2023-09-22 03:59:57,400] ERROR in app: Request finalizing failed with an error while handling an error
Traceback (most recent call last):
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1487, in full_dispatch_request
return self.finalize_request(rv)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1508, in finalize_request
response = self.process_response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2002, in process_response
response = self.ensure_sync(func)(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/workspace/instagraph/main.py", line 66, in add_header
if check_if_free_plan():
^^^^^^^^^^^^^^^^^^^^
File "/home/guy/workspace/instagraph/main.py", line 61, in check_if_free_plan
return user_plan == 'free'
^^^^^^^^^
NameError: name 'user_plan' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 1508, in finalize_request
response = self.process_response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/.local/lib/python3.11/site-packages/flask/app.py", line 2002, in process_response
response = self.ensure_sync(func)(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guy/workspace/instagraph/main.py", line 66, in add_header
if check_if_free_plan():
^^^^^^^^^^^^^^^^^^^^
File "/home/guy/workspace/instagraph/main.py", line 61, in check_if_free_plan
return user_plan == 'free'
^^^^^^^^^
NameError: name 'user_plan' is not defined
127.0.0.1 - - [22/Sep/2023 03:59:57] "GET / HTTP/1.1" 500 -
To Reproduce
Steps to reproduce the behavior:
python3 main.py
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Once a graph is generated, what if there are some connections or nodes be fixed manually?
@yoheinakajima Can we create a organization with "instagraph"
Create the docker image with the same. Like other technologies have the dockerhub account and image with the organization name.
console has been displaying the following - 127.0.0.1 - - [16/Sep/2023 11:04:40] "POST /get_response_data HTTP/1.1" 200
but the graph is not being displayed at http://127.0.0.1:8080
Hi! can someone explain what the response_model
param used here is:
https://github.com/yoheinakajima/instagraph/blob/main/main.py#L144C18-L144C18
this seems to format the response in exactly the data structure of the models provided.
Is this an openAI thing, or part of fast API? I can't find any docs on openAI's site.
https://platform.openai.com/docs/api-reference/chat
If its an openAI thing perhaps its also magically reading the heredoc of the python classes?
I'm actually trying to use the API via typescript, so I was wondering what the parallel might be.
Here are some ideas for an upgrade to the UI @yoheinakajima
Describe the bug
Generates graphs from a text prompt but no graph is generated from a URL input.
To Reproduce
Steps to reproduce the behavior:
Expected behaviour
Generation of a graph from the URL.
Desktop (please complete the following information):
After completing all the steps in README file, and troubleshooting some things by my self. I got the following error while running "python main.py" in terminal
NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
warnings.warn(
Traceback (most recent call last):
File "/Users/dhandeepsingh/Desktop/instagraph/main.py", line 5, in <module>
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
How to fix this issue??
Describe the bug
Error when running Flask application
新建文本文档.txt
(myenv) D:\my projects\instagraph>python main.py
File "D:\my projects\instagraph\main.py", line 262
match graph.lower():
^
SyntaxError: invalid syntax
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Additional context
Add any other context or screenshots about the feature request here.
Contribution.MD is importance to other to follow the code of ethics.
It would be great to have plug-and-play support for Embeddings, Vector Storage and Retrieval Augmentation
That way the graphs can have a lot more context
Further on that path - adding embedding models so that the user can upload or link as much data as they like
Entire coursework for example
I and my team would be happy to work on this and contribute however possible
Thank You
Contribution docs set the rule, for Open source contribution.
create template for bug_report, Feature, Question.
I have purporsal to make a .env file, so any other can easily store the OpenAI api key easily and run in their local machine.
Describe the bug
When entering http://localhost:8080 a message appears saying the following statement: "Graph History
Error fetching graph history: Error: Network response was not ok INTERNAL SERVER ERROR". Also the submit button does nothing.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A working text input field and Submit button.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
transformers 2.1.1 requires sentencepiece, which is not installed.
anaconda-cloud-auth 0.1.4 requires pydantic<2.0, but you have pydantic 2.4.2 which is incompatible.
python-lsp-black 1.2.1 requires black>=22.3.0, but you have black 0.0 which is incompatible.
I get the above message in windows powershell when using this command;
pip install -r requirements.txt
What would be the next step to move forward with the install?
I set up everything from installation to Open AI API Key and neo4j credentials however every time I try to generate graph I get nothing but this error code in terminal ""POST /get_response_data HTTP/1.1" 429"
I have some idea that it has to do something API rate limit but but this is my first time using Open AI API Keys.
here is screenshot:
Free users can only do 3 requests per minute, by default when submitting a request the app doesn't wait and the quote is exceeded, and a stack trace is shown on the console launching the flask app.
A solution for free users would be to wait 20 or 30 seconds between each request towards openai api.
We should have a gitignore file to protect from unwanted file push on GitHub.
I can't seem to find where graphviz is used, is it old code?
Thank you!
Please add a generic API so other Graph Databases can be support too.
I'm getting graph in instagraph but in neo4j database is empty,
should it be like that ? I though it will also update neo4j
Hi Team,
Not sure if you can support different LLMs in your app?
https://github.com/BerriAI/litellm
Thanks.
I have a vary narrow screen in my browser (after opening localhost 8080) How can I increase the size so I can see the graph much more clear?
I noticed on the console that the conversation sent two/get_response_data requests, resulting in the chart being updated for the second time.
The second question is, I found that some of the answers I received were too simple and not practical, such as asking: What are the directions for thinking? Its answer is direction one and direction two, rather than actual type names, such as life or work
Hope to support Azure OpenAI service
I find this project much interesting, having a good place to discuss would add up value to the community. Consider creating a place to discuss.
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.