athena-lab1 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: athena_lab1
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Auto-detects datasets and answers questions via OpenRouter.
|
|
5
|
+
Author-email: Sammy <your.email@example.com>
|
|
6
|
+
Classifier: Operating System :: OS Independent
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Requires-Python: >=3.9
|
|
9
|
+
Requires-Dist: openai
|
|
10
|
+
Requires-Dist: pandas
|
|
11
|
+
Requires-Dist: python-dotenv
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# Athena Lab1
|
|
15
|
+
|
|
16
|
+
A simple package that auto-detects datasets and answers questions using OpenRouter.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
pip install athena_lab1
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
import pandas as pd
|
|
25
|
+
from athena_lab1.core import ask
|
|
26
|
+
|
|
27
|
+
dataset = pd.read_csv("mydataset.csv")
|
|
28
|
+
ask("Build a machine learning model")
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Athena Lab1
|
|
2
|
+
|
|
3
|
+
A simple package that auto-detects datasets and answers questions using OpenRouter.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
pip install athena_lab1
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
import pandas as pd
|
|
12
|
+
from athena_lab1.core import ask
|
|
13
|
+
|
|
14
|
+
dataset = pd.read_csv("mydataset.csv")
|
|
15
|
+
ask("Build a machine learning model")
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling >= 1.26"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "athena_lab1"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Sammy", email="your.email@example.com" },
|
|
10
|
+
]
|
|
11
|
+
description = "Auto-detects datasets and answers questions via OpenRouter."
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.9"
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Operating System :: OS Independent",
|
|
17
|
+
]
|
|
18
|
+
dependencies = [
|
|
19
|
+
"openai",
|
|
20
|
+
"pandas",
|
|
21
|
+
"python-dotenv",
|
|
22
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Empty file - makes it a package
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import pandas as pd
|
|
3
|
+
from openai import OpenAI
|
|
4
|
+
from dotenv import load_dotenv
|
|
5
|
+
|
|
6
|
+
load_dotenv()
|
|
7
|
+
|
|
8
|
+
KEY = os.environ.get("OPENROUTER_KEY")
|
|
9
|
+
CLIENT = OpenAI(api_key=KEY, base_url="https://openrouter.ai/api/v1")
|
|
10
|
+
|
|
11
|
+
def load_data(file_path="mydataset.csv"):
|
|
12
|
+
try:
|
|
13
|
+
df = pd.read_csv(file_path)
|
|
14
|
+
return f"\n\nDataset: {df.shape[0]} rows, {df.shape[1]} columns\nColumns: {list(df.columns)}\nFirst 5 rows:\n{df.head()}\n\n"
|
|
15
|
+
except FileNotFoundError:
|
|
16
|
+
return ""
|
|
17
|
+
|
|
18
|
+
def ask(question, file_path="mydataset.csv"):
|
|
19
|
+
data_text = load_data(file_path)
|
|
20
|
+
response = CLIENT.chat.completions.create(
|
|
21
|
+
model="deepseek/deepseek-chat",
|
|
22
|
+
messages=[{"role": "user", "content": f"{data_text}{question}"}]
|
|
23
|
+
)
|
|
24
|
+
print(response.choices[0].message.content)
|