Skip to content

felgueres/widgets_api

Repository files navigation

Widgets

Give immediate and accurate answers to common queries using widgets.

Installation

python3 -m venv ./venv
source ./venv/bin/activate
pip install -r requirements.txt

Usage

export FLASK_APP=serve.py; export FLASK_ENV=development; flask run

This project runs along with widgets_client.

Structure

+-- serve.py # entry to flask 
+-- gpt.py # utils for gpt
|   +-- widgets 
|   |   +-- core.py # core logic 
|   +-- prompts 
|   |   +-- classifier.yaml 

Implementation

  1. User asks a question
  2. LLM classifies question into a widget label
  3. If supported, LLM gets params to evaluate widget
  4. Widget evalutes params which could be an api call or function call
  5. Widget returns answer to client

data

Widgets

widgets

Notes

On latency between openai’s functions model vs. running separately

Testing:

latency

~40% less time to call do tasks separately vs. using functions model

About

llm to widgets api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published