Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/link suggest #253

Merged
merged 18 commits into from
Sep 22, 2023
Merged

Feat/link suggest #253

merged 18 commits into from
Sep 22, 2023

Conversation

jacobryas4
Copy link
Contributor

  • new schema, models for database
  • scraper used to retrieve CIDs for IPFS retrieval
  • slightly modified prompt
  • update widget to use new index

@jacobryas4 jacobryas4 requested a review from sgzsh269 September 15, 2023 15:30
@sgzsh269 sgzsh269 requested a review from kahkeng September 18, 2023 14:35
Copy link
Collaborator

@sgzsh269 sgzsh269 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left comments

config.py Outdated Show resolved Hide resolved
@@ -355,13 +355,16 @@ def fn(token_handler):
@error_wrap
def fetch_scraped_sites(query: str) -> Callable:
def fn(token_handler):
scraped_sites_index = config.initialize(config.scraped_sites_index)
# below is the old index used previously for scraped sites - do we still use this?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is some overlap between both link suggestion and scraped sites modules as both seek to answer generic questions about the ecosystem.
If we use both of them, I suspect the model may not be able to reliably discern which one to use appropriately

Can you test this by having both enabled and see how the system performs? To test both of them, you will need to a have a separate widget command for each in the yaml

You can also remove your comments.

scrape/models.py Outdated Show resolved Hide resolved
tools/index_widget.py Show resolved Hide resolved
@@ -12,7 +12,7 @@

TEMPLATE = '''You are a web3 assistant. You help users with answering web3-related questions. Your responses should sound natural, helpful, cheerful, and engaging, and you should use easy to understand language with explanations for jargon.

Information to help complete your task is below. Only use information below to answer the question, and create a final answer with inline citations linked to the provided source URLs. If you don't know the answer, just say that you don't know. Don't try to make up an answer. ALWAYS return a "SOURCES" part in your answer corresponding to the numbered inline citations.
Information to help complete your task is below. Only use information below to answer the question, and create a final answer with inline citations linked to the provided source URLs. If you don't know the answer, just say that you don't know. Don't try to make up an answer. ALWAYS return a "SOURCES" part in your answer corresponding to the numbered inline citations. ALWAYS provide a link to each citation in SOURCES.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Similar to having a separate function handler for link suggestion different from scraped sites, maybe better to also have a separate tools module like index_dapp_suggesstion or something

  • Trying to figure out how consistently the LLM is able to cite SOURCES in a reliable format, any insights on that?
    We could also explore a more structured format for the results like a list of JSON objects with fields such as dapp_name, dapp_desc, dapp_url etc and then post-process it or send it to the FE as JSON to render it consistently

index/dapps.py Outdated Show resolved Hide resolved
@jacobryas4 jacobryas4 marked this pull request as ready for review September 21, 2023 22:08
knowledge_base/widgets.yaml Outdated Show resolved Hide resolved
{"name": DAPP_NAME, "dataType": ["text"]},
{"name": DAPP_DESCRIPTION, "dataType": ["text"]},
{"name": DAPP_URL, "dataType": ["text"]},
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • let's just remove the social media links as they will not be used and unnecessarily will occupy space
  • DAPP_URL does not need to be vectorized so can be skipped

index/dapps.py Outdated Show resolved Hide resolved
@jacobryas4 jacobryas4 merged commit cc84ec3 into dev Sep 22, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants