Skip to content

phuvinhnguyen/FlowDesign

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design flow for LLM

Features and tasks

  • Database for retrieval system
    • Faiss database
    • Graph search
  • Online searching
    • DuckduckGo search
  • LLM
    • OpenAI
    • Gemini
    • HuggingFace
  • Flow
    • PAL flow
  • Documents

How to install

pip install git+https://github.com/phuvinhnguyen/FlowDesign.git

Example use

This framework can be used to create new flow easily, for example:

from FlowDesign.processor import *

class PALFlow(ThinkProcessor):
    modifies = ('answer', )

    def __init__(self, chatbot):
        nlp = TextProcessor(chatbot, 'Write a executable Python program to solve the problem: {query}')
        exec = PythonProcessor().inp('answer').out('answer')
        self.flow = nlp*exec # ask llm to gen code -> exec code

    def __call__(self, query):
        return self.flow(query)

How to use the built-in PAL flow with gemini

from FlowDesign.flow.pal import PALFlow
from FlowDesign.chatbot.base import GeminiBot

bot = GeminiBot('GEMINI_TOKEN')
flow = PALFlow(bot)
output1 = flow.chat('what is the result of (1231.23*3242.432^2)/7?+pi^(2^pi)-e^(pi^2)')
output2 = flow.chat('sort this list: [1,232,4,432,34,25,13,31,23,32,324,3,5,23,32,3,2,2,2,2,2,2,2,2,2,2,2,2]')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published