From 97ec95b8a57eb1b5375430a0dd27bb3dd0b8e6a2 Mon Sep 17 00:00:00 2001 From: standsleeping Date: Sun, 1 Sep 2024 10:22:07 -0500 Subject: [PATCH] New package name --- CONTRIBUTING.md | 32 +++++++++---------- README.md | 14 ++++---- aisuite/framework/chat_completion_response.py | 2 +- aisuite/framework/choice.py | 2 +- aisuite/providers/anthropic_interface.py | 2 +- aisuite/providers/google_interface.py | 2 +- aisuite/providers/mistral_interface.py | 2 +- aisuite/providers/ollama_interface.py | 2 +- examples/RAG.ipynb | 8 ++--- examples/client.ipynb | 4 +-- examples/llm_reasoning.ipynb | 4 +-- guides/google.md | 6 ++-- pyproject.toml | 2 +- tests/client/test_client.py | 2 +- tests/providers/test_anthropic_interface.py | 2 +- tests/providers/test_fireworks_interface.py | 2 +- tests/providers/test_google_interface.py | 2 +- tests/providers/test_groq_interface.py | 2 +- tests/providers/test_mistral_interface.py | 2 +- tests/providers/test_ollama_interface.py | 2 +- tests/providers/test_openai_interface.py | 2 +- tests/providers/test_replicate_interface.py | 2 +- 22 files changed, 50 insertions(+), 50 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b96223e..4172e357 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ -# Contributing to aimodels +# Contributing to aisuite First off, thanks for taking the time to contribute! @@ -33,15 +33,15 @@ and smooth out the experience for all involved. The community looks forward to y ## I Have a Question > If you want to ask a question, we assume that you have read the available -> [Documentation](https://github.com/andrewyng/aimodels/blob/main/README.md). +> [Documentation](https://github.com/andrewyng/aisuite/blob/main/README.md). -Before you ask a question, it is best to search for existing [Issues](https://github.com/andrewyng/aimodels/issues) +Before you ask a question, it is best to search for existing [Issues](https://github.com/andrewyng/aisuite/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. If you then still feel the need to ask a question and need clarification, we recommend the following: -- Open an [Issue](https://github.com/andrewyng/aimodels/issues/new). +- Open an [Issue](https://github.com/andrewyng/aisuite/issues/new). - Provide as much context as you can about what you're running into. - Provide project and platform versions (python, OS, etc.), depending on what seems relevant. @@ -66,10 +66,10 @@ complete the following steps in advance to help us fix any potential bug as fast - Make sure that you are using the latest version. - Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment - components/versions (Make sure that you have read the [documentation](https://github.com/andrewyng/aimodels/blob/main/README.md). + components/versions (Make sure that you have read the [documentation](https://github.com/andrewyng/aisuite/blob/main/README.md). If you are looking for support, you might want to check [this section](#i-have-a-question)). - To see if other users have experienced (and potentially already solved) the same issue you are having, - check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/andrewyng/aimodels?q=label%3Abug). + check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/andrewyng/aisuite?q=label%3Abug). - Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. - Collect information about the bug: @@ -89,7 +89,7 @@ complete the following steps in advance to help us fix any potential bug as fast We use GitHub issues to track bugs and errors. If you run into an issue with the project: -- Open an [Issue](https://github.com/andrewyng/aimodels/issues/new). (Since we can't be sure at +- Open an [Issue](https://github.com/andrewyng/aisuite/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) - Explain the behavior you would expect and the actual behavior. - Please provide as much context as possible and describe the *reproduction steps* that someone else can @@ -112,7 +112,7 @@ Please use the issue templates provided. ### Suggesting Enhancements -This section guides you through submitting an enhancement suggestion for aimodels, +This section guides you through submitting an enhancement suggestion for aisuite, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. @@ -120,9 +120,9 @@ guidelines will help maintainers and the community to understand your suggestion #### Before Submitting an Enhancement - Make sure that you are using the latest version. -- Read the [documentation](https://github.com/andrewyng/aimodels/blob/main/README.md) carefully +- Read the [documentation](https://github.com/andrewyng/aisuite/blob/main/README.md) carefully and find out if the functionality is already covered, maybe by an individual configuration. -- Perform a [search](https://github.com/andrewyng/aimodels/issues) to see if the enhancement has +- Perform a [search](https://github.com/andrewyng/aisuite/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. - Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. @@ -130,13 +130,13 @@ guidelines will help maintainers and the community to understand your suggestion #### How Do I Submit a Good Enhancement Suggestion? -Enhancement suggestions are tracked as [GitHub issues](https://github.com/andrewyng/aimodels/issues). +Enhancement suggestions are tracked as [GitHub issues](https://github.com/andrewyng/aisuite/issues). - Use a **clear and descriptive title** for the issue to identify the suggestion. - Provide a **step-by-step description of the suggested enhancement** in as many details as possible. - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. -- **Explain why this enhancement would be useful** to most aimodels users. You may also want to +- **Explain why this enhancement would be useful** to most aisuite users. You may also want to point out the other projects that solved it better and which could serve as inspiration. @@ -145,10 +145,10 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/andrew #### Pre-requisites You should first [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) -the `aimodels` repository and then clone your forked repository: +the `aisuite` repository and then clone your forked repository: ```bash -git clone https://github.com//aimodels.git +git clone https://github.com//aisuite.git ``` @@ -164,7 +164,7 @@ Please install the development and test dependencies: poetry install --with dev,test ``` -`aimodels` uses pre-commit to ensure the formatting is consistent: +`aisuite` uses pre-commit to ensure the formatting is consistent: ```bash pre-commit install ``` @@ -185,7 +185,7 @@ pass, so please make sure it passes locally. #### Testing -`aimodels` tracks unit tests. Pytest is used to execute said unit tests in `tests/`: +`aisuite` tracks unit tests. Pytest is used to execute said unit tests in `tests/`: ```bash poetry run pytest tests diff --git a/README.md b/README.md index 3bfa222e..176f27b4 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ -# aimodels +# aisuite [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) Simple, unified interface to multiple Generative AI providers. -`aimodels` is an tool designed for researchers who need to evaluate and compare the responses of -multiple LLMs through a standardized interface. Based on the OpenAI interface standard, `aimodels` +`aisuite` is an tool designed for researchers who need to evaluate and compare the responses of +multiple LLMs through a standardized interface. Based on the OpenAI interface standard, `aisuite` makes it easy to interact with the most popular LLMs and compare the results of their chat based functionality, with support for more interfaces coming in the near future. ## Installation ```shell -pip install aimodels +pip install aisuite ``` ## Set up @@ -44,7 +44,7 @@ pip install openai anthropic In your python code: ```python -import aimodels as ai +import aisuite as ai client = ai.Client() models = ["openai:gpt-4o", "anthropic:claude-3-5-sonnet-20240620"] @@ -67,12 +67,12 @@ for model in models: For more examples, check out the `examples` directory where you will find several notebooks that you can run to experiment with the interface. -The current list of supported providers can be found in the `aimodels.providers` +The current list of supported providers can be found in the `aisuite.providers` package. ## License -aimodels is released under the MIT License. You are free to use, modify, and distribute +aisuite is released under the MIT License. You are free to use, modify, and distribute the code for both commercial and non-commercial purposes. ## Contributing diff --git a/aisuite/framework/chat_completion_response.py b/aisuite/framework/chat_completion_response.py index 99c83977..ef13fc2c 100644 --- a/aisuite/framework/chat_completion_response.py +++ b/aisuite/framework/chat_completion_response.py @@ -1,4 +1,4 @@ -from aimodels.framework.choice import Choice +from aisuite.framework.choice import Choice class ChatCompletionResponse: diff --git a/aisuite/framework/choice.py b/aisuite/framework/choice.py index 9c29ac29..3542da57 100644 --- a/aisuite/framework/choice.py +++ b/aisuite/framework/choice.py @@ -1,4 +1,4 @@ -from aimodels.framework.message import Message +from aisuite.framework.message import Message class Choice: diff --git a/aisuite/providers/anthropic_interface.py b/aisuite/providers/anthropic_interface.py index 284cf2a6..3a54e6d6 100644 --- a/aisuite/providers/anthropic_interface.py +++ b/aisuite/providers/anthropic_interface.py @@ -2,7 +2,7 @@ import os -from aimodels.framework import ProviderInterface, ChatCompletionResponse +from aisuite.framework import ProviderInterface, ChatCompletionResponse class AnthropicInterface(ProviderInterface): diff --git a/aisuite/providers/google_interface.py b/aisuite/providers/google_interface.py index 9e4fd2ab..88aa3b68 100644 --- a/aisuite/providers/google_interface.py +++ b/aisuite/providers/google_interface.py @@ -1,7 +1,7 @@ """The interface to Google's Vertex AI.""" import os -from aimodels.framework import ProviderInterface, ChatCompletionResponse +from aisuite.framework import ProviderInterface, ChatCompletionResponse class GoogleInterface(ProviderInterface): diff --git a/aisuite/providers/mistral_interface.py b/aisuite/providers/mistral_interface.py index b6ff92e7..cb20964f 100644 --- a/aisuite/providers/mistral_interface.py +++ b/aisuite/providers/mistral_interface.py @@ -1,6 +1,6 @@ import os -from aimodels.framework import ProviderInterface +from aisuite.framework import ProviderInterface class MistralInterface(ProviderInterface): diff --git a/aisuite/providers/ollama_interface.py b/aisuite/providers/ollama_interface.py index e9f78288..c3487ae6 100644 --- a/aisuite/providers/ollama_interface.py +++ b/aisuite/providers/ollama_interface.py @@ -1,6 +1,6 @@ """The interface to the Ollama API.""" -from aimodels.framework import ProviderInterface, ChatCompletionResponse +from aisuite.framework import ProviderInterface, ChatCompletionResponse from httpx import ConnectError import os diff --git a/examples/RAG.ipynb b/examples/RAG.ipynb index 10149a10..0f9cd445 100644 --- a/examples/RAG.ipynb +++ b/examples/RAG.ipynb @@ -87,11 +87,11 @@ "name": "stderr", "output_type": "stream", "text": [ - "/Users/ksolo/Library/Caches/pypoetry/virtualenvs/aimodels-HUywTnIy-py3.12/lib/python3.12/site-packages/sentence_transformers/evaluation/SentenceEvaluator.py:81: SyntaxWarning: invalid escape sequence '\\g'\n", + "/Users/ksolo/Library/Caches/pypoetry/virtualenvs/aisuite-HUywTnIy-py3.12/lib/python3.12/site-packages/sentence_transformers/evaluation/SentenceEvaluator.py:81: SyntaxWarning: invalid escape sequence '\\g'\n", " return re.sub(r\"([a-z])([A-Z])\", \"\\g<1> \\g<2>\", class_name)\n", - "/Users/ksolo/Library/Caches/pypoetry/virtualenvs/aimodels-HUywTnIy-py3.12/lib/python3.12/site-packages/sentence_transformers/model_card.py:524: SyntaxWarning: invalid escape sequence '\\d'\n", + "/Users/ksolo/Library/Caches/pypoetry/virtualenvs/aisuite-HUywTnIy-py3.12/lib/python3.12/site-packages/sentence_transformers/model_card.py:524: SyntaxWarning: invalid escape sequence '\\d'\n", " if dataset_name and re.match(\"_dataset_\\d+\", dataset_name):\n", - "/Users/ksolo/Library/Caches/pypoetry/virtualenvs/aimodels-HUywTnIy-py3.12/lib/python3.12/site-packages/sentence_transformers/losses/DenoisingAutoEncoderLoss.py:16: SyntaxWarning: invalid escape sequence '\\_'\n", + "/Users/ksolo/Library/Caches/pypoetry/virtualenvs/aisuite-HUywTnIy-py3.12/lib/python3.12/site-packages/sentence_transformers/losses/DenoisingAutoEncoderLoss.py:16: SyntaxWarning: invalid escape sequence '\\_'\n", " \"\"\"\n" ] } @@ -157,7 +157,7 @@ "\n", "prompt = f'Given the following data, Please answer the question: \\n\\n ##question \\n {question}\\n\\n ##context \\n {context}'\n", "\n", - "import aimodels as ai\n", + "import aisuite as ai\n", "client = ai.Client()\n", "\n", "messages = [\n", diff --git a/examples/client.ipynb b/examples/client.ipynb index 6af1ceb9..a8049a37 100644 --- a/examples/client.ipynb +++ b/examples/client.ipynb @@ -40,7 +40,7 @@ ], "source": [ "import sys\n", - "sys.path.append('../../aimodels')\n", + "sys.path.append('../../aisuite')\n", "\n", "from dotenv import load_dotenv, find_dotenv\n", "\n", @@ -77,7 +77,7 @@ }, "outputs": [], "source": [ - "import aimodels as ai\n", + "import aisuite as ai\n", "\n", "client = ai.Client()\n", "\n", diff --git a/examples/llm_reasoning.ipynb b/examples/llm_reasoning.ipynb index c3869cc2..5aa834b1 100644 --- a/examples/llm_reasoning.ipynb +++ b/examples/llm_reasoning.ipynb @@ -69,7 +69,7 @@ ], "source": [ "import sys\n", - "sys.path.append('../../aimodels')\n", + "sys.path.append('../../aisuite')\n", "\n", "from dotenv import load_dotenv, find_dotenv\n", "\n", @@ -102,7 +102,7 @@ "metadata": {}, "outputs": [], "source": [ - "import aimodels as ai\n", + "import aisuite as ai\n", "\n", "client = ai.Client()" ] diff --git a/guides/google.md b/guides/google.md index bb36ef11..eb351bd0 100644 --- a/guides/google.md +++ b/guides/google.md @@ -1,6 +1,6 @@ # Google (Vertex) AI -To use Google (Vertex) AI with the `aimodels` library, you'll first need to create a Google Cloud account and set up your environment to work with Google Cloud. +To use Google (Vertex) AI with the `aisuite` library, you'll first need to create a Google Cloud account and set up your environment to work with Google Cloud. ## Create a Google Cloud Account and Project @@ -26,7 +26,7 @@ Set the `GOOGLE_REGION` environment variable to the ID of your project. You can ## Create a Service Account For API Access -Because `aimodels` needs to authenticate with Google Cloud to access the Vertex AI API, you'll need to create a service account and set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of a JSON file containing the service account's credentials, which you can download from the Google Cloud Console. +Because `aisuite` needs to authenticate with Google Cloud to access the Vertex AI API, you'll need to create a service account and set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the path of a JSON file containing the service account's credentials, which you can download from the Google Cloud Console. This is documented [here](https://cloud.google.com/docs/authentication/provide-credentials-adc#how-to), and the basic steps are as follows: @@ -71,7 +71,7 @@ pip install vertexai In your code: ```python -import aimodels as ai +import aisuite as ai client = ai.Client() model="vertex:gemini-1.5-pro-001" diff --git a/pyproject.toml b/pyproject.toml index c6430848..4bab8269 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "aimodels" +name = "aisuite" version = "0.1.0" description = "" authors = ["Andrew Ng"] diff --git a/tests/client/test_client.py b/tests/client/test_client.py index 4a00616b..1232a37d 100644 --- a/tests/client/test_client.py +++ b/tests/client/test_client.py @@ -1,5 +1,5 @@ import pytest -from aimodels.client.client import Client, AnthropicInterface +from aisuite.client.client import Client, AnthropicInterface def test_get_provider_interface_with_new_instance(): diff --git a/tests/providers/test_anthropic_interface.py b/tests/providers/test_anthropic_interface.py index 54bf645e..93d4e025 100644 --- a/tests/providers/test_anthropic_interface.py +++ b/tests/providers/test_anthropic_interface.py @@ -1,6 +1,6 @@ import pytest from unittest.mock import patch, MagicMock -from aimodels.providers.anthropic_interface import AnthropicInterface +from aisuite.providers.anthropic_interface import AnthropicInterface @pytest.fixture(autouse=True) diff --git a/tests/providers/test_fireworks_interface.py b/tests/providers/test_fireworks_interface.py index e9368961..5b9cec51 100644 --- a/tests/providers/test_fireworks_interface.py +++ b/tests/providers/test_fireworks_interface.py @@ -1,6 +1,6 @@ import pytest from unittest.mock import patch, MagicMock -from aimodels.providers.fireworks_interface import FireworksInterface +from aisuite.providers.fireworks_interface import FireworksInterface @pytest.fixture(autouse=True) diff --git a/tests/providers/test_google_interface.py b/tests/providers/test_google_interface.py index ee3871f7..da6a8237 100644 --- a/tests/providers/test_google_interface.py +++ b/tests/providers/test_google_interface.py @@ -1,6 +1,6 @@ import pytest from unittest.mock import patch, MagicMock -from aimodels.providers.google_interface import GoogleInterface +from aisuite.providers.google_interface import GoogleInterface from vertexai.generative_models import Content, Part diff --git a/tests/providers/test_groq_interface.py b/tests/providers/test_groq_interface.py index 100fe0d3..720dca98 100644 --- a/tests/providers/test_groq_interface.py +++ b/tests/providers/test_groq_interface.py @@ -1,6 +1,6 @@ import pytest from unittest.mock import patch, MagicMock -from aimodels.providers.groq_interface import GroqInterface +from aisuite.providers.groq_interface import GroqInterface @pytest.fixture(autouse=True) diff --git a/tests/providers/test_mistral_interface.py b/tests/providers/test_mistral_interface.py index 334d652e..85f956b9 100644 --- a/tests/providers/test_mistral_interface.py +++ b/tests/providers/test_mistral_interface.py @@ -3,7 +3,7 @@ from mistralai.models.chat_completion import ChatMessage -from aimodels.providers.mistral_interface import MistralInterface +from aisuite.providers.mistral_interface import MistralInterface @pytest.fixture(autouse=True) diff --git a/tests/providers/test_ollama_interface.py b/tests/providers/test_ollama_interface.py index 947a0e11..3948f319 100644 --- a/tests/providers/test_ollama_interface.py +++ b/tests/providers/test_ollama_interface.py @@ -1,6 +1,6 @@ import pytest from unittest.mock import patch, MagicMock -from aimodels.providers.ollama_interface import OllamaInterface +from aisuite.providers.ollama_interface import OllamaInterface from httpx import ConnectError diff --git a/tests/providers/test_openai_interface.py b/tests/providers/test_openai_interface.py index c18c1239..5b105f54 100644 --- a/tests/providers/test_openai_interface.py +++ b/tests/providers/test_openai_interface.py @@ -1,6 +1,6 @@ import pytest from unittest.mock import patch, MagicMock -from aimodels.providers.openai_interface import OpenAIInterface +from aisuite.providers.openai_interface import OpenAIInterface @pytest.fixture(autouse=True) diff --git a/tests/providers/test_replicate_interface.py b/tests/providers/test_replicate_interface.py index 16935122..92063cba 100644 --- a/tests/providers/test_replicate_interface.py +++ b/tests/providers/test_replicate_interface.py @@ -1,6 +1,6 @@ import pytest from unittest.mock import patch, MagicMock -from aimodels.providers.replicate_interface import ReplicateInterface +from aisuite.providers.replicate_interface import ReplicateInterface @pytest.fixture(autouse=True)