From a607f97e2f7b9e821e03dc6e0034a128b97f76f4 Mon Sep 17 00:00:00 2001 From: Logan Date: Mon, 19 Feb 2024 10:14:33 -0600 Subject: [PATCH] Bug fixes (#10971) --- docs/BUILD | 1 - .../document_management/BUILD | 1 - docs/examples/finetuning/embeddings/BUILD | 1 - docs/examples/output_parsing/BUILD | 1 - docs/module_guides/models/llms/modules.md | 9 ++ .../llama_index/core/graph_stores/registry.py | 18 --- .../core/node_parser/text/sentence_window.py | 5 +- .../core/postprocessor/rankGPT_rerank.py | 10 +- .../knowledge_graph_query_engine.py | 8 - .../core/response_synthesizers/factory.py | 1 + .../poetry.lock | 145 ++++++++++++++++-- .../pyproject.toml | 4 +- .../llama_index/embeddings/openai/base.py | 8 +- .../pyproject.toml | 2 +- 14 files changed, 161 insertions(+), 53 deletions(-) delete mode 100644 docs/BUILD delete mode 100644 docs/examples/discover_llamaindex/document_management/BUILD delete mode 100644 docs/examples/finetuning/embeddings/BUILD delete mode 100644 docs/examples/output_parsing/BUILD delete mode 100644 llama-index-core/llama_index/core/graph_stores/registry.py diff --git a/docs/BUILD b/docs/BUILD deleted file mode 100644 index db46e8d6c978c..0000000000000 --- a/docs/BUILD +++ /dev/null @@ -1 +0,0 @@ -python_sources() diff --git a/docs/examples/discover_llamaindex/document_management/BUILD b/docs/examples/discover_llamaindex/document_management/BUILD deleted file mode 100644 index db46e8d6c978c..0000000000000 --- a/docs/examples/discover_llamaindex/document_management/BUILD +++ /dev/null @@ -1 +0,0 @@ -python_sources() diff --git a/docs/examples/finetuning/embeddings/BUILD b/docs/examples/finetuning/embeddings/BUILD deleted file mode 100644 index db46e8d6c978c..0000000000000 --- a/docs/examples/finetuning/embeddings/BUILD +++ /dev/null @@ -1 +0,0 @@ -python_sources() diff --git a/docs/examples/output_parsing/BUILD b/docs/examples/output_parsing/BUILD deleted file mode 100644 index db46e8d6c978c..0000000000000 --- a/docs/examples/output_parsing/BUILD +++ /dev/null @@ -1 +0,0 @@ -python_sources() diff --git a/docs/module_guides/models/llms/modules.md b/docs/module_guides/models/llms/modules.md index e839a9ce42302..452ee2ef6fcad 100644 --- a/docs/module_guides/models/llms/modules.md +++ b/docs/module_guides/models/llms/modules.md @@ -158,6 +158,15 @@ maxdepth: 1 /examples/llm/monsterapi.ipynb ``` +## MyMagic + +```{toctree} +--- +maxdepth: 1 +--- +/examples/llm/mymagic.ipynb +``` + ## NeutrinoAI ```{toctree} diff --git a/llama-index-core/llama_index/core/graph_stores/registry.py b/llama-index-core/llama_index/core/graph_stores/registry.py deleted file mode 100644 index 98e4b569cf58c..0000000000000 --- a/llama-index-core/llama_index/core/graph_stores/registry.py +++ /dev/null @@ -1,18 +0,0 @@ -from enum import Enum -from typing import Dict, Type - -from llama_index.core.graph_stores.simple import SimpleGraphStore -from llama_index.core.graph_stores.types import GraphStore - - -class GraphStoreType(str, Enum): - SIMPLE = "simple_kg" - - -GRAPH_STORE_TYPE_TO_GRAPH_STORE_CLASS: Dict[GraphStoreType, Type[GraphStore]] = { - GraphStoreType.SIMPLE: SimpleGraphStore, -} - -GRAPH_STORE_CLASS_TO_GRAPH_STORE_TYPE: Dict[Type[GraphStore], GraphStoreType] = { - cls_: type_ for type_, cls_ in GRAPH_STORE_TYPE_TO_GRAPH_STORE_CLASS.items() -} diff --git a/llama-index-core/llama_index/core/node_parser/text/sentence_window.py b/llama-index-core/llama_index/core/node_parser/text/sentence_window.py index 9ebea72ffa772..0adf48e995f31 100644 --- a/llama-index-core/llama_index/core/node_parser/text/sentence_window.py +++ b/llama-index-core/llama_index/core/node_parser/text/sentence_window.py @@ -1,4 +1,5 @@ """Simple node parser.""" + from typing import Any, Callable, List, Optional, Sequence from llama_index.core.bridge.pydantic import Field @@ -115,7 +116,9 @@ def build_window_nodes_from_documents( # add window to each node for i, node in enumerate(nodes): window_nodes = nodes[ - max(0, i - self.window_size) : min(i + self.window_size, len(nodes)) + max(0, i - self.window_size) : min( + i + self.window_size + 1, len(nodes) + ) ] node.metadata[self.window_metadata_key] = " ".join( diff --git a/llama-index-core/llama_index/core/postprocessor/rankGPT_rerank.py b/llama-index-core/llama_index/core/postprocessor/rankGPT_rerank.py index 4b5e370d517f7..9659f10416af9 100644 --- a/llama-index-core/llama_index/core/postprocessor/rankGPT_rerank.py +++ b/llama-index-core/llama_index/core/postprocessor/rankGPT_rerank.py @@ -2,7 +2,7 @@ from typing import Any, Dict, List, Optional, Sequence from llama_index.core.bridge.pydantic import Field -from llama_index.core.llms import LLM, ChatMessage, ChatResponse, OpenAI +from llama_index.core.llms import LLM, ChatMessage, ChatResponse from llama_index.core.postprocessor.types import BaseNodePostprocessor from llama_index.core.prompts import BasePromptTemplate from llama_index.core.prompts.default_prompts import RANKGPT_RERANK_PROMPT @@ -14,12 +14,18 @@ logger.setLevel(logging.WARNING) +def get_default_llm() -> LLM: + from llama_index.llms.openai import OpenAI + + return OpenAI(model="gpt-3.5-turbo-16k") + + class RankGPTRerank(BaseNodePostprocessor): """RankGPT-based reranker.""" top_n: int = Field(default=5, description="Top N nodes to return from reranking.") llm: LLM = Field( - default_factory=lambda: OpenAI(model="gpt-3.5-turbo-16k"), + default_factory=get_default_llm, description="LLM to use for rankGPT", ) verbose: bool = Field( diff --git a/llama-index-core/llama_index/core/query_engine/knowledge_graph_query_engine.py b/llama-index-core/llama_index/core/query_engine/knowledge_graph_query_engine.py index a0c375f6ab615..83d4335ce9f47 100644 --- a/llama-index-core/llama_index/core/query_engine/knowledge_graph_query_engine.py +++ b/llama-index-core/llama_index/core/query_engine/knowledge_graph_query_engine.py @@ -6,9 +6,6 @@ from llama_index.core.base.base_query_engine import BaseQueryEngine from llama_index.core.base.response.schema import RESPONSE_TYPE from llama_index.core.callbacks.schema import CBEventType, EventPayload -from llama_index.core.graph_stores.registry import ( - GRAPH_STORE_CLASS_TO_GRAPH_STORE_TYPE, -) from llama_index.core.llms.llm import LLM from llama_index.core.prompts.base import ( BasePromptTemplate, @@ -89,11 +86,6 @@ def __init__( self._llm = llm or llm_from_settings_or_context(Settings, service_context) - # Get Graph Store Type - self._graph_store_type = GRAPH_STORE_CLASS_TO_GRAPH_STORE_TYPE[ - self.graph_store.__class__ - ] - # Get Graph schema self._graph_schema = self.graph_store.get_schema(refresh=refresh_schema) diff --git a/llama-index-core/llama_index/core/response_synthesizers/factory.py b/llama-index-core/llama_index/core/response_synthesizers/factory.py index 86f8f67ea0aac..f8543667c3f2d 100644 --- a/llama-index-core/llama_index/core/response_synthesizers/factory.py +++ b/llama-index-core/llama_index/core/response_synthesizers/factory.py @@ -156,6 +156,7 @@ def get_response_synthesizer( ) elif response_mode == ResponseMode.NO_TEXT: return NoText( + llm=llm, streaming=streaming, callback_manager=callback_manager, prompt_helper=prompt_helper, diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/poetry.lock b/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/poetry.lock index 40a14d3bd0303..1691c003af013 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/poetry.lock +++ b/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/poetry.lock @@ -1833,13 +1833,13 @@ files = [ [[package]] name = "llama-index-core" -version = "0.9.42.post3" +version = "0.10.6.post1" description = "Interface between LLMs and your data" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "llama_index_core-0.9.42.post3-py3-none-any.whl", hash = "sha256:27b4b20bf32daf73a78a63212ed5801b10e6560435ef82fd2be0c78ed2f5dfeb"}, - {file = "llama_index_core-0.9.42.post3.tar.gz", hash = "sha256:5edaa39efa88e4f9dec481b57289960160a7f2646bdd5288a1b651655cff140f"}, + {file = "llama_index_core-0.10.6.post1-py3-none-any.whl", hash = "sha256:22c24c3c6d3deae280cadf6785b35a2565bbd23e1eb7cb53d73c6b9e6fae624a"}, + {file = "llama_index_core-0.10.6.post1.tar.gz", hash = "sha256:8ac99640e85da303933ca862d3846e1d400087e109749042357be355f5931fb6"}, ] [package.dependencies] @@ -1849,16 +1849,20 @@ deprecated = ">=1.2.9.3" dirtyjson = ">=1.0.8,<2.0.0" fsspec = ">=2023.5.0" httpx = "*" +llamaindex-py-client = ">=0.1.12" nest-asyncio = ">=1.5.8,<2.0.0" networkx = ">=3.0" nltk = ">=3.8.1,<4.0.0" numpy = "*" openai = ">=1.1.0" pandas = "*" +pillow = ">=9.0.0" +PyYAML = ">=6.0.1" requests = ">=2.31.0" SQLAlchemy = {version = ">=1.4.49", extras = ["asyncio"]} tenacity = ">=8.2.0,<9.0.0" tiktoken = ">=0.3.3" +tqdm = ">=4.66.1,<5.0.0" typing-extensions = ">=4.5.0" typing-inspect = ">=0.8.0" @@ -1870,35 +1874,65 @@ local-models = ["optimum[onnxruntime] (>=1.13.2,<2.0.0)", "sentencepiece (>=0.1. postgres = ["asyncpg (>=0.28.0,<0.29.0)", "pgvector (>=0.1.0,<0.2.0)", "psycopg2-binary (>=2.9.9,<3.0.0)"] query-tools = ["guidance (>=0.0.64,<0.0.65)", "jsonpath-ng (>=1.6.0,<2.0.0)", "lm-format-enforcer (>=0.4.3,<0.5.0)", "rank-bm25 (>=0.2.2,<0.3.0)", "scikit-learn", "spacy (>=3.7.1,<4.0.0)"] +[[package]] +name = "llama-index-embeddings-openai" +version = "0.1.1" +description = "llama-index embeddings openai integration" +optional = false +python-versions = ">=3.8.1,<3.12" +files = [ + {file = "llama_index_embeddings_openai-0.1.1-py3-none-any.whl", hash = "sha256:516a573dc0561e64920f09b61162b72a0bc1a0b1b3dccd02f74609e33cabd362"}, + {file = "llama_index_embeddings_openai-0.1.1.tar.gz", hash = "sha256:b93d296cb87b2945d60c9e570e2b367711513a239899d2987cb15e11c447c40a"}, +] + +[package.dependencies] +llama-index-core = ">=0.10.1,<0.11.0" + [[package]] name = "llama-index-llms-azure-openai" -version = "0.0.2" +version = "0.1.1" description = "llama-index llms azure openai integration" optional = false python-versions = ">=3.8.1,<3.12" files = [ - {file = "llama_index_llms_azure_openai-0.0.2-py3-none-any.whl", hash = "sha256:d529846339eb15457af2c7cc889e319aa8ffbdd65f7a2084aed96c6f25df1892"}, - {file = "llama_index_llms_azure_openai-0.0.2.tar.gz", hash = "sha256:edea9bf7a94e2f59f416ab6db496ef1384c3168d8a2ea9198f5d044f35d944fc"}, + {file = "llama_index_llms_azure_openai-0.1.1-py3-none-any.whl", hash = "sha256:ad0666ae5f9018c851d0fccefb3d20084aa45d35b06c4fdf6473ca2486890636"}, + {file = "llama_index_llms_azure_openai-0.1.1.tar.gz", hash = "sha256:b798022f53a39206ea0762e7c1263d23ad1fbbe4d97d8766d743e01636fe2235"}, ] [package.dependencies] azure-identity = ">=1.15.0,<2.0.0" -llama-index-core = ">=0.9.32,<0.10.0" -llama-index-llms-openai = ">=0.0.1,<0.0.2" +httpx = "*" +llama-index-core = ">=0.10.1,<0.11.0" +llama-index-llms-openai = ">=0.1.1,<0.2.0" [[package]] name = "llama-index-llms-openai" -version = "0.0.1" +version = "0.1.2" description = "llama-index llms openai integration" optional = false python-versions = ">=3.8.1,<3.12" files = [ - {file = "llama_index_llms_openai-0.0.1-py3-none-any.whl", hash = "sha256:fd39b334a8653bc8071496a3fdca3d9ace2a8b49e3feda4426987df87b8fe29c"}, - {file = "llama_index_llms_openai-0.0.1.tar.gz", hash = "sha256:d0e5f6ce9ff339974475a2a91bb6a47806775213e46b08676aa6e70b8768803b"}, + {file = "llama_index_llms_openai-0.1.2-py3-none-any.whl", hash = "sha256:94b10c4726fca4a0df5053a0bc71f7746b20c56a9e629fb1f92264fb896e50cd"}, + {file = "llama_index_llms_openai-0.1.2.tar.gz", hash = "sha256:8d344d490e29a98ed002c27726ff8264d3f61da0b0d4917a49c80e0f395f14d3"}, ] [package.dependencies] -llama-index-core = ">=0.9.32,<0.10.0" +llama-index-core = ">=0.10.1,<0.11.0" + +[[package]] +name = "llamaindex-py-client" +version = "0.1.13" +description = "" +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "llamaindex_py_client-0.1.13-py3-none-any.whl", hash = "sha256:02400c90655da80ae373e0455c829465208607d72462f1898fd383fdfe8dabce"}, + {file = "llamaindex_py_client-0.1.13.tar.gz", hash = "sha256:3bd9b435ee0a78171eba412dea5674d813eb5bf36e577d3c7c7e90edc54900d9"}, +] + +[package.dependencies] +httpx = ">=0.20.0" +pydantic = ">=1.10" [[package]] name = "markupsafe" @@ -2607,6 +2641,91 @@ files = [ {file = "pickleshare-0.7.5.tar.gz", hash = "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca"}, ] +[[package]] +name = "pillow" +version = "10.2.0" +description = "Python Imaging Library (Fork)" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pillow-10.2.0-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:7823bdd049099efa16e4246bdf15e5a13dbb18a51b68fa06d6c1d4d8b99a796e"}, + {file = "pillow-10.2.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:83b2021f2ade7d1ed556bc50a399127d7fb245e725aa0113ebd05cfe88aaf588"}, + {file = "pillow-10.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6fad5ff2f13d69b7e74ce5b4ecd12cc0ec530fcee76356cac6742785ff71c452"}, + {file = "pillow-10.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da2b52b37dad6d9ec64e653637a096905b258d2fc2b984c41ae7d08b938a67e4"}, + {file = "pillow-10.2.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:47c0995fc4e7f79b5cfcab1fc437ff2890b770440f7696a3ba065ee0fd496563"}, + {file = "pillow-10.2.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:322bdf3c9b556e9ffb18f93462e5f749d3444ce081290352c6070d014c93feb2"}, + {file = "pillow-10.2.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:51f1a1bffc50e2e9492e87d8e09a17c5eea8409cda8d3f277eb6edc82813c17c"}, + {file = "pillow-10.2.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:69ffdd6120a4737710a9eee73e1d2e37db89b620f702754b8f6e62594471dee0"}, + {file = "pillow-10.2.0-cp310-cp310-win32.whl", hash = "sha256:c6dafac9e0f2b3c78df97e79af707cdc5ef8e88208d686a4847bab8266870023"}, + {file = "pillow-10.2.0-cp310-cp310-win_amd64.whl", hash = "sha256:aebb6044806f2e16ecc07b2a2637ee1ef67a11840a66752751714a0d924adf72"}, + {file = "pillow-10.2.0-cp310-cp310-win_arm64.whl", hash = "sha256:7049e301399273a0136ff39b84c3678e314f2158f50f517bc50285fb5ec847ad"}, + {file = "pillow-10.2.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:35bb52c37f256f662abdfa49d2dfa6ce5d93281d323a9af377a120e89a9eafb5"}, + {file = "pillow-10.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9c23f307202661071d94b5e384e1e1dc7dfb972a28a2310e4ee16103e66ddb67"}, + {file = "pillow-10.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:773efe0603db30c281521a7c0214cad7836c03b8ccff897beae9b47c0b657d61"}, + {file = "pillow-10.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:11fa2e5984b949b0dd6d7a94d967743d87c577ff0b83392f17cb3990d0d2fd6e"}, + {file = "pillow-10.2.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:716d30ed977be8b37d3ef185fecb9e5a1d62d110dfbdcd1e2a122ab46fddb03f"}, + {file = "pillow-10.2.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:a086c2af425c5f62a65e12fbf385f7c9fcb8f107d0849dba5839461a129cf311"}, + {file = "pillow-10.2.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c8de2789052ed501dd829e9cae8d3dcce7acb4777ea4a479c14521c942d395b1"}, + {file = "pillow-10.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:609448742444d9290fd687940ac0b57fb35e6fd92bdb65386e08e99af60bf757"}, + {file = "pillow-10.2.0-cp311-cp311-win32.whl", hash = "sha256:823ef7a27cf86df6597fa0671066c1b596f69eba53efa3d1e1cb8b30f3533068"}, + {file = "pillow-10.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:1da3b2703afd040cf65ec97efea81cfba59cdbed9c11d8efc5ab09df9509fc56"}, + {file = "pillow-10.2.0-cp311-cp311-win_arm64.whl", hash = "sha256:edca80cbfb2b68d7b56930b84a0e45ae1694aeba0541f798e908a49d66b837f1"}, + {file = "pillow-10.2.0-cp312-cp312-macosx_10_10_x86_64.whl", hash = "sha256:1b5e1b74d1bd1b78bc3477528919414874748dd363e6272efd5abf7654e68bef"}, + {file = "pillow-10.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0eae2073305f451d8ecacb5474997c08569fb4eb4ac231ffa4ad7d342fdc25ac"}, + {file = "pillow-10.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7c2286c23cd350b80d2fc9d424fc797575fb16f854b831d16fd47ceec078f2c"}, + {file = "pillow-10.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e23412b5c41e58cec602f1135c57dfcf15482013ce6e5f093a86db69646a5aa"}, + {file = "pillow-10.2.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:52a50aa3fb3acb9cf7213573ef55d31d6eca37f5709c69e6858fe3bc04a5c2a2"}, + {file = "pillow-10.2.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:127cee571038f252a552760076407f9cff79761c3d436a12af6000cd182a9d04"}, + {file = "pillow-10.2.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:8d12251f02d69d8310b046e82572ed486685c38f02176bd08baf216746eb947f"}, + {file = "pillow-10.2.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:54f1852cd531aa981bc0965b7d609f5f6cc8ce8c41b1139f6ed6b3c54ab82bfb"}, + {file = "pillow-10.2.0-cp312-cp312-win32.whl", hash = "sha256:257d8788df5ca62c980314053197f4d46eefedf4e6175bc9412f14412ec4ea2f"}, + {file = "pillow-10.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:154e939c5f0053a383de4fd3d3da48d9427a7e985f58af8e94d0b3c9fcfcf4f9"}, + {file = "pillow-10.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:f379abd2f1e3dddb2b61bc67977a6b5a0a3f7485538bcc6f39ec76163891ee48"}, + {file = "pillow-10.2.0-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:8373c6c251f7ef8bda6675dd6d2b3a0fcc31edf1201266b5cf608b62a37407f9"}, + {file = "pillow-10.2.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:870ea1ada0899fd0b79643990809323b389d4d1d46c192f97342eeb6ee0b8483"}, + {file = "pillow-10.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b4b6b1e20608493548b1f32bce8cca185bf0480983890403d3b8753e44077129"}, + {file = "pillow-10.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3031709084b6e7852d00479fd1d310b07d0ba82765f973b543c8af5061cf990e"}, + {file = "pillow-10.2.0-cp38-cp38-manylinux_2_28_aarch64.whl", hash = "sha256:3ff074fc97dd4e80543a3e91f69d58889baf2002b6be64347ea8cf5533188213"}, + {file = "pillow-10.2.0-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:cb4c38abeef13c61d6916f264d4845fab99d7b711be96c326b84df9e3e0ff62d"}, + {file = "pillow-10.2.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b1b3020d90c2d8e1dae29cf3ce54f8094f7938460fb5ce8bc5c01450b01fbaf6"}, + {file = "pillow-10.2.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:170aeb00224ab3dc54230c797f8404507240dd868cf52066f66a41b33169bdbe"}, + {file = "pillow-10.2.0-cp38-cp38-win32.whl", hash = "sha256:c4225f5220f46b2fde568c74fca27ae9771536c2e29d7c04f4fb62c83275ac4e"}, + {file = "pillow-10.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:0689b5a8c5288bc0504d9fcee48f61a6a586b9b98514d7d29b840143d6734f39"}, + {file = "pillow-10.2.0-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:b792a349405fbc0163190fde0dc7b3fef3c9268292586cf5645598b48e63dc67"}, + {file = "pillow-10.2.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c570f24be1e468e3f0ce7ef56a89a60f0e05b30a3669a459e419c6eac2c35364"}, + {file = "pillow-10.2.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8ecd059fdaf60c1963c58ceb8997b32e9dc1b911f5da5307aab614f1ce5c2fb"}, + {file = "pillow-10.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c365fd1703040de1ec284b176d6af5abe21b427cb3a5ff68e0759e1e313a5e7e"}, + {file = "pillow-10.2.0-cp39-cp39-manylinux_2_28_aarch64.whl", hash = "sha256:70c61d4c475835a19b3a5aa42492409878bbca7438554a1f89d20d58a7c75c01"}, + {file = "pillow-10.2.0-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:b6f491cdf80ae540738859d9766783e3b3c8e5bd37f5dfa0b76abdecc5081f13"}, + {file = "pillow-10.2.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9d189550615b4948f45252d7f005e53c2040cea1af5b60d6f79491a6e147eef7"}, + {file = "pillow-10.2.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:49d9ba1ed0ef3e061088cd1e7538a0759aab559e2e0a80a36f9fd9d8c0c21591"}, + {file = "pillow-10.2.0-cp39-cp39-win32.whl", hash = "sha256:babf5acfede515f176833ed6028754cbcd0d206f7f614ea3447d67c33be12516"}, + {file = "pillow-10.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:0304004f8067386b477d20a518b50f3fa658a28d44e4116970abfcd94fac34a8"}, + {file = "pillow-10.2.0-cp39-cp39-win_arm64.whl", hash = "sha256:0fb3e7fc88a14eacd303e90481ad983fd5b69c761e9e6ef94c983f91025da869"}, + {file = "pillow-10.2.0-pp310-pypy310_pp73-macosx_10_10_x86_64.whl", hash = "sha256:322209c642aabdd6207517e9739c704dc9f9db943015535783239022002f054a"}, + {file = "pillow-10.2.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3eedd52442c0a5ff4f887fab0c1c0bb164d8635b32c894bc1faf4c618dd89df2"}, + {file = "pillow-10.2.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cb28c753fd5eb3dd859b4ee95de66cc62af91bcff5db5f2571d32a520baf1f04"}, + {file = "pillow-10.2.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:33870dc4653c5017bf4c8873e5488d8f8d5f8935e2f1fb9a2208c47cdd66efd2"}, + {file = "pillow-10.2.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:3c31822339516fb3c82d03f30e22b1d038da87ef27b6a78c9549888f8ceda39a"}, + {file = "pillow-10.2.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a2b56ba36e05f973d450582fb015594aaa78834fefe8dfb8fcd79b93e64ba4c6"}, + {file = "pillow-10.2.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:d8e6aeb9201e655354b3ad049cb77d19813ad4ece0df1249d3c793de3774f8c7"}, + {file = "pillow-10.2.0-pp39-pypy39_pp73-macosx_10_10_x86_64.whl", hash = "sha256:2247178effb34a77c11c0e8ac355c7a741ceca0a732b27bf11e747bbc950722f"}, + {file = "pillow-10.2.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:15587643b9e5eb26c48e49a7b33659790d28f190fc514a322d55da2fb5c2950e"}, + {file = "pillow-10.2.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753cd8f2086b2b80180d9b3010dd4ed147efc167c90d3bf593fe2af21265e5a5"}, + {file = "pillow-10.2.0-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:7c8f97e8e7a9009bcacbe3766a36175056c12f9a44e6e6f2d5caad06dcfbf03b"}, + {file = "pillow-10.2.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:d1b35bcd6c5543b9cb547dee3150c93008f8dd0f1fef78fc0cd2b141c5baf58a"}, + {file = "pillow-10.2.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:fe4c15f6c9285dc54ce6553a3ce908ed37c8f3825b5a51a15c91442bb955b868"}, + {file = "pillow-10.2.0.tar.gz", hash = "sha256:e87f0b2c78157e12d7686b27d63c070fd65d994e8ddae6f328e0dcf4a0cd007e"}, +] + +[package.extras] +docs = ["furo", "olefile", "sphinx (>=2.4)", "sphinx-copybutton", "sphinx-inline-tabs", "sphinx-removed-in", "sphinxext-opengraph"] +fpx = ["olefile"] +mic = ["olefile"] +tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "packaging", "pyroma", "pytest", "pytest-cov", "pytest-timeout"] +typing = ["typing-extensions"] +xmp = ["defusedxml"] + [[package]] name = "pkgutil-resolve-name" version = "1.3.10" @@ -4598,4 +4717,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 = "576021600a335b2e80b5532cd4dee51b1f5867c89bfd48e0e86c9d364d31f677" +content-hash = "a3d9e3fce421b954333a5eecf680093c4f36919fd38c5691b10048748474adb3" diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/pyproject.toml b/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/pyproject.toml index e29d141428fa5..a5d5878ef3832 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/pyproject.toml +++ b/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/pyproject.toml @@ -24,13 +24,13 @@ description = "llama-index embeddings azure openai integration" license = "MIT" name = "llama-index-embeddings-azure-openai" readme = "README.md" -version = "0.1.2" +version = "0.1.3" [tool.poetry.dependencies] python = ">=3.8.1,<3.12" llama-index-core = "^0.10.1" llama-index-llms-azure-openai = "^0.1.1" -llama-index-llms-openai = "^0.1.1" +llama-index-embeddings-openai = "^0.1.3" [tool.poetry.group.dev.dependencies] ipython = "8.10.0" diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/base.py b/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/base.py index e83fe3f7bb385..a8a9ff04a5ab6 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/base.py +++ b/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/base.py @@ -211,12 +211,12 @@ def get_engine( mode: str, model: str, mode_model_dict: Dict[Tuple[OpenAIEmbeddingMode, str], OpenAIEmbeddingModeModel], -) -> OpenAIEmbeddingModeModel: +) -> str: """Get engine.""" key = (OpenAIEmbeddingMode(mode), OpenAIEmbeddingModelType(model)) if key not in mode_model_dict: raise ValueError(f"Invalid mode, model combination: {key}") - return mode_model_dict[key] + return mode_model_dict[key].value class OpenAIEmbedding(BaseEmbedding): @@ -275,8 +275,8 @@ class OpenAIEmbedding(BaseEmbedding): ), ) - _query_engine: OpenAIEmbeddingModeModel = PrivateAttr() - _text_engine: OpenAIEmbeddingModeModel = PrivateAttr() + _query_engine: str = PrivateAttr() + _text_engine: str = PrivateAttr() _client: Optional[OpenAI] = PrivateAttr() _aclient: Optional[AsyncOpenAI] = PrivateAttr() _http_client: Optional[httpx.Client] = PrivateAttr() diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-openai/pyproject.toml b/llama-index-integrations/embeddings/llama-index-embeddings-openai/pyproject.toml index d67c45c670430..38bfbe0362144 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-openai/pyproject.toml +++ b/llama-index-integrations/embeddings/llama-index-embeddings-openai/pyproject.toml @@ -24,7 +24,7 @@ description = "llama-index embeddings openai integration" license = "MIT" name = "llama-index-embeddings-openai" readme = "README.md" -version = "0.1.2" +version = "0.1.3" [tool.poetry.dependencies] python = ">=3.8.1,<3.12"