From 1cffd259053c122d7504c270c11a4949e682a779 Mon Sep 17 00:00:00 2001 From: Logan Date: Tue, 20 Feb 2024 10:27:31 -0600 Subject: [PATCH] fixes, so many fixes [circular import bonanza] (#11032) --- .github/workflows/unit_test.yml | 2 +- docs/examples/pipeline/query_pipeline.ipynb | 4 ++-- docs/module_guides/models/llms/usage_custom.md | 2 +- llama-index-core/llama_index/core/__init__.py | 2 +- .../llama_index/core/agent/legacy/react/base.py | 2 +- .../llama_index/core/agent/react/step.py | 2 +- .../llama_index/core/agent/react_multimodal/step.py | 2 +- .../llama_index/core/agent/runner/base.py | 2 +- .../llama_index/core/agent/runner/parallel.py | 2 +- llama-index-core/llama_index/core/agent/utils.py | 4 +--- .../llama_index/core/{ => base}/llms/base.py | 0 .../core/{ => base}/llms/generic_utils.py | 0 .../core/chat_engine/condense_plus_context.py | 2 +- .../core/chat_engine/condense_question.py | 2 +- llama-index-core/llama_index/core/llms/custom.py | 2 +- llama-index-core/llama_index/core/llms/llm.py | 6 +++--- llama-index-core/llama_index/core/prompts/base.py | 6 +++--- llama-index-core/llama_index/core/prompts/utils.py | 2 +- .../llama_index/core/service_context.py | 2 +- llama-index-core/pyproject.toml | 2 +- .../finetuning/callbacks/finetuning_handler.py | 2 +- .../llama_index/agent/openai/base.py | 2 +- .../llama_index/agent/openai/step.py | 2 +- .../examples/query_pipeline.ipynb | 13 ++++++------- .../llama_index/embeddings/anyscale/utils.py | 2 +- .../llama_index/embeddings/azure_openai/base.py | 2 +- .../llama_index/embeddings/jinaai/base.py | 2 +- .../llama_index/embeddings/mistralai/base.py | 2 +- .../llama_index/embeddings/openai/utils.py | 2 +- .../llama_index/llms/ai21/base.py | 2 +- .../llama-index-llms-ai21/tests/test_llms_ai21.py | 2 +- .../llama_index/llms/anthropic/base.py | 2 +- .../tests/test_llms_anthropic.py | 2 +- .../llama_index/llms/anyscale/base.py | 2 +- .../llama_index/llms/anyscale/utils.py | 2 +- .../tests/test_llms_anyscale.py | 2 +- .../llama_index/llms/azure_openai/base.py | 2 +- .../tests/test_llms_azure_openai.py | 2 +- .../llama_index/llms/bedrock/base.py | 2 +- .../llama_index/llms/bedrock/utils.py | 2 +- .../tests/test_llms_bedrock.py | 2 +- .../tests/test_llms_cohere.py | 2 +- .../tests/test_llms_dashscope.py | 2 +- .../llama_index/llms/everlyai/base.py | 2 +- .../tests/test_llms_everlyai.py | 2 +- .../llama_index/llms/gemini/utils.py | 2 +- .../tests/test_llms_gemini.py | 2 +- .../tests/test_llms_gradient.py | 2 +- .../llama_index/llms/huggingface/base.py | 4 ++-- .../tests/test_llms_huggingface.py | 2 +- .../llama_index/llms/konko/base.py | 2 +- .../llama_index/llms/konko/utils.py | 2 +- .../llama-index-llms-konko/tests/test_llms_konko.py | 2 +- .../llama_index/llms/langchain/base.py | 2 +- .../tests/test_llms_langchain.py | 2 +- .../llama_index/llms/litellm/base.py | 2 +- .../tests/test_llms_litellm.py | 2 +- .../llama_index/llms/llama_api/base.py | 2 +- .../tests/test_llms_llama_api.py | 2 +- .../llama_index/llms/llama_cpp/base.py | 2 +- .../tests/test_llms_llama_cpp.py | 2 +- .../tests/test_llms_localai.py | 2 +- .../llama_index/llms/mistralai/base.py | 2 +- .../tests/test_llms_mistral.py | 2 +- .../tests/test_llms_monsterapi.py | 2 +- .../llama_index/llms/neutrino/base.py | 2 +- .../tests/test_llms_neutrino.py | 2 +- .../llama_index/llms/nvidia_tensorrt/base.py | 6 ++++-- .../tests/test_llms_nvidia_tensorrt.py | 2 +- .../llama_index/llms/nvidia_triton/base.py | 4 ++-- .../tests/test_llms_nvidia_triton.py | 2 +- .../tests/test_llms_ollama.py | 2 +- .../llama_index/llms/openai_like/base.py | 2 +- .../tests/test_llms_openai_like.py | 2 +- .../llama_index/llms/openai/base.py | 2 +- .../llama_index/llms/openai/utils.py | 2 +- .../tests/test_llms_openai.py | 2 +- .../llama_index/llms/openllm/base.py | 4 ++-- .../llama_index/llms/openrouter/base.py | 2 +- .../tests/test_llms_openrouter.py | 2 +- .../llama-index-llms-palm/tests/test_llms_palm.py | 2 +- .../tests/test_llms_perplexity.py | 2 +- .../llama_index/llms/portkey/base.py | 3 ++- .../tests/test_llms_portkey.py | 2 +- .../tests/test_llms_predibase.py | 2 +- .../llama_index/llms/replicate/base.py | 2 +- .../tests/test_llms_replicate.py | 2 +- .../tests/test_llms_rungpt.py | 2 +- .../llama_index/llms/sagemaker_endpoint/base.py | 2 +- .../tests/test_llms_sagemaker_endpoint.py | 2 +- .../tests/test_llms_together.py | 2 +- .../tests/test_llms_vertex.py | 2 +- .../llama_index/llms/vllm/base.py | 4 ++-- .../llama-index-llms-vllm/tests/test_llms_vllm.py | 2 +- .../llama_index/llms/watsonx/base.py | 2 +- .../tests/test_llms_watsonx.py | 2 +- .../tests/test_llms_xinference.py | 2 +- .../multi_modal_llms/azure_openai/base.py | 2 +- .../llama_index/multi_modal_llms/openai/base.py | 2 +- .../multi_modal_llms/replicate_multi_modal/base.py | 2 +- .../llama_index/multi_modal_llms/replicate/base.py | 2 +- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 103 files changed, 122 insertions(+), 122 deletions(-) rename llama-index-core/llama_index/core/{ => base}/llms/base.py (100%) rename llama-index-core/llama_index/core/{ => base}/llms/generic_utils.py (100%) diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index 68e04c3308e7b..b805eb928b94c 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -11,7 +11,7 @@ env: jobs: test: - runs-on: ubuntu-latest-4core + runs-on: ubuntu-latest-unit-tester strategy: # You can use PyPy versions in python-version. # For example, pypy-2.7 and pypy-3.8 diff --git a/docs/examples/pipeline/query_pipeline.ipynb b/docs/examples/pipeline/query_pipeline.ipynb index dbb496330a3d6..9bdecd3dbf1c5 100644 --- a/docs/examples/pipeline/query_pipeline.ipynb +++ b/docs/examples/pipeline/query_pipeline.ipynb @@ -982,14 +982,14 @@ " OutputKeys,\n", ")\n", "from typing import Dict, Any\n", - "from llama_index.core.llms.llm import BaseLLM\n", + "from llama_index.core.llms.llm import LLM\n", "from pydantic import Field\n", "\n", "\n", "class RelatedMovieComponent(CustomQueryComponent):\n", " \"\"\"Related movie component.\"\"\"\n", "\n", - " llm: BaseLLM = Field(..., description=\"OpenAI LLM\")\n", + " llm: LLM = Field(..., description=\"OpenAI LLM\")\n", "\n", " def _validate_component_inputs(\n", " self, input: Dict[str, Any]\n", diff --git a/docs/module_guides/models/llms/usage_custom.md b/docs/module_guides/models/llms/usage_custom.md index 742b719cc34a8..b9a61334eff56 100644 --- a/docs/module_guides/models/llms/usage_custom.md +++ b/docs/module_guides/models/llms/usage_custom.md @@ -180,7 +180,7 @@ from llama_index.core.llms import ( CompletionResponseGen, LLMMetadata, ) -from llama_index.core.llms.base import llm_completion_callback +from llama_index.core.llms.callbacks import llm_completion_callback from llama_index.core import Settings diff --git a/llama-index-core/llama_index/core/__init__.py b/llama-index-core/llama_index/core/__init__.py index 5f1aa3fa6e880..9c92b685aa1fb 100644 --- a/llama-index-core/llama_index/core/__init__.py +++ b/llama-index-core/llama_index/core/__init__.py @@ -1,6 +1,6 @@ """Init file of LlamaIndex.""" -__version__ = "0.10.7" +__version__ = "0.10.8.post1" import logging from logging import NullHandler diff --git a/llama-index-core/llama_index/core/agent/legacy/react/base.py b/llama-index-core/llama_index/core/agent/legacy/react/base.py index d69593043fd58..d394772ec624f 100644 --- a/llama-index-core/llama_index/core/agent/legacy/react/base.py +++ b/llama-index-core/llama_index/core/agent/legacy/react/base.py @@ -34,7 +34,7 @@ AgentChatResponse, StreamingAgentChatResponse, ) -from llama_index.core.llms.base import ChatMessage, ChatResponse +from llama_index.core.base.llms.types import ChatMessage, ChatResponse from llama_index.core.llms.llm import LLM from llama_index.core.memory.chat_memory_buffer import ChatMemoryBuffer from llama_index.core.memory.types import BaseMemory diff --git a/llama-index-core/llama_index/core/agent/react/step.py b/llama-index-core/llama_index/core/agent/react/step.py index 9e3cd3f61008a..69df6ed4dca3d 100644 --- a/llama-index-core/llama_index/core/agent/react/step.py +++ b/llama-index-core/llama_index/core/agent/react/step.py @@ -42,7 +42,7 @@ AgentChatResponse, StreamingAgentChatResponse, ) -from llama_index.core.llms.base import ChatMessage, ChatResponse +from llama_index.core.base.llms.types import ChatMessage, ChatResponse from llama_index.core.llms.llm import LLM from llama_index.core.memory.chat_memory_buffer import ChatMemoryBuffer from llama_index.core.memory.types import BaseMemory diff --git a/llama-index-core/llama_index/core/agent/react_multimodal/step.py b/llama-index-core/llama_index/core/agent/react_multimodal/step.py index 1f6a127fee1a0..b25d747cf9444 100644 --- a/llama-index-core/llama_index/core/agent/react_multimodal/step.py +++ b/llama-index-core/llama_index/core/agent/react_multimodal/step.py @@ -32,7 +32,7 @@ AGENT_CHAT_RESPONSE_TYPE, AgentChatResponse, ) -from llama_index.core.llms.base import ChatMessage, ChatResponse +from llama_index.core.base.llms.types import ChatMessage, ChatResponse from llama_index.core.memory.chat_memory_buffer import ChatMemoryBuffer from llama_index.core.memory.types import BaseMemory from llama_index.core.multi_modal_llms.base import MultiModalLLM diff --git a/llama-index-core/llama_index/core/agent/runner/base.py b/llama-index-core/llama_index/core/agent/runner/base.py index b8442a1f159c4..bfdc17b94b43b 100644 --- a/llama-index-core/llama_index/core/agent/runner/base.py +++ b/llama-index-core/llama_index/core/agent/runner/base.py @@ -23,7 +23,7 @@ ChatResponseMode, StreamingAgentChatResponse, ) -from llama_index.core.llms.base import ChatMessage +from llama_index.core.base.llms.types import ChatMessage from llama_index.core.llms.llm import LLM from llama_index.core.memory import BaseMemory, ChatMemoryBuffer from llama_index.core.memory.types import BaseMemory diff --git a/llama-index-core/llama_index/core/agent/runner/parallel.py b/llama-index-core/llama_index/core/agent/runner/parallel.py index 8a145c38415b2..5c5ae0ace2fda 100644 --- a/llama-index-core/llama_index/core/agent/runner/parallel.py +++ b/llama-index-core/llama_index/core/agent/runner/parallel.py @@ -24,7 +24,7 @@ ChatResponseMode, StreamingAgentChatResponse, ) -from llama_index.core.llms.base import ChatMessage +from llama_index.core.base.llms.types import ChatMessage from llama_index.core.llms.llm import LLM from llama_index.core.memory import BaseMemory, ChatMemoryBuffer from llama_index.core.memory.types import BaseMemory diff --git a/llama-index-core/llama_index/core/agent/utils.py b/llama-index-core/llama_index/core/agent/utils.py index 187695079d23a..0fcb2d03963a0 100644 --- a/llama-index-core/llama_index/core/agent/utils.py +++ b/llama-index-core/llama_index/core/agent/utils.py @@ -1,9 +1,7 @@ """Agent utils.""" - from llama_index.core.agent.types import TaskStep -from llama_index.core.base.llms.types import MessageRole -from llama_index.core.llms.base import ChatMessage +from llama_index.core.base.llms.types import ChatMessage, MessageRole from llama_index.core.memory import BaseMemory diff --git a/llama-index-core/llama_index/core/llms/base.py b/llama-index-core/llama_index/core/base/llms/base.py similarity index 100% rename from llama-index-core/llama_index/core/llms/base.py rename to llama-index-core/llama_index/core/base/llms/base.py diff --git a/llama-index-core/llama_index/core/llms/generic_utils.py b/llama-index-core/llama_index/core/base/llms/generic_utils.py similarity index 100% rename from llama-index-core/llama_index/core/llms/generic_utils.py rename to llama-index-core/llama_index/core/base/llms/generic_utils.py diff --git a/llama-index-core/llama_index/core/chat_engine/condense_plus_context.py b/llama-index-core/llama_index/core/chat_engine/condense_plus_context.py index 605905767de79..2013d56bfc43d 100644 --- a/llama-index-core/llama_index/core/chat_engine/condense_plus_context.py +++ b/llama-index-core/llama_index/core/chat_engine/condense_plus_context.py @@ -14,7 +14,7 @@ from llama_index.core.indices.base_retriever import BaseRetriever from llama_index.core.indices.query.schema import QueryBundle from llama_index.core.indices.service_context import ServiceContext -from llama_index.core.llms.generic_utils import messages_to_history_str +from llama_index.core.base.llms.generic_utils import messages_to_history_str from llama_index.core.llms.llm import LLM from llama_index.core.memory import BaseMemory, ChatMemoryBuffer from llama_index.core.postprocessor.types import BaseNodePostprocessor diff --git a/llama-index-core/llama_index/core/chat_engine/condense_question.py b/llama-index-core/llama_index/core/chat_engine/condense_question.py index f802b715b5686..31b7d6d9b0bcd 100644 --- a/llama-index-core/llama_index/core/chat_engine/condense_question.py +++ b/llama-index-core/llama_index/core/chat_engine/condense_question.py @@ -13,7 +13,7 @@ ) from llama_index.core.chat_engine.utils import response_gen_from_query_engine from llama_index.core.embeddings.mock_embed_model import MockEmbedding -from llama_index.core.llms.generic_utils import messages_to_history_str +from llama_index.core.base.llms.generic_utils import messages_to_history_str from llama_index.core.llms.llm import LLM from llama_index.core.memory import BaseMemory, ChatMemoryBuffer from llama_index.core.prompts.base import BasePromptTemplate, PromptTemplate diff --git a/llama-index-core/llama_index/core/llms/custom.py b/llama-index-core/llama_index/core/llms/custom.py index 52bd1c685b42c..3cadc5d0ce23e 100644 --- a/llama-index-core/llama_index/core/llms/custom.py +++ b/llama-index-core/llama_index/core/llms/custom.py @@ -12,7 +12,7 @@ llm_chat_callback, llm_completion_callback, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_response_to_chat_response, stream_completion_response_to_chat_response, ) diff --git a/llama-index-core/llama_index/core/llms/llm.py b/llama-index-core/llama_index/core/llms/llm.py index 658cbb727c506..21fd79876aeaa 100644 --- a/llama-index-core/llama_index/core/llms/llm.py +++ b/llama-index-core/llama_index/core/llms/llm.py @@ -33,11 +33,11 @@ validator, ) from llama_index.core.callbacks import CBEventType, EventPayload -from llama_index.core.llms.base import BaseLLM -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.base import BaseLLM +from llama_index.core.base.llms.generic_utils import ( messages_to_prompt as generic_messages_to_prompt, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( prompt_to_messages, ) from llama_index.core.prompts import BasePromptTemplate, PromptTemplate diff --git a/llama-index-core/llama_index/core/prompts/base.py b/llama-index-core/llama_index/core/prompts/base.py index 4c3089b0b4478..c791076351976 100644 --- a/llama-index-core/llama_index/core/prompts/base.py +++ b/llama-index-core/llama_index/core/prompts/base.py @@ -34,11 +34,11 @@ validate_and_convert_stringable, ) from llama_index.core.bridge.pydantic import BaseModel -from llama_index.core.llms.base import BaseLLM -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.base import BaseLLM +from llama_index.core.base.llms.generic_utils import ( messages_to_prompt as default_messages_to_prompt, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( prompt_to_messages, ) from llama_index.core.prompts.prompt_type import PromptType diff --git a/llama-index-core/llama_index/core/prompts/utils.py b/llama-index-core/llama_index/core/prompts/utils.py index 87a5de0db6c3e..956424f7c3d6a 100644 --- a/llama-index-core/llama_index/core/prompts/utils.py +++ b/llama-index-core/llama_index/core/prompts/utils.py @@ -1,7 +1,7 @@ from string import Formatter from typing import List -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM def get_template_vars(template_str: str) -> List[str]: diff --git a/llama-index-core/llama_index/core/service_context.py b/llama-index-core/llama_index/core/service_context.py index 3338d7513272d..534b9016f35aa 100644 --- a/llama-index-core/llama_index/core/service_context.py +++ b/llama-index-core/llama_index/core/service_context.py @@ -13,7 +13,7 @@ LLMPredictor, BaseLLMPredictor, ) -from llama_index.core.llms.base import LLMMetadata +from llama_index.core.base.llms.types import LLMMetadata from llama_index.core.llms.llm import LLM from llama_index.core.llms.utils import LLMType, resolve_llm from llama_index.core.service_context_elements.llama_logger import LlamaLogger diff --git a/llama-index-core/pyproject.toml b/llama-index-core/pyproject.toml index 1d32d01a1d3fd..258e9a3f320df 100644 --- a/llama-index-core/pyproject.toml +++ b/llama-index-core/pyproject.toml @@ -42,7 +42,7 @@ name = "llama-index-core" packages = [{include = "llama_index"}] readme = "README.md" repository = "https://github.com/run-llama/llama_index" -version = "0.10.8" +version = "0.10.8.post1" [tool.poetry.dependencies] SQLAlchemy = {extras = ["asyncio"], version = ">=1.4.49"} diff --git a/llama-index-finetuning/llama_index/finetuning/callbacks/finetuning_handler.py b/llama-index-finetuning/llama_index/finetuning/callbacks/finetuning_handler.py index 037df668b9a1e..553bfa593c7d7 100644 --- a/llama-index-finetuning/llama_index/finetuning/callbacks/finetuning_handler.py +++ b/llama-index-finetuning/llama_index/finetuning/callbacks/finetuning_handler.py @@ -187,7 +187,7 @@ def save_finetuning_events(self, path: str) -> None: }, ... """ - from llama_index.core.llms.generic_utils import messages_to_history_str + from llama_index.core.base.llms.generic_utils import messages_to_history_str events_dict = self.get_finetuning_events() json_strs = [] diff --git a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/base.py b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/base.py index e78151575b29d..b604ecf13e08f 100644 --- a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/base.py +++ b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/base.py @@ -18,7 +18,7 @@ from llama_index.agent.openai.step import OpenAIAgentWorker from llama_index.core.agent.runner.base import AgentRunner from llama_index.core.callbacks import CallbackManager -from llama_index.core.llms.base import ChatMessage +from llama_index.core.base.llms.types import ChatMessage from llama_index.core.llms.llm import LLM from llama_index.core.memory.chat_memory_buffer import ChatMemoryBuffer from llama_index.core.memory.types import BaseMemory diff --git a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/step.py b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/step.py index a6ad95867435e..08d13368aa114 100644 --- a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/step.py +++ b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/step.py @@ -28,7 +28,7 @@ ChatResponseMode, StreamingAgentChatResponse, ) -from llama_index.core.llms.base import ChatMessage, ChatResponse +from llama_index.core.base.llms.types import ChatMessage, ChatResponse from llama_index.core.llms.llm import LLM from llama_index.core.memory import BaseMemory, ChatMemoryBuffer from llama_index.core.objects.base import ObjectRetriever diff --git a/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/examples/query_pipeline.ipynb b/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/examples/query_pipeline.ipynb index df3bd64306fc4..f1dcf3a4bd133 100644 --- a/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/examples/query_pipeline.ipynb +++ b/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/examples/query_pipeline.ipynb @@ -937,20 +937,19 @@ "metadata": {}, "outputs": [], "source": [ - "from llama_index.query_pipeline import (\n", + "from llama_index.core.query_pipeline import (\n", " CustomQueryComponent,\n", - " InputKeys,\n", - " OutputKeys,\n", ")\n", + "from llama_index.core.base.query_pipeline.query import InputKeys, OutputKeys\n", "from typing import Dict, Any\n", - "from llama_index.llms.llm import BaseLLM\n", + "from llama_index.core.llms.llm import LLM\n", "from pydantic import Field\n", "\n", "\n", "class RelatedMovieComponent(CustomQueryComponent):\n", " \"\"\"Related movie component.\"\"\"\n", "\n", - " llm: BaseLLM = Field(..., description=\"OpenAI LLM\")\n", + " llm: LLM = Field(..., description=\"OpenAI LLM\")\n", "\n", " def _validate_component_inputs(self, input: Dict[str, Any]) -> Dict[str, Any]:\n", " \"\"\"Validate component inputs during run_component.\"\"\"\n", @@ -1080,9 +1079,9 @@ ], "metadata": { "kernelspec": { - "display_name": "llama_integrations", + "display_name": "llama-index-4aB9_5sa-py3.10", "language": "python", - "name": "llama_integrations" + "name": "python3" }, "language_info": { "codemirror_mode": { diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/llama_index/embeddings/anyscale/utils.py b/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/llama_index/embeddings/anyscale/utils.py index 556cbc7ca6def..895857cfd0e97 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/llama_index/embeddings/anyscale/utils.py +++ b/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/llama_index/embeddings/anyscale/utils.py @@ -1,6 +1,6 @@ from typing import Optional, Tuple -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env DEFAULT_ANYSCALE_API_BASE = "https://api.endpoints.anyscale.com/v1" DEFAULT_ANYSCALE_API_VERSION = "" diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/base.py b/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/base.py index fc699fee9fbfe..204c035a9dcfa 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/base.py +++ b/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/base.py @@ -4,7 +4,7 @@ from llama_index.core.bridge.pydantic import Field, PrivateAttr, root_validator from llama_index.core.callbacks.base import CallbackManager from llama_index.core.constants import DEFAULT_EMBED_BATCH_SIZE -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from llama_index.embeddings.openai import ( OpenAIEmbedding, OpenAIEmbeddingMode, diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-jinaai/llama_index/embeddings/jinaai/base.py b/llama-index-integrations/embeddings/llama-index-embeddings-jinaai/llama_index/embeddings/jinaai/base.py index f64cb48988e70..0a8ee4285eeee 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-jinaai/llama_index/embeddings/jinaai/base.py +++ b/llama-index-integrations/embeddings/llama-index-embeddings-jinaai/llama_index/embeddings/jinaai/base.py @@ -9,7 +9,7 @@ ) from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks.base import CallbackManager -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env MAX_BATCH_SIZE = 2048 diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/base.py b/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/base.py index 138f78bf58f1f..80c471c7bad81 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/base.py +++ b/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/base.py @@ -8,7 +8,7 @@ ) from llama_index.core.bridge.pydantic import PrivateAttr from llama_index.core.callbacks.base import CallbackManager -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from mistralai.async_client import MistralAsyncClient from mistralai.client import MistralClient diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/utils.py b/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/utils.py index 72e909da80353..2b9bf4254c9cd 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/utils.py +++ b/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/utils.py @@ -2,7 +2,7 @@ import os from typing import Any, Callable, Optional, Tuple, Union -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from tenacity import ( before_sleep_log, retry, diff --git a/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/base.py b/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/base.py index 3805e5d53e6ea..4e290bb962870 100644 --- a/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/base.py +++ b/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/base.py @@ -12,7 +12,7 @@ from llama_index.core.callbacks import CallbackManager from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback from llama_index.core.llms.custom import CustomLLM -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_to_chat_decorator, get_from_param_or_env, ) diff --git a/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py b/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py index fcc355e09e831..3f71faba559c5 100644 --- a/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py +++ b/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.ai21 import AI21 diff --git a/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py b/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py index 9623f5ca07ec7..7fc634cfa05a0 100644 --- a/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py +++ b/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py @@ -18,7 +18,7 @@ llm_chat_callback, llm_completion_callback, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( achat_to_completion_decorator, astream_chat_to_completion_decorator, chat_to_completion_decorator, diff --git a/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py b/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py index 991430cb98c3a..e5215cd3cf06f 100644 --- a/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py +++ b/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.anthropic import Anthropic diff --git a/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/base.py b/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/base.py index 5d84ea3e0d6bd..d7f9849495e46 100644 --- a/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/base.py +++ b/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/base.py @@ -3,7 +3,7 @@ from llama_index.core.base.llms.types import ChatMessage, LLMMetadata from llama_index.core.callbacks import CallbackManager from llama_index.core.constants import DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from llama_index.core.types import BaseOutputParser, PydanticProgramMode from llama_index.llms.anyscale.utils import ( anyscale_modelname_to_contextsize, diff --git a/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/utils.py b/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/utils.py index ed5a235dc0d53..c2fc2925b9488 100644 --- a/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/utils.py +++ b/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/utils.py @@ -1,7 +1,7 @@ from typing import Any, Dict, List, Optional, Sequence, Tuple from llama_index.core.base.llms.types import ChatMessage, MessageRole -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env DEFAULT_ANYSCALE_API_BASE = "https://api.endpoints.anyscale.com/v1" DEFAULT_ANYSCALE_API_VERSION = "" diff --git a/llama-index-integrations/llms/llama-index-llms-anyscale/tests/test_llms_anyscale.py b/llama-index-integrations/llms/llama-index-llms-anyscale/tests/test_llms_anyscale.py index 5c91579cd700e..68129f5ab0313 100644 --- a/llama-index-integrations/llms/llama-index-llms-anyscale/tests/test_llms_anyscale.py +++ b/llama-index-integrations/llms/llama-index-llms-anyscale/tests/test_llms_anyscale.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.anyscale import Anyscale diff --git a/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/base.py b/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/base.py index b41006eee63a0..6297019c26127 100644 --- a/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/base.py +++ b/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/base.py @@ -4,7 +4,7 @@ from llama_index.core.base.llms.types import ChatMessage from llama_index.core.bridge.pydantic import Field, PrivateAttr, root_validator from llama_index.core.callbacks import CallbackManager -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from llama_index.core.types import BaseOutputParser, PydanticProgramMode from llama_index.llms.azure_openai.utils import ( refresh_openai_azuread_token, diff --git a/llama-index-integrations/llms/llama-index-llms-azure-openai/tests/test_llms_azure_openai.py b/llama-index-integrations/llms/llama-index-llms-azure-openai/tests/test_llms_azure_openai.py index 6fd623d8d22a6..1ba4a3c69164b 100644 --- a/llama-index-integrations/llms/llama-index-llms-azure-openai/tests/test_llms_azure_openai.py +++ b/llama-index-integrations/llms/llama-index-llms-azure-openai/tests/test_llms_azure_openai.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.azure_openai import AzureOpenAI diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py b/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py index d5ecfe0e51e1f..ae9c1b4b73021 100644 --- a/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py +++ b/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py @@ -20,7 +20,7 @@ llm_chat_callback, llm_completion_callback, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_response_to_chat_response, stream_completion_response_to_chat_response, ) diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py b/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py index 1eb9b62ee67b1..df1f3a4848031 100644 --- a/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py +++ b/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py @@ -3,7 +3,7 @@ from typing import Any, Callable, Optional, Sequence from llama_index.core.base.llms.types import ChatMessage -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( prompt_to_messages, ) from llama_index.llms.anthropic.utils import messages_to_anthropic_prompt diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py b/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py index e65f8a18bae00..af0c4aa14253a 100644 --- a/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py +++ b/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.bedrock import Bedrock diff --git a/llama-index-integrations/llms/llama-index-llms-cohere/tests/test_llms_cohere.py b/llama-index-integrations/llms/llama-index-llms-cohere/tests/test_llms_cohere.py index 11a37d801a98b..f18b9558c399b 100644 --- a/llama-index-integrations/llms/llama-index-llms-cohere/tests/test_llms_cohere.py +++ b/llama-index-integrations/llms/llama-index-llms-cohere/tests/test_llms_cohere.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.cohere import Cohere diff --git a/llama-index-integrations/llms/llama-index-llms-dashscope/tests/test_llms_dashscope.py b/llama-index-integrations/llms/llama-index-llms-dashscope/tests/test_llms_dashscope.py index 885e6e25b511e..375e24fbfc2d6 100644 --- a/llama-index-integrations/llms/llama-index-llms-dashscope/tests/test_llms_dashscope.py +++ b/llama-index-integrations/llms/llama-index-llms-dashscope/tests/test_llms_dashscope.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.dashscope import DashScope diff --git a/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/base.py b/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/base.py index c8a7afcab795f..fb0d81bdb13d9 100644 --- a/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/base.py +++ b/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/base.py @@ -3,7 +3,7 @@ from llama_index.core.base.llms.types import ChatMessage, LLMMetadata from llama_index.core.callbacks import CallbackManager from llama_index.core.constants import DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from llama_index.core.types import BaseOutputParser, PydanticProgramMode from llama_index.llms.everlyai.utils import everlyai_modelname_to_contextsize from llama_index.llms.openai import OpenAI diff --git a/llama-index-integrations/llms/llama-index-llms-everlyai/tests/test_llms_everlyai.py b/llama-index-integrations/llms/llama-index-llms-everlyai/tests/test_llms_everlyai.py index 4eddba63e1da9..970d2b0326a74 100644 --- a/llama-index-integrations/llms/llama-index-llms-everlyai/tests/test_llms_everlyai.py +++ b/llama-index-integrations/llms/llama-index-llms-everlyai/tests/test_llms_everlyai.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.everlyai import EverlyAI diff --git a/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py b/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py index dd65f4784cf11..8bc01a53c076b 100644 --- a/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py +++ b/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py @@ -4,7 +4,7 @@ import google.generativeai as genai import PIL from llama_index.core.base.llms.types import MessageRole -from llama_index.core.llms.base import ( +from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, CompletionResponse, diff --git a/llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py b/llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py index b9b238d1e3542..3e458877ad97a 100644 --- a/llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py +++ b/llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.gemini import Gemini diff --git a/llama-index-integrations/llms/llama-index-llms-gradient/tests/test_llms_gradient.py b/llama-index-integrations/llms/llama-index-llms-gradient/tests/test_llms_gradient.py index 0c8ab23af6f70..a04347ccbf689 100644 --- a/llama-index-integrations/llms/llama-index-llms-gradient/tests/test_llms_gradient.py +++ b/llama-index-integrations/llms/llama-index-llms-gradient/tests/test_llms_gradient.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.gradient import GradientBaseModelLLM, GradientModelAdapterLLM diff --git a/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py b/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py index 0d7e6e9120872..0d1407e9239b7 100644 --- a/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py +++ b/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py @@ -28,11 +28,11 @@ llm_completion_callback, ) from llama_index.core.llms.custom import CustomLLM -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_response_to_chat_response, stream_completion_response_to_chat_response, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( messages_to_prompt as generic_messages_to_prompt, ) from llama_index.core.prompts.base import PromptTemplate diff --git a/llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py b/llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py index c065b856d2d75..c65dc8fd0f9c6 100644 --- a/llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py +++ b/llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.huggingface import HuggingFaceInferenceAPI, HuggingFaceLLM diff --git a/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/base.py b/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/base.py index 036709c642f86..49fdd7f0fcac1 100644 --- a/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/base.py +++ b/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/base.py @@ -15,7 +15,7 @@ from llama_index.core.callbacks import CallbackManager from llama_index.core.constants import DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( achat_to_completion_decorator, acompletion_to_chat_decorator, astream_chat_to_completion_decorator, diff --git a/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py b/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py index bba9fc5ec6bb9..5d310e27e5a77 100644 --- a/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py +++ b/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py @@ -5,7 +5,7 @@ import openai from llama_index.core.base.llms.types import ChatMessage from llama_index.core.bridge.pydantic import BaseModel -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from packaging.version import parse from tenacity import ( before_sleep_log, diff --git a/llama-index-integrations/llms/llama-index-llms-konko/tests/test_llms_konko.py b/llama-index-integrations/llms/llama-index-llms-konko/tests/test_llms_konko.py index d4a7b1dcbaf9a..39aeddc95c959 100644 --- a/llama-index-integrations/llms/llama-index-llms-konko/tests/test_llms_konko.py +++ b/llama-index-integrations/llms/llama-index-llms-konko/tests/test_llms_konko.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.konko import Konko diff --git a/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py b/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py index 01fb8b2723c5f..4e463cf7f525b 100644 --- a/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py +++ b/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py @@ -14,7 +14,7 @@ from llama_index.core.bridge.pydantic import PrivateAttr from llama_index.core.callbacks import CallbackManager from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_response_to_chat_response, stream_completion_response_to_chat_response, ) diff --git a/llama-index-integrations/llms/llama-index-llms-langchain/tests/test_llms_langchain.py b/llama-index-integrations/llms/llama-index-llms-langchain/tests/test_llms_langchain.py index 9a101969c0aa4..4d01c5f1ec907 100644 --- a/llama-index-integrations/llms/llama-index-llms-langchain/tests/test_llms_langchain.py +++ b/llama-index-integrations/llms/llama-index-llms-langchain/tests/test_llms_langchain.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.langchain import LangChainLLM diff --git a/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py b/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py index 17c2a415de041..52e6fe74a4fc7 100644 --- a/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py +++ b/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py @@ -14,7 +14,7 @@ from llama_index.core.callbacks import CallbackManager from llama_index.core.constants import DEFAULT_TEMPERATURE from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( achat_to_completion_decorator, acompletion_to_chat_decorator, astream_chat_to_completion_decorator, diff --git a/llama-index-integrations/llms/llama-index-llms-litellm/tests/test_llms_litellm.py b/llama-index-integrations/llms/llama-index-llms-litellm/tests/test_llms_litellm.py index 8c295f53bbf5a..fd55aa0a333ab 100644 --- a/llama-index-integrations/llms/llama-index-llms-litellm/tests/test_llms_litellm.py +++ b/llama-index-integrations/llms/llama-index-llms-litellm/tests/test_llms_litellm.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.litellm import LiteLLM diff --git a/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py b/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py index 657bac868d450..84f6f79f405fc 100644 --- a/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py +++ b/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py @@ -13,7 +13,7 @@ from llama_index.core.constants import DEFAULT_NUM_OUTPUTS from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback from llama_index.core.llms.custom import CustomLLM -from llama_index.core.llms.generic_utils import chat_to_completion_decorator +from llama_index.core.base.llms.generic_utils import chat_to_completion_decorator from llama_index.core.types import BaseOutputParser, PydanticProgramMode from llama_index.llms.openai.utils import ( from_openai_message_dict, diff --git a/llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py b/llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py index b9593bac9e3cc..feecc7c06690b 100644 --- a/llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py +++ b/llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.llama_api import LlamaAPI diff --git a/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py b/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py index f8c1f65dbbe02..809b19276d940 100644 --- a/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py +++ b/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py @@ -19,7 +19,7 @@ ) from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback from llama_index.core.llms.custom import CustomLLM -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_response_to_chat_response, stream_completion_response_to_chat_response, ) diff --git a/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py b/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py index deb9d0d48d4d4..d72ca524294d6 100644 --- a/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py +++ b/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.llama_cpp import LlamaCPP diff --git a/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py b/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py index a1ef1894867ff..2ebb0203b567e 100644 --- a/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py +++ b/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.localai import LocalAI diff --git a/llama-index-integrations/llms/llama-index-llms-mistralai/llama_index/llms/mistralai/base.py b/llama-index-integrations/llms/llama-index-llms-mistralai/llama_index/llms/mistralai/base.py index 9eb7640e241f7..05977726e8d1a 100644 --- a/llama-index-integrations/llms/llama-index-llms-mistralai/llama_index/llms/mistralai/base.py +++ b/llama-index-integrations/llms/llama-index-llms-mistralai/llama_index/llms/mistralai/base.py @@ -19,7 +19,7 @@ llm_chat_callback, llm_completion_callback, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( achat_to_completion_decorator, astream_chat_to_completion_decorator, chat_to_completion_decorator, diff --git a/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py b/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py index 5df2423c197b0..c89091e66b7df 100644 --- a/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py +++ b/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.mistralai import MistralAI diff --git a/llama-index-integrations/llms/llama-index-llms-monsterapi/tests/test_llms_monsterapi.py b/llama-index-integrations/llms/llama-index-llms-monsterapi/tests/test_llms_monsterapi.py index f5fb195247fcc..f8d4434d4b282 100644 --- a/llama-index-integrations/llms/llama-index-llms-monsterapi/tests/test_llms_monsterapi.py +++ b/llama-index-integrations/llms/llama-index-llms-monsterapi/tests/test_llms_monsterapi.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.monsterapi import MonsterLLM diff --git a/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py b/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py index 8b0abea1aa0e3..b1470353b648f 100644 --- a/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py +++ b/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py @@ -6,7 +6,7 @@ DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE, ) -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from llama_index.llms.openai_like import OpenAILike DEFAULT_API_BASE = "https://router.neutrinoapp.com/api/llm-router" diff --git a/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py b/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py index 5b1583f0be2b4..cff486909cc16 100644 --- a/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py +++ b/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.neutrino import Neutrino diff --git a/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py b/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py index dc707bae3119e..7114c4c04e229 100644 --- a/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py +++ b/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py @@ -9,7 +9,7 @@ from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks import CallbackManager from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS -from llama_index.core.llms.base import ( +from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, CompletionResponse, @@ -20,7 +20,9 @@ llm_completion_callback, ) from llama_index.core.llms.custom import CustomLLM -from llama_index.core.llms.generic_utils import completion_response_to_chat_response +from llama_index.core.base.llms.generic_utils import ( + completion_response_to_chat_response, +) from llama_index.llms.nvidia_tensorrt.utils import ( generate_completion_dict, get_output, diff --git a/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py b/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py index 458b505f7606f..224e9a38f5b6c 100644 --- a/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py +++ b/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.nvidia_tensorrt import LocalTensorRTLLM diff --git a/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py b/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py index c9af03ae2fcaa..430a4eab21dae 100644 --- a/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py +++ b/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py @@ -8,7 +8,7 @@ from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks import CallbackManager -from llama_index.core.llms.base import ( +from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsyncGen, @@ -19,7 +19,7 @@ LLMMetadata, ) from llama_index.core.llms.callbacks import llm_chat_callback -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_to_chat_decorator, ) from llama_index.core.llms.llm import LLM diff --git a/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py b/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py index 26239092cb938..c0058b15a1ce1 100644 --- a/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py +++ b/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.nvidia_triton import NvidiaTriton diff --git a/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py b/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py index 2a73532a45d13..695a83a08ada1 100644 --- a/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py +++ b/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.ollama import Ollama diff --git a/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py b/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py index 424e57babc4d7..f5184a8753e01 100644 --- a/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py +++ b/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py @@ -12,7 +12,7 @@ ) from llama_index.core.bridge.pydantic import Field from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( async_stream_completion_response_to_chat_response, completion_response_to_chat_response, stream_completion_response_to_chat_response, diff --git a/llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_llms_openai_like.py b/llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_llms_openai_like.py index 50e86b53d290a..d87a63b738e9f 100644 --- a/llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_llms_openai_like.py +++ b/llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_llms_openai_like.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.openai_like import OpenAILike diff --git a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/base.py b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/base.py index 1a8da01a3312e..379a0f65ac6c8 100644 --- a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/base.py +++ b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/base.py @@ -33,7 +33,7 @@ llm_chat_callback, llm_completion_callback, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( achat_to_completion_decorator, acompletion_to_chat_decorator, astream_chat_to_completion_decorator, diff --git a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py index 23fb6c14edea2..d3cd4cdc0afb9 100644 --- a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py +++ b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py @@ -5,7 +5,7 @@ from deprecated import deprecated from llama_index.core.base.llms.types import ChatMessage from llama_index.core.bridge.pydantic import BaseModel -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from tenacity import ( before_sleep_log, retry, diff --git a/llama-index-integrations/llms/llama-index-llms-openai/tests/test_llms_openai.py b/llama-index-integrations/llms/llama-index-llms-openai/tests/test_llms_openai.py index 2c8eb24ffdf08..096898b908e59 100644 --- a/llama-index-integrations/llms/llama-index-llms-openai/tests/test_llms_openai.py +++ b/llama-index-integrations/llms/llama-index-llms-openai/tests/test_llms_openai.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.openai import OpenAI diff --git a/llama-index-integrations/llms/llama-index-llms-openllm/llama_index/llms/openllm/base.py b/llama-index-integrations/llms/llama-index-llms-openllm/llama_index/llms/openllm/base.py index a1b2dc49ee85e..b0e50390372bd 100644 --- a/llama-index-integrations/llms/llama-index-llms-openllm/llama_index/llms/openllm/base.py +++ b/llama-index-integrations/llms/llama-index-llms-openllm/llama_index/llms/openllm/base.py @@ -27,10 +27,10 @@ llm_chat_callback, llm_completion_callback, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_response_to_chat_response, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( messages_to_prompt as generic_messages_to_prompt, ) from llama_index.core.llms.llm import LLM diff --git a/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py b/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py index 3743f2691d2dd..0b1e928294777 100644 --- a/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py +++ b/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py @@ -7,7 +7,7 @@ DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE, ) -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from llama_index.llms.openai_like import OpenAILike DEFAULT_API_BASE = "https://openrouter.ai/api/v1" diff --git a/llama-index-integrations/llms/llama-index-llms-openrouter/tests/test_llms_openrouter.py b/llama-index-integrations/llms/llama-index-llms-openrouter/tests/test_llms_openrouter.py index 29cf183dd7fb5..ad037c1749e26 100644 --- a/llama-index-integrations/llms/llama-index-llms-openrouter/tests/test_llms_openrouter.py +++ b/llama-index-integrations/llms/llama-index-llms-openrouter/tests/test_llms_openrouter.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.openrouter import OpenRouter diff --git a/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py b/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py index 019689d3c538e..686da75b3f858 100644 --- a/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py +++ b/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.palm import PaLM diff --git a/llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_llms_perplexity.py b/llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_llms_perplexity.py index 9c3c5e5161c91..85981c61fd208 100644 --- a/llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_llms_perplexity.py +++ b/llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_llms_perplexity.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.perplexity import Perplexity diff --git a/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/base.py b/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/base.py index 0bafff1e2b8a3..30cb1e744c33a 100644 --- a/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/base.py +++ b/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/base.py @@ -1,6 +1,7 @@ """ Portkey integration with Llama_index for enhanced monitoring. """ + from typing import TYPE_CHECKING, Any, Callable, List, Optional, Sequence, Union, cast from llama_index.core.base.llms.types import ( @@ -14,7 +15,7 @@ from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback from llama_index.core.llms.custom import CustomLLM -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( chat_to_completion_decorator, completion_to_chat_decorator, stream_chat_to_completion_decorator, diff --git a/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py b/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py index 305c8e7947af6..035cea31b746d 100644 --- a/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py +++ b/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.portkey import Portkey diff --git a/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py b/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py index 6adbd916c3e0b..234c824829c92 100644 --- a/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py +++ b/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.predibase import PredibaseLLM diff --git a/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/base.py b/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/base.py index f56e819087adf..297715ba56813 100644 --- a/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/base.py +++ b/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/base.py @@ -12,7 +12,7 @@ from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback from llama_index.core.llms.custom import CustomLLM -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_response_to_chat_response, stream_completion_response_to_chat_response, ) diff --git a/llama-index-integrations/llms/llama-index-llms-replicate/tests/test_llms_replicate.py b/llama-index-integrations/llms/llama-index-llms-replicate/tests/test_llms_replicate.py index f1abf03ec2d22..3f1a5cdef6cb7 100644 --- a/llama-index-integrations/llms/llama-index-llms-replicate/tests/test_llms_replicate.py +++ b/llama-index-integrations/llms/llama-index-llms-replicate/tests/test_llms_replicate.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.replicate import Replicate diff --git a/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py b/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py index d3c5febaba18a..a5e9ae5d56977 100644 --- a/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py +++ b/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.rungpt import RunGptLLM diff --git a/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py b/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py index 1f0d5bc1baa98..e4234175067d8 100644 --- a/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py +++ b/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py @@ -16,7 +16,7 @@ llm_chat_callback, llm_completion_callback, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_response_to_chat_response, stream_completion_response_to_chat_response, ) diff --git a/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py b/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py index e3406679c0c66..867e28213de7c 100644 --- a/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py +++ b/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.sagemaker_endpoint import SageMakerLLM diff --git a/llama-index-integrations/llms/llama-index-llms-together/tests/test_llms_together.py b/llama-index-integrations/llms/llama-index-llms-together/tests/test_llms_together.py index eee087d9057c6..a93b4d8939367 100644 --- a/llama-index-integrations/llms/llama-index-llms-together/tests/test_llms_together.py +++ b/llama-index-integrations/llms/llama-index-llms-together/tests/test_llms_together.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.together import TogetherLLM diff --git a/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py b/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py index b9d9e2fc995d0..5bb1e9987c7c9 100644 --- a/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py +++ b/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.vertex import Vertex diff --git a/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/base.py b/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/base.py index 93c795871b23f..c1c70987774d1 100644 --- a/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/base.py +++ b/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/base.py @@ -14,11 +14,11 @@ from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks import CallbackManager from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_response_to_chat_response, stream_completion_response_to_chat_response, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( messages_to_prompt as generic_messages_to_prompt, ) from llama_index.core.llms.llm import LLM diff --git a/llama-index-integrations/llms/llama-index-llms-vllm/tests/test_llms_vllm.py b/llama-index-integrations/llms/llama-index-llms-vllm/tests/test_llms_vllm.py index 04dac87b8c987..1be18dd2d4871 100644 --- a/llama-index-integrations/llms/llama-index-llms-vllm/tests/test_llms_vllm.py +++ b/llama-index-integrations/llms/llama-index-llms-vllm/tests/test_llms_vllm.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.vllm import Vllm diff --git a/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/base.py b/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/base.py index e62df096a02f2..3573b59cd52ab 100644 --- a/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/base.py +++ b/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/base.py @@ -14,7 +14,7 @@ from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks import CallbackManager from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( completion_to_chat_decorator, stream_completion_to_chat_decorator, ) diff --git a/llama-index-integrations/llms/llama-index-llms-watsonx/tests/test_llms_watsonx.py b/llama-index-integrations/llms/llama-index-llms-watsonx/tests/test_llms_watsonx.py index 6342caea8e0c5..df2f3c652d1e2 100644 --- a/llama-index-integrations/llms/llama-index-llms-watsonx/tests/test_llms_watsonx.py +++ b/llama-index-integrations/llms/llama-index-llms-watsonx/tests/test_llms_watsonx.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.watsonx import WatsonX diff --git a/llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py b/llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py index 3b73ff1d3f00f..a9877230e9902 100644 --- a/llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py +++ b/llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py @@ -1,4 +1,4 @@ -from llama_index.core.llms.base import BaseLLM +from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.xinference import Xinference diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-azure-openai/llama_index/multi_modal_llms/azure_openai/base.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-azure-openai/llama_index/multi_modal_llms/azure_openai/base.py index 270585d2b1552..b5a9a89200666 100644 --- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-azure-openai/llama_index/multi_modal_llms/azure_openai/base.py +++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-azure-openai/llama_index/multi_modal_llms/azure_openai/base.py @@ -8,7 +8,7 @@ DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE, ) -from llama_index.core.llms.generic_utils import get_from_param_or_env +from llama_index.core.base.llms.generic_utils import get_from_param_or_env from llama_index.core.multi_modal_llms import MultiModalLLMMetadata from llama_index.llms.azure_openai.utils import ( refresh_openai_azuread_token, diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/base.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/base.py index 5bde0f36198d4..fed2ffb1a8c03 100644 --- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/base.py +++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/base.py @@ -18,7 +18,7 @@ DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE, ) -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( messages_to_prompt as generic_messages_to_prompt, ) from llama_index.core.multi_modal_llms import ( diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/base.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/base.py index 340b4e36f6b03..734c9a3e9fc9e 100644 --- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/base.py +++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/base.py @@ -13,7 +13,7 @@ from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks import CallbackManager from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( messages_to_prompt as generic_messages_to_prompt, ) from llama_index.core.multi_modal_llms import ( diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/base.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/base.py index 340b4e36f6b03..734c9a3e9fc9e 100644 --- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/base.py +++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/base.py @@ -13,7 +13,7 @@ from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks import CallbackManager from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS -from llama_index.core.llms.generic_utils import ( +from llama_index.core.base.llms.generic_utils import ( messages_to_prompt as generic_messages_to_prompt, ) from llama_index.core.multi_modal_llms import ( diff --git a/poetry.lock b/poetry.lock index a8e64e28c115e..66f8e3491c04e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1502,13 +1502,13 @@ llama-index-llms-openai = ">=0.1.1,<0.2.0" [[package]] name = "llama-index-core" -version = "0.10.7" +version = "0.10.8.post1" description = "Interface between LLMs and your data" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "llama_index_core-0.10.7-py3-none-any.whl", hash = "sha256:0dd1ec2878451d75d4644757cc24c8533d83a6c62ffa2ac0a4f1745a31cbb1ad"}, - {file = "llama_index_core-0.10.7.tar.gz", hash = "sha256:d02f92128ce285110e953ed116a3db1ba02eec508d11ccdca14a851ece5eaead"}, + {file = "llama_index_core-0.10.8.post1-py3-none-any.whl", hash = "sha256:51b736b22818cb0b117a1486be54cf05f9496e79feb5de7262be5ec5480d85ec"}, + {file = "llama_index_core-0.10.8.post1.tar.gz", hash = "sha256:449fdd206901ca1e403b0c7fd021e52f9f0aa6fd121793f3062c442429a11ffd"}, ] [package.dependencies] @@ -4264,4 +4264,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<3.12" -content-hash = "712557a4f68621c668730fdc56f1a225def91772af558b7279a081426c0de646" +content-hash = "f1f95484f87927a6eed40e388280e01e1fb44cd987b310542a60e21420522e6e" diff --git a/pyproject.toml b/pyproject.toml index 889e1a6d927ff..103a8a41de38b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ llama-index-agent-openai = "^0.1.0" llama-index-readers-file = "^0.1.0" llama-index-readers-llama-parse = "^0.1.0" llama-index-indices-managed-llama-cloud = "^0.1.0" -llama-index-core = "^0.10.0" +llama-index-core = "^0.10.8.post1" llama-index-multi-modal-llms-openai = "^0.1.0" [tool.poetry.group.dev.dependencies]