neuml / txtchat

💭 Retrieval augmented generation (RAG) and language model powered search applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about 'Connect your own data'

yiouyou opened this issue · comments

Within 'Connect your own data' section, a workflow of hacker_news has been generated and needed to be running. My questions are:

  1. where to put the workflow file? save the following code somewhere?
path: /tmp/hn
embeddings:
  path: sentence-transformers/all-MiniLM-L6-v2
  content: true
tabular:
  idcolumn: url
  textcolumns:
  - title
workflow:
  index:
    tasks:
    - batch: false
      extract:
      - hits
      method: get
      params:
        tags: null
      task: service
      url: https://hn.algolia.com/api/v1/search?hitsPerPage=50
    - action: tabular
    - action: index
writable: true
  1. how to run the workflow? save the following code somewhere then run it with python?
from txtai.app import Application

app = Application("index.yml")
list(app.workflow("index", ["front_page"]))

Thanks,