Skip to content

Commit

Permalink
Merge pull request #7 from LyzrCore/v0.1.21
Browse files Browse the repository at this point in the history
Release v0.1.21
  • Loading branch information
gargimaheshwari authored Jan 4, 2024
2 parents b6c990d + 27443bf commit bc32b7c
Show file tree
Hide file tree
Showing 96 changed files with 3,446 additions and 6,601 deletions.
60 changes: 60 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!-- Instructions on how to fill this template: https://lyzr.atlassian.net/wiki/spaces/KB/pages/13303810/Pull+Request+Template -->
<!-- Markdown cheatsheet: https://github.com/lifeparticle/Markdown-Cheatsheet/blob/main/README.md -->
## Description

<!-- Linear issue. REQUIRED -->

**What**: <!-- What is the change? -->
**Why**: <!--Why is this change happening? -->
**How**: <!-- How is this change implemented? -->

## What type of PR is this?

- [ ] :gift: New feature (non-breaking change which adds functionality)
- [ ] :bug: Bug fix (non-breaking change which fixes an issue)
- [ ] :bomb: Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] :memo: Documentation update
- [ ] :art: Refactor or style update
- [ ] :fire: Performance improvements
- [ ] :white_check_mark: Test
- [ ] :robot: Build
- [ ] :repeat: CI, review, release, devops, chore, etc.

## Added tests?

- [ ] :ballot_box_with_check: Yes
- [ ] :negative_squared_cross_mark: No, and this is why: <!-- Why are there no tests? -->
- [ ] :question: No, because I need help.

## How can this be tested?

**Test A**
- Description: <!-- Describe the test that you ran. -->
- Test Configuration: <!-- List any relevant details for your test configuration. -->
- Test Instructions: <!-- Provide instructions so we can reproduce. -->
- Libraries: <!-- List any relevant libraries with versions. -->
- Expected Result: <!-- Describe the expected result. -->

## [optional] Are there any post-deployment tasks we need to perform?

## Checklist:

- [ ] :sunglasses: My code follows the style guidelines of this project.
- [ ] :ballot_box_with_check: I have performed a self-review of my code.
- [ ] :bookmark_tabs: I have commented my code, particularly in hard-to-understand areas.
- [ ] :bookmark: I have made corresponding changes to the documentation.
- [ ] :warning: My changes generate no new warnings.
- [ ] :monocle_face: I have added tests that prove my fix is effective or that my feature works.
- [ ] :white_check_mark: New and existing unit tests pass locally with my changes.
- [ ] :link: Any dependent changes have been merged and published in downstream modules.

## Required links:

- **Linear Issue**:
- **Testing Notebook** (Colab):
- **Code Documentation** (Confluence):
- **User Documentation** (Confluence):

## Contributors:
- Name 1
- Name 2
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ venv
.idea
.lancedb

.venv
.venv
*.csv
generated_plots/
tests/
8 changes: 4 additions & 4 deletions build/lib/lyzr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from lyzr.generator import Generator
from lyzr.chatqa.chatbot import ChatBot
from lyzr.base.llm import LyzrLLMFactory
from lyzr.chatqa.qa_bot import QABot
from lyzr.base.service import LyzrService
from lyzr.base.vector_store import LyzrVectorStoreIndex
from lyzr.formula_generator import FormulaGen
from lyzr.csv_analyzr import CsvAnalyzr
from lyzr.data_analyzr import DataAnalyzr
from lyzr.data_analyzr import DataConnector
from lyzr.voicebot import VoiceBot

__all__ = [
"LyzrLLMFactory",
Expand All @@ -15,7 +15,7 @@
"QABot",
"ChatBot",
"FormulaGen",
"Generator",
"CsvAnalyzr",
"DataAnalyzr",
"DataConnector",
"VoiceBot",
]
3 changes: 2 additions & 1 deletion build/lib/lyzr/base/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from lyzr.base.file_utils import read_file, describe_dataset
from lyzr.base.llm import LyzrLLMFactory
from lyzr.base.llms import LLM, Prompt, get_model
from lyzr.base.llms import LLM, get_model
from lyzr.base.service import LyzrService
from lyzr.base.vector_store import LyzrVectorStoreIndex
from lyzr.base.prompt import Prompt

__all__ = [
"LyzrLLMFactory",
Expand Down
21 changes: 5 additions & 16 deletions build/lib/lyzr/base/errors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from typing import Union

from lyzr.base.llms import LLM


class MissingValueError(ValueError):
def __init__(self, params: Union[str, list]):
Expand All @@ -18,17 +16,8 @@ def __init__(self, params: list):
super().__init__(f"Invalid value provided. Provide value of type: {params}")


def check_values(
query: Union[str, None],
model: Union[LLM, None],
params: dict,
) -> None:
if query is None:
raise MissingValueError(["query"])

if model is not None:
return None

for value in params.values():
if value is None:
raise MissingValueError(["model or ", ", ".join(params.keys())])
class MissingModuleError(ImportError):
def __init__(self, required_modules: dict):
super().__init__(
f"The following modules are needed to run this function: {', '.join(required_modules.keys())}. Please install them using: `pip install {' '.join(required_modules.values())}`"
)
5 changes: 3 additions & 2 deletions build/lib/lyzr/base/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import pandas as pd

from lyzr.base.errors import InvalidValueError
from lyzr.base.llms import LLM, Prompt, get_model
from lyzr.base.llms import LLM, get_model
from lyzr.base.prompt import Prompt


def read_file(
Expand Down Expand Up @@ -59,7 +60,7 @@ def describe_dataset(

model.prompt = Prompt("dataset_description_pt")
if model.prompt.get_variables() != []:
model.set_prompt(
model.set_messages(
headers=df.columns.tolist(),
df_sample=df.head(),
)
Expand Down
Loading

0 comments on commit bc32b7c

Please sign in to comment.