Skip to content

Commit

Permalink
Rename package from gemini-haystack to google_ai_haystack
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanocerza committed Jan 3, 2024
1 parent 6f640ad commit 47d991a
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 45 deletions.
21 changes: 0 additions & 21 deletions integrations/gemini-haystack/README.md

This file was deleted.

File renamed without changes.
21 changes: 21 additions & 0 deletions integrations/google_ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# google-ai-haystack

[![PyPI - Version](https://img.shields.io/pypi/v/google-ai-haystack.svg)](https://pypi.org/project/google-ai-haystack)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/google-ai-haystack.svg)](https://pypi.org/project/google-ai-haystack)

---

**Table of Contents**

- [Installation](#installation)
- [License](#license)

## Installation

```console
pip install google-ai-haystack
```

## License

`google-ai-haystack` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "gemini-haystack"
name = "google-ai-haystack"
dynamic = ["version"]
description = 'Use models like Gemini via Makersuite'
readme = "README.md"
Expand All @@ -30,17 +30,17 @@ dependencies = [
]

[project.urls]
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/gemini-haystack#readme"
Issues = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/gemini-haystack/issues"
Source = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/gemini-haystack"
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/google_ai_haystack#readme"
Issues = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/google_ai_haystack/issues"
Source = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/google_ai_haystack"

[tool.hatch.version]
source = "vcs"
tag-pattern = 'integrations\/gemini-v(?P<version>.*)'
tag-pattern = 'integrations\/google-ai-v(?P<version>.*)'

[tool.hatch.version.raw-options]
root = "../.."
git_describe_command = 'git describe --tags --match="integrations/gemini-v[0-9]*"'
git_describe_command = 'git describe --tags --match="integrations/google-ai-v[0-9]*"'

[tool.hatch.envs.default]
dependencies = [
Expand Down Expand Up @@ -70,7 +70,7 @@ dependencies = [
"ruff>=0.0.243",
]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:src/gemini_haystack tests}"
typing = "mypy --install-types --non-interactive {args:src/google_ai_haystack tests}"
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
Expand Down Expand Up @@ -136,7 +136,7 @@ unfixable = [
]

[tool.ruff.isort]
known-first-party = ["gemini_haystack"]
known-first-party = ["google_ai_haystack"]

[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
Expand All @@ -146,16 +146,16 @@ ban-relative-imports = "all"
"tests/**/*" = ["PLR2004", "S101", "TID252"]

[tool.coverage.run]
source_pkgs = ["gemini_haystack", "tests"]
source_pkgs = ["google_ai_haystack", "tests"]
branch = true
parallel = true
omit = [
"src/gemini_haystack/__about__.py",
"src/google_ai_haystack/__about__.py",
]

[tool.coverage.paths]
gemini_haystack = ["src/gemini_haystack", "*/gemini-haystack/src/gemini_haystack"]
tests = ["tests", "*/gemini-haystack/tests"]
google_ai_haystack = ["src/google_ai_haystack", "*/google_ai_haystack/src/google_ai_haystack"]
tests = ["tests", "*/google_ai_haystack/tests"]

[tool.coverage.report]
exclude_lines = [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from google.ai.generativelanguage import FunctionDeclaration, Tool
import pytest

from gemini_haystack.generators.chat.gemini import GoogleAIGeminiChatGenerator
from google_ai_haystack.generators.chat.gemini import GoogleAIGeminiChatGenerator


def test_init():
Expand Down Expand Up @@ -40,7 +40,7 @@ def test_init():
)

tool = Tool(function_declarations=[get_current_weather_func])
with patch("gemini_haystack.generators.chat.gemini.genai.configure") as mock_genai_configure:
with patch("google_ai_haystack.generators.chat.gemini.genai.configure") as mock_genai_configure:
gemini = GoogleAIGeminiChatGenerator(
generation_config=generation_config,
safety_settings=safety_settings,
Expand Down Expand Up @@ -85,14 +85,14 @@ def test_to_dict():

tool = Tool(function_declarations=[get_current_weather_func])

with patch("gemini_haystack.generators.chat.gemini.genai.configure"):
with patch("google_ai_haystack.generators.chat.gemini.genai.configure"):
gemini = GoogleAIGeminiChatGenerator(
generation_config=generation_config,
safety_settings=safety_settings,
tools=[tool],
)
assert gemini.to_dict() == {
"type": "gemini_haystack.generators.chat.gemini.GoogleAIGeminiChatGenerator",
"type": "google_ai_haystack.generators.chat.gemini.GoogleAIGeminiChatGenerator",
"init_parameters": {
"model": "gemini-pro-vision",
"generation_config": {
Expand All @@ -112,10 +112,10 @@ def test_to_dict():


def test_from_dict():
with patch("gemini_haystack.generators.chat.gemini.genai.configure"):
with patch("google_ai_haystack.generators.chat.gemini.genai.configure"):
gemini = GoogleAIGeminiChatGenerator.from_dict(
{
"type": "gemini_haystack.generators.chat.gemini.GoogleAIGeminiChatGenerator",
"type": "google_ai_haystack.generators.chat.gemini.GoogleAIGeminiChatGenerator",
"init_parameters": {
"model": "gemini-pro-vision",
"generation_config": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from google.ai.generativelanguage import FunctionDeclaration, Tool
import pytest

from gemini_haystack.generators.gemini import GoogleAIGeminiGenerator
from google_ai_haystack.generators.gemini import GoogleAIGeminiGenerator


def test_init():
Expand Down Expand Up @@ -39,7 +39,7 @@ def test_init():
)

tool = Tool(function_declarations=[get_current_weather_func])
with patch("gemini_haystack.generators.gemini.genai.configure") as mock_genai_configure:
with patch("google_ai_haystack.generators.gemini.genai.configure") as mock_genai_configure:
gemini = GoogleAIGeminiGenerator(
generation_config=generation_config,
safety_settings=safety_settings,
Expand Down Expand Up @@ -84,14 +84,14 @@ def test_to_dict():

tool = Tool(function_declarations=[get_current_weather_func])

with patch("gemini_haystack.generators.gemini.genai.configure"):
with patch("google_ai_haystack.generators.gemini.genai.configure"):
gemini = GoogleAIGeminiGenerator(
generation_config=generation_config,
safety_settings=safety_settings,
tools=[tool],
)
assert gemini.to_dict() == {
"type": "gemini_haystack.generators.gemini.GoogleAIGeminiGenerator",
"type": "google_ai_haystack.generators.gemini.GoogleAIGeminiGenerator",
"init_parameters": {
"model": "gemini-pro-vision",
"generation_config": {
Expand All @@ -111,10 +111,10 @@ def test_to_dict():


def test_from_dict():
with patch("gemini_haystack.generators.gemini.genai.configure"):
with patch("google_ai_haystack.generators.gemini.genai.configure"):
gemini = GoogleAIGeminiGenerator.from_dict(
{
"type": "gemini_haystack.generators.gemini.GoogleAIGeminiGenerator",
"type": "google_ai_haystack.generators.gemini.GoogleAIGeminiGenerator",
"init_parameters": {
"model": "gemini-pro-vision",
"generation_config": {
Expand Down

0 comments on commit 47d991a

Please sign in to comment.