pyenv virtualenv 3.11 notdiamond-examples
pyenv activate notdiamond-examples
Install the dependencies:
poetry install
Create a .env
file from the included template, making sure to populate keys for the providers
you would like to use. Then run the app:
streamlit run notdiamond_examples/streamlit/main.py
The app suggests some models for you to use, but you can also edit the app code to add any model supported by Not Diamond.
Not Diamond also supports RAG workflows. Try our RAG example out:
poetry install --with rag
streamlit run notdiamond_examples/streamlit/rag.py
Concatenate these to the URL as follows:
https://rag.notdiamond.ai?first_param=one&second_param=two
Supported parameters:
repo
: index a Github repo of the form{user}/{project}
, eg.Not-Diamond/notdiamond-python
.repo_dir
: index all files in the Github repo originating in this directory (typically,doc
ordocs
). Use.
for all files.repo_ext
: index all files with this extension (examples:md
,mdx
,txt
,rst
). You can specify multiplerepo_ext
parameters.website
: scrape and index the content of the specified website (example:https://example.com
).follow_link
: scrape and index the content of the pages linked to from the website parameter. Set tofalse
by default, but acceptstrue
.exclude_header_footer
: scrape and index the content of the pages linked to from the website parameter, and limit scraped links to 30. Set totrue
by default, but acceptsfalse
.message
: a pre-populated background message in the text box (example:Hello%20world
).
Example query parameters:
# Index all .py files from the examples/ dir of posit-dev/py-shiny
https://rag.notdiamond.ai/?repo=posit-dev/py-shiny&repo_dir=examples&repo_ext=py
# Index all .mdx files from the docs/ dir of langchain-ai/langchain
https://rag.notdiamond.ai/?repo=langchain-ai/langchain&repo_dir=docs&repo_ext=mdx
Want to test out image generation? Watch the most popular models battle in Arena Mode? Chat with Not Diamond.