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

SS-181: Create an Agent LLM for Global-Chem using PandasAI #312

Open
Sulstice opened this issue Jun 27, 2024 · 1 comment
Open

SS-181: Create an Agent LLM for Global-Chem using PandasAI #312

Sulstice opened this issue Jun 27, 2024 · 1 comment
Assignees
Milestone

Comments

@Sulstice
Copy link
Collaborator

Sulstice commented Jun 27, 2024

# Imports
# -------
import os
import pandas as pd
from pandasai import Agent
from pandasai.skills import skill

import plotly.graph_objects as go

class GlobalChemAgentLoader(object):

    __PANDAS_API_KEY__ = 'XXXX'

    def __init__(self, load_agents=[]):

        self.load_agents = load_agents
        self.gc_dataframe = self.read_global_chem()
        self.agent = self.build_global_chem_agent()

    def read_global_chem_dataframe(self):

        dataframe = pd.read_csv('global_chem.tsv', delimiter='\t')

        return dataframe

    def build_global_chem_agent(self):

        os.environ['PANDASAI_API_KEY'] = GlobalChemAgentLoader.__PANDAS_API_KEY__
        agent = Agent([ self.gc_dataframe ])

        agent.add_skills(
             show_chemicals_table
        )

        return agent

    @skill
    @staticmethod
    def show_chemicals_table(dataframe):

        '''
        Display all the chemicals in a table
        '''

if __name__ == '__main__':

    global_chem_agent_loader = GlobalChemAgentLoader()
@Sulstice
Copy link
Collaborator Author

Sulstice commented Jul 11, 2024

Next tasks:

1.) Take your agent and make a standalone python script.
2.) Stand up a local server
3.) Write a docker file to install all the python scripts, and standup the server inside directory. This is probably already done by someone: https://github.com/Sinaptik-AI/pandas-ai (case in the point).

Download the docker, and then run it. Once that is accomplished, we can stand up the agent on heroku or something free or like digital ocean.

Tasks for Both of us:

  1. https://github.com/Global-Chem/Mother-Nature Edit Mother nature again, remove commands that we won't use and then add pandasai agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

2 participants