Giter Site home page Giter Site logo

pythonagentai's Introduction

PythonAgentAI

pythonagentai's People

Contributors

techwithtim avatar tiktaak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pythonagentai's Issues

Unable to use dot env

while installing we used
pip3 install python-dotenv

but in the main.py file we use
import dotenv

this is giving me errors as VScode says that dotenv is not installed
and when I try to install it I get this error

Collecting dotenv
  Using cached dotenv-0.0.5.tar.gz (2.4 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install backend dependencies did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      Collecting wheel
        Using cached wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
      Collecting distribute
        Using cached distribute-0.7.3.zip (145 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Installing backend dependencies: started
        Installing backend dependencies: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error
      
        × Preparing metadata (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [6 lines of output]
            usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
               or: setup.py --help [cmd1 cmd2 ...]
               or: setup.py --help-commands
               or: setup.py cmd --help
      
            error: invalid command 'dist_info'
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: metadata-generation-failed
      
      × Encountered error while generating package metadata.
      ╰─> See above for output.
      
      note: This is an issue with the package mentioned above, not pip.
      hint: See above for details.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install backend dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.  ```


I even tried using 

``` pip3 install python-dotenv ``` but I still get the same error

ImportError: cannot import name 'ChatMessage' from 'llama_index.core.llms' (unknown location)

error:
Traceback (most recent call last): File "/Users/ahmednadiir/Desktop/agency/main.py", line 4, in <module> from llama_index.core.query_engine import PandasQueryEngine File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/__init__.py", line 13, in <module> from llama_index.callbacks.global_handlers import set_global_handler File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/callbacks/__init__.py", line 7, in <module> from .token_counting import TokenCountingHandler File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/callbacks/token_counting.py", line 6, in <module> from llama_index.utilities.token_counting import TokenCounter File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/utilities/token_counting.py", line 6, in <module> from llama_index.llms import ChatMessage, MessageRole File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/llms/__init__.py", line 14, in <module> from llama_index.llms.anyscale import Anyscale File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/llms/anyscale.py", line 10, in <module> from llama_index.llms.openai import OpenAI File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/llms/openai/__init__.py", line 1, in <module> from llama_index.llms.openai.base import AsyncOpenAI, OpenAI, SyncOpenAI, Tokenizer File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/llms/openai/base.py", line 28, in <module> from llama_index.core.callbacks import CallbackManager File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/core/callbacks/__init__.py", line 4, in <module> from .token_counting import TokenCountingHandler File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/core/callbacks/token_counting.py", line 6, in <module> from llama_index.core.utilities.token_counting import TokenCounter File "/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/core/utilities/token_counting.py", line 6, in <module> from llama_index.core.llms import ChatMessage, MessageRole ImportError: cannot import name 'ChatMessage' from 'llama_index.core.llms' (/Users/ahmednadiir/Desktop/agency/ai/lib/python3.11/site-packages/llama_index/core/llms/__init__.py)

code:
`from dotenv import load_dotenv
import os
import pandas as pd
from llama_index.core.query_engine import PandasQueryEngine
from prompts import new_prompt, instruction_str

load_dotenv()

#my quran.json file
quran_path = os.path.join('data', 'data.json');
#load
quran_df = pd.read_json(quran_path);

quran_query_engine = PandasQueryEngine(df=quran_df, verbose=True, instruction_str=instruction_str);
quran_query_engine.update_prompts({"pandas_prompt": new_prompt})
quran_query_engine.query("how many total hasanat in the the whole quran")`

help me plz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.