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

testing vale filter addition #135

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Vale
uses: errata-ai/vale-action@reviewdog
with:
files: sayantikabanik/DataJourney/analytics_framework/ai_modeling/*.md
vale_flags: --glob=!*/*-fr/*
filter_mode: file
files: all
filter_mode: nofilter
reporter: github-pr-check
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from langchain.agents import initialize_agent, Tool
# from langchain_deepseek import ChatDeepSeek
from langchain.llms import OpenAI
import pandas as pd
import matplotlib.pyplot as plt
import io
import os
import base64

# NOTE: Using GitHub models here (add your preferred token attribute)
# Refer analytics_framework/langchain/hello_world_lc.py for using GitHub token for auth

token = os.environ["GITHUB_TOKEN"]
endpoint = "https://models.inference.ai.azure.com"
model_name = "DeepSeek-R1"

def test_func(int: model_name, param_value =None)-> int():
return 0

llm = OpenAI(base_url=endpoint, temperature=0, api_key=token, model=model_name) # You MUST set your OpenAI key!
tools = [
Tool(
name="SuggestVisualization",
func=test_func,
description="Suggests an appropriate visualization type based on the provided DataFrame.",
),
]

agent = initialize_agent(tools, llm, agent="zero-shot-react-description", verbose=True)


try:
df = pd.read_csv("../intake/data/TWLO_stock.csv") # Replace with your CSV file.
df_summary = df.describe()
result = agent.run(f"Given this dataset summary, suggest and generate a draft visualization: {df_summary.to_string()}")
print(result)
except FileNotFoundError:
print("Error: dataset not found. Please provide a valid CSV file.")
except Exception as e:
print(f"An error occurred: {e}")
33 changes: 33 additions & 0 deletions analytics_framework/agentic_viz_flow/test_vale.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Sure, here is a dummy markdown file with some intentional errors for Vale to correct:

```markdown
# Dummy Markdown File

This is a dummy markdown file with some intentional errors to test Vale.

## Introduction

This file is created to test Vale's linting capabilities. It contains several grammatical and style issues.

## Grammatical Errors

The following sentences contains grammatical errors:

1. The quick brown fox jumps over the lazy dog. this sentence starts with a lowercase letter.
2. He dont know what to do.
3. She was late, however, she managed to catch the bus.

## Style Issues

The following sentences contains style issues:

1. This sentence has no period
2. this sentence starts with a lowercase letter.
3. This sentence contains multiple punctuation marks!!

## Conclusion

In conclusion, this dummy markdown file serves as a test case for Vale.
```

You can save this content in a `.md` file and run Vale to see the corrections.
Loading