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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom head not working #1147

Open
Hrishikesh-Dutta0078 opened this issue May 6, 2024 · 1 comment
Open

Custom head not working #1147

Hrishikesh-Dutta0078 opened this issue May 6, 2024 · 1 comment

Comments

@Hrishikesh-Dutta0078
Copy link

System Info

Python version : 3.11.9
OS version : 64-bit operating system, x64-based processor
Pandsai version : 2.0.28 (enforce privacy not working on above versions)

馃悰 Describe the bug

I am using Azure OpenAI and Custom head is not working in my case. Here is are my code snippets :
llm = create_llm()

        head_df = pd.DataFrame({
            "country": ["United States", "United Kingdom", "France", "Germany", "Italy", "Spain", "Canada", "Australia", "Japan", "China"],
            "gdp": [19294482071552, 2891615567872, 2411255037952, 3435817336832, 1745433788416, 1181205135360, 1607402389504, 1490967855104, 4380756541440, 14631844184064],
            "happiness_index": [6.94, 7.16, 6.66, 7.07, 6.38, 6.4, 7.23, 7.22, 5.87, 5.12]
        })
        df = Agent(data_frames, config={
            "llm": llm,
            "enable_cache": True,
            "open_charts": False,
            "response_parser": PandasDataFrame,
            "custom_head" : head_df
        })

def create_llm():
"""Create and return an instance of the Language Learning Model."""
return AzureOpenAI(
api_token=API_TOKEN,
azure_endpoint=AZURE_ENDPOINT,
api_version="2023-05-15",
deployment_name="pandasai-gpt-4"
)

@fab2112
Copy link

fab2112 commented May 7, 2024

I understand that the framework is evolving, but I have noticed that "enforce_privacy" and "custom_head" have no effect on the final output of the prompt, I have even observed the final output of the prompt via langchain (langchain.debug=True) and sensitive data appears.

PandasAI version: 2.0.37
Python version: 3.11.2
OS: Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants