diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ffa502582604..53bb5f470b276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,95 @@ # ChangeLog +## [2024-12-17] + +### `llama-index-core` [0.12.6] + +- [bug fix] Ensure that StopEvent gets cleared from Context.\_in_progress["_done"] after a Workflow run (#17300) +- fix: add a timeout to langchain callback handler (#17296) +- tweak User vs tool in react prompts (#17273) +- refact: Refactor Document to be natively multimodal (#17204) +- fix: make ImageDocument derive from Document, backward compatible (#17259) +- fix: accept already base64-encoded data in ImageBlock (#17244) +- fix(metrics): fixed NDCG calculation and updated previous tests (#17236) +- fix: remove llama-index-legacy dependency in llama-index-core (#17231) +- Refined the default documentation generation for function tools (#17208) + +### `llama-index-embeddings-voyageai` [0.3.3] + +- add support for voyageai >=0.3.0 (#17120) +- Introducting VoyageAI's new multimodal embeddings model (#17261) +- VoyageAI multimodal embedding, correction (#17284) + +### `llama-index-experimental` [0.5.2] + +- Fixed import errors for experimental JSONalyzeQueryEngine (#17228) + +### `llama-index-grapg-stores-neo4j` [0.4.4] + +- Add cypher corrector and allow graph schema filtering (#17223) +- Add timeout config to neo4j graph (#17267) +- Add text and embedding type to neo4j enhanced schema (#17289) + +### `llama-index-llms-anthropic` [0.6.3] + +- add content blocks to anthropic (#17274) +- Do not send blank content to anthropic (#17278) +- Update anthropic type imports for v0.41.0 release (#17299) +- Fix Anthropic tokenizer protocol (fix by Devin) (#17201) + +### `llama-index-llms-bedrock` [0.3.3] + +- Add Amazon bedrock guardrails (#17281) + +### `llama-index-llms-bedrock-converse` [0.4.2] + +- Add Amazon bedrock guardrails (#17281) + +### `llama-index-llms-gemini` [0.4.1] + +- Gemini 2.0 support (#17249) + +### `llama-index-llms-mistralai` [0.3.1] + +- add tool call id/name to mistral chat messages (#17280) + +### `llama-index-llms-nvidia` [0.3.1] + +- Adding llama 3.3-70b as function-calling-capable (#17253) + +### `llama-index-llms-openai` [0.3.10] + +- fix openai message dicts for tool calls (#17254) + +### `llama-index-llms-text-generation-inference` [0.3.1] + +- Fix: TGI context window (#17252) + +### `llama-index-multi-modal-llms-anthropic` [0.3.1] + +- handle more response types in anthropic multi modal llms (#17302) + +### `llama-index-readers-confluence` [0.3.1] + +- Support Confluence cookies (#17276) + +### `llama-index-vector-stores-milvus` [0.4.0] + +- Parse "milvus_search_config" out of "vector_store_kwargs" (#17221) +- refactor and optimize milvus code (#17229) + +### `llama-index-vector-stores-pinecone` [0.4.2] + +- Handle empty retrieved Pinecone index values (#17242) + +### `llama-index-vector-stores-qdrant` [0.4.1] + +- feat: Add NOT filter condition to MetadataFilter and QdrantVectorStore (#17270) + +### `llama-index-vector-stores-weaviate` [1.3.0] + +- Add async support to weaviate vector store integration (#17220) + ## [2024-12-09] ### `llama-index-core` [0.12.5] @@ -14,6 +104,10 @@ - feat: integration on pinecone hosted rerankers (#17192) +### `llama-index-tools-scrapegraph` [0.1.0] + +- Add Scrapegraph tool integration (#17238) + ### `llama-index-vector-stores-postgres` [0.3.3] - Update pgvector dependency to version 0.3.6 (#17195) diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index 8ffa502582604..792f06c8a6367 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -1,5 +1,95 @@ # ChangeLog +## [2024-12-17] + +### `llama-index-core` [0.12.6] + +- [bug fix] Ensure that StopEvent gets cleared from Context._in_progress["_done"] after a Workflow run (#17300) +- fix: add a timeout to langchain callback handler (#17296) +- tweak User vs tool in react prompts (#17273) +- refact: Refactor Document to be natively multimodal (#17204) +- fix: make ImageDocument derive from Document, backward compatible (#17259) +- fix: accept already base64-encoded data in ImageBlock (#17244) +- fix(metrics): fixed NDCG calculation and updated previous tests (#17236) +- fix: remove llama-index-legacy dependency in llama-index-core (#17231) +- Refined the default documentation generation for function tools (#17208) + +### `llama-index-embeddings-voyageai` [0.3.3] + +- add support for voyageai >=0.3.0 (#17120) +- Introducting VoyageAI's new multimodal embeddings model (#17261) +- VoyageAI multimodal embedding, correction (#17284) + +### `llama-index-experimental` [0.5.2] + +- Fixed import errors for experimental JSONalyzeQueryEngine (#17228) + +### `llama-index-grapg-stores-neo4j` [0.4.4] + +- Add cypher corrector and allow graph schema filtering (#17223) +- Add timeout config to neo4j graph (#17267) +- Add text and embedding type to neo4j enhanced schema (#17289) + +### `llama-index-llms-anthropic` [0.6.3] + +- add content blocks to anthropic (#17274) +- Do not send blank content to anthropic (#17278) +- Update anthropic type imports for v0.41.0 release (#17299) +- Fix Anthropic tokenizer protocol (fix by Devin) (#17201) + +### `llama-index-llms-bedrock` [0.3.3] + +- Add Amazon bedrock guardrails (#17281) + +### `llama-index-llms-bedrock-converse` [0.4.2] + +- Add Amazon bedrock guardrails (#17281) + +### `llama-index-llms-gemini` [0.4.1] + +- Gemini 2.0 support (#17249) + +### `llama-index-llms-mistralai` [0.3.1] + +- add tool call id/name to mistral chat messages (#17280) + +### `llama-index-llms-nvidia` [0.3.1] + +- Adding llama 3.3-70b as function-calling-capable (#17253) + +### `llama-index-llms-openai` [0.3.10] + +- fix openai message dicts for tool calls (#17254) + +### `llama-index-llms-text-generation-inference` [0.3.1] + +- Fix: TGI context window (#17252) + +### `llama-index-multi-modal-llms-anthropic` [0.3.1] + +- handle more response types in anthropic multi modal llms (#17302) + +### `llama-index-readers-confluence` [0.3.1] + +- Support Confluence cookies (#17276) + +### `llama-index-vector-stores-milvus` [0.4.0] + +- Parse "milvus_search_config" out of "vector_store_kwargs" (#17221) +- refactor and optimize milvus code (#17229) + +### `llama-index-vector-stores-pinecone` [0.4.2] + +- Handle empty retrieved Pinecone index values (#17242) + +### `llama-index-vector-stores-qdrant` [0.4.1] + +- feat: Add NOT filter condition to MetadataFilter and QdrantVectorStore (#17270) + +### `llama-index-vector-stores-weaviate` [1.3.0] + +- Add async support to weaviate vector store integration (#17220) + ## [2024-12-09] ### `llama-index-core` [0.12.5] @@ -14,6 +104,10 @@ - feat: integration on pinecone hosted rerankers (#17192) +### `llama-index-tools-scrapegraph` [0.1.0] + +- Add Scrapegraph tool integration (#17238) + ### `llama-index-vector-stores-postgres` [0.3.3] - Update pgvector dependency to version 0.3.6 (#17195) diff --git a/docs/docs/api_reference/tools/scrapegraph.md b/docs/docs/api_reference/tools/scrapegraph.md new file mode 100644 index 0000000000000..8cca961a5502b --- /dev/null +++ b/docs/docs/api_reference/tools/scrapegraph.md @@ -0,0 +1,4 @@ +::: llama_index.tools.scrapegraph + options: + members: + - ScrapegraphToolSpec diff --git a/docs/docs/examples/llm/cerebras.ipynb b/docs/docs/examples/llm/cerebras.ipynb index 82bb1a21afa9e..2e9494a84e503 100644 --- a/docs/docs/examples/llm/cerebras.ipynb +++ b/docs/docs/examples/llm/cerebras.ipynb @@ -103,7 +103,7 @@ " \"Enter your Cerebras API key: \"\n", ")\n", "\n", - "llm = Cerebras(model=\"llama3.1-70b\", api_key=os.environ[\"CEREBRAS_API_KEY\"])" + "llm = Cerebras(model=\"llama-3.3-70b\", api_key=os.environ[\"CEREBRAS_API_KEY\"])" ] }, { diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index c34877e952aa2..01307c0862fbb 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -151,6 +151,7 @@ nav: - ./examples/cookbooks/contextual_retrieval.ipynb - ./examples/cookbooks/crewai_llamaindex.ipynb - ./examples/cookbooks/llama3_cookbook.ipynb + - ./examples/cookbooks/llama3_cookbook_gaudi.ipynb - ./examples/cookbooks/llama3_cookbook_groq.ipynb - ./examples/cookbooks/llama3_cookbook_ollama_replicate.ipynb - ./examples/cookbooks/mistralai.ipynb @@ -256,7 +257,6 @@ nav: - ./examples/embeddings/nomic.ipynb - ./examples/embeddings/nvidia.ipynb - ./examples/embeddings/oci_genai.ipynb - - ./examples/embeddings/octoai.ipynb - ./examples/embeddings/ollama_embedding.ipynb - ./examples/embeddings/openvino.ipynb - ./examples/embeddings/optimum_intel.ipynb @@ -312,6 +312,7 @@ nav: - ./examples/ingestion/document_management_pipeline.ipynb - ./examples/ingestion/ingestion_gdrive.ipynb - ./examples/ingestion/parallel_execution_ingestion_pipeline.ipynb + - ./examples/ingestion/redis_ingestion_pipeline.ipynb - LLMs: - ./examples/llm/ai21.ipynb - ./examples/llm/alephalpha.ipynb @@ -384,9 +385,7 @@ nav: - ./examples/llm/rungpt.ipynb - ./examples/llm/sagemaker_endpoint_llm.ipynb - ./examples/llm/sambanovasystems.ipynb - - ./examples/llm/solar.ipynb - ./examples/llm/together.ipynb - - ./examples/llm/unify.ipynb - ./examples/llm/upstage.ipynb - ./examples/llm/vertex.ipynb - ./examples/llm/vicuna.ipynb @@ -642,7 +641,6 @@ nav: - ./examples/vector_stores/LanternAutoRetriever.ipynb - ./examples/vector_stores/LanternIndexDemo.ipynb - ./examples/vector_stores/LindormDemo.ipynb - - ./examples/vector_stores/MetalIndexDemo.ipynb - ./examples/vector_stores/MilvusHybridIndexDemo.ipynb - ./examples/vector_stores/MilvusIndexDemo.ipynb - ./examples/vector_stores/MilvusOperatorFunctionDemo.ipynb @@ -1647,6 +1645,7 @@ nav: - ./api_reference/tools/requests.md - ./api_reference/tools/retriever.md - ./api_reference/tools/salesforce.md + - ./api_reference/tools/scrapegraph.md - ./api_reference/tools/shopify.md - ./api_reference/tools/slack.md - ./api_reference/tools/tavily_research.md @@ -2308,6 +2307,7 @@ plugins: - ../llama-index-integrations/llms/llama-index-llms-nebius - ../llama-index-integrations/postprocessor/llama-index-postprocessor-bedrock-rerank - ../llama-index-integrations/postprocessor/llama-index-postprocessor-pinecone-native-rerank + - ../llama-index-integrations/tools/llama-index-tools-scrapegraph - redirects: redirect_maps: ./api/llama_index.vector_stores.MongoDBAtlasVectorSearch.html: api_reference/storage/vector_store/mongodb.md diff --git a/llama-index-core/llama_index/core/__init__.py b/llama-index-core/llama_index/core/__init__.py index dbf98b1a2b8ef..d9b1df7e718e5 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.12.5" +__version__ = "0.12.6" import logging from logging import NullHandler diff --git a/llama-index-core/llama_index/core/langchain_helpers/streaming.py b/llama-index-core/llama_index/core/langchain_helpers/streaming.py index 45aedd34d0862..7b1f90c4ea6a7 100644 --- a/llama-index-core/llama_index/core/langchain_helpers/streaming.py +++ b/llama-index-core/llama_index/core/langchain_helpers/streaming.py @@ -1,3 +1,4 @@ +import time from queue import Queue from threading import Event from typing import Any, Generator, List, Optional @@ -35,10 +36,25 @@ def on_llm_error( ) -> None: self._done.set() - def get_response_gen(self) -> Generator: + def get_response_gen(self, timeout: float = 120.0) -> Generator: + """Get response generator with timeout. + + Args: + timeout (float): Maximum time in seconds to wait for the complete response. + Defaults to 120 seconds. + """ + start_time = time.time() while True: + if time.time() - start_time > timeout: + raise TimeoutError( + f"Response generation timed out after {timeout} seconds" + ) + if not self._token_queue.empty(): token = self._token_queue.get_nowait() yield token elif self._done.is_set(): break + else: + # Small sleep to prevent CPU spinning + time.sleep(0.01) diff --git a/llama-index-core/llama_index/core/workflow/workflow.py b/llama-index-core/llama_index/core/workflow/workflow.py index 89a151c69a821..ca2443f441370 100644 --- a/llama-index-core/llama_index/core/workflow/workflow.py +++ b/llama-index-core/llama_index/core/workflow/workflow.py @@ -247,6 +247,7 @@ async def _task( new_ev = await instrumented_step(**kwargs) break # exit the retrying loop except WorkflowDone: + await ctx.remove_from_in_progress(name=name, ev=ev) raise except Exception as e: if config.retry_policy is None: @@ -277,6 +278,7 @@ async def _task( None, run_task ) except WorkflowDone: + await ctx.remove_from_in_progress(name=name, ev=ev) raise except Exception as e: raise WorkflowRuntimeError( diff --git a/llama-index-core/pyproject.toml b/llama-index-core/pyproject.toml index 13cf7ef93b6fb..bea2c3679bc0c 100644 --- a/llama-index-core/pyproject.toml +++ b/llama-index-core/pyproject.toml @@ -46,7 +46,7 @@ name = "llama-index-core" packages = [{include = "llama_index"}] readme = "README.md" repository = "https://github.com/run-llama/llama_index" -version = "0.12.5" +version = "0.12.6" [tool.poetry.dependencies] SQLAlchemy = {extras = ["asyncio"], version = ">=1.4.49"} diff --git a/llama-index-core/tests/workflow/test_context.py b/llama-index-core/tests/workflow/test_context.py index fd4b3c6613114..06e4aa3568010 100644 --- a/llama-index-core/tests/workflow/test_context.py +++ b/llama-index-core/tests/workflow/test_context.py @@ -120,3 +120,13 @@ async def test_deprecated_params(ctx): DeprecationWarning, match="`make_private` is deprecated and will be ignored" ): await ctx.set("foo", 42, make_private=True) + + +@pytest.mark.asyncio() +async def test_empty_inprogress_when_workflow_done(workflow): + h = workflow.run() + _ = await h + + # there shouldn't be any in progress events + for inprogress_list in h.ctx._in_progress.values(): + assert len(inprogress_list) == 0 diff --git a/llama-index-core/tests/workflow/test_workflow.py b/llama-index-core/tests/workflow/test_workflow.py index 4c9be4cdf03f7..32cde7168682d 100644 --- a/llama-index-core/tests/workflow/test_workflow.py +++ b/llama-index-core/tests/workflow/test_workflow.py @@ -76,6 +76,9 @@ async def test_workflow_run_step(workflow): result = await handler assert handler.is_done() assert result == "Workflow completed" + # there shouldn't be any in progress events + for inprogress_list in handler.ctx._in_progress.values(): + assert len(inprogress_list) == 0 @pytest.mark.asyncio() diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/llama_index/embeddings/voyageai/base.py b/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/llama_index/embeddings/voyageai/base.py index 87c225e81bbb3..860ad1994e84f 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/llama_index/embeddings/voyageai/base.py +++ b/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/llama_index/embeddings/voyageai/base.py @@ -1,5 +1,6 @@ """Voyage embeddings file.""" import logging +import os from typing import Any, List, Optional, Union from llama_index.core.base.embeddings.base import Embedding @@ -8,7 +9,6 @@ import voyageai from llama_index.core.embeddings import MultiModalEmbedding -import base64 from io import BytesIO from pathlib import Path from llama_index.core.schema import ImageType @@ -83,36 +83,29 @@ def _validate_image_format(file_type: str) -> bool: """Validate image format.""" return file_type.lower() in SUPPORTED_IMAGE_FORMATS - def _text_to_content(self, input_str: str) -> dict: - return {"type": "text", "text": input_str} - - def _texts_to_content(self, input_strs: List[str]) -> List[dict]: + @classmethod + def _texts_to_content(cls, input_strs: List[str]) -> List[dict]: return [{"content": [{"type": "text", "text": x}]} for x in input_strs] - def _image_to_content(self, image_input: Union[str, Path, BytesIO]) -> dict: + def _image_to_content(self, image_input: Union[str, Path, BytesIO]) -> Image: """Convert an image to a base64 Data URL.""" if isinstance(image_input, (str, Path)): + image = Image.open(str(image_input)) # If it's a string or Path, assume it's a file path - content = {"type": "image_url", "image_url": image_input} + image_path = str(image_input) + file_extension = os.path.splitext(image_path)[1][1:].lower() elif isinstance(image_input, BytesIO): # If it's a BytesIO, use it directly image = Image.open(image_input) file_extension = image.format.lower() image_input.seek(0) # Reset the BytesIO stream to the beginning - image_data = image_input.read() - - if self._validate_image_format(file_extension): - enc_img = base64.b64encode(image_data).decode("utf-8") - content = { - "type": "image_base64", - "image_base64": f"data:image/{file_extension};base64,{enc_img}", - } - else: - raise ValueError(f"Unsupported image format: {file_extension}") else: raise ValueError("Unsupported input type. Must be a file path or BytesIO.") - return {"content": [content]} + if self._validate_image_format(file_extension): + return image + else: + raise ValueError(f"Unsupported image format: {file_extension}") def _embed_image( self, image_path: ImageType, input_type: Optional[str] = None @@ -125,7 +118,7 @@ def _embed_image( processed_image = self._image_to_content(image_path) return self._client.multimodal_embed( model=self.model_name, - inputs=[processed_image], + inputs=[[processed_image]], input_type=input_type, truncation=self.truncation, ).embeddings[0] @@ -142,7 +135,7 @@ async def _aembed_image( return ( await self._aclient.multimodal_embed( model=self.model_name, - inputs=[processed_image], + inputs=[[processed_image]], input_type=input_type, truncation=self.truncation, ) diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/pyproject.toml b/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/pyproject.toml index 4290b8063ff43..09b4b3cb06d8b 100644 --- a/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/pyproject.toml +++ b/llama-index-integrations/embeddings/llama-index-embeddings-voyageai/pyproject.toml @@ -27,7 +27,7 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-embeddings-voyageai" readme = "README.md" -version = "0.3.2" +version = "0.3.3" [tool.poetry.dependencies] python = ">=3.9,<4.0" diff --git a/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/neo4j_property_graph.py b/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/neo4j_property_graph.py index fdf47ab85cec0..1d9405cbc32aa 100644 --- a/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/neo4j_property_graph.py +++ b/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/llama_index/graph_stores/neo4j/neo4j_property_graph.py @@ -41,6 +41,7 @@ def remove_empty_values(input_dict): DISTINCT_VALUE_LIMIT = 10 CHUNK_SIZE = 1000 VECTOR_INDEX_NAME = "entity" +LONG_TEXT_THRESHOLD = 52 node_properties_query = """ CALL apoc.meta.data() @@ -281,6 +282,19 @@ def refresh_schema(self) -> None: ) enhanced_info = self.structured_query(enhanced_cypher)[0]["output"] for prop in node_props: + # Map to custom types + # Text + if prop["type"] == "STRING" and any( + len(value) >= LONG_TEXT_THRESHOLD + for value in enhanced_info[prop["property"]]["values"] + ): + enhanced_info[prop["property"]]["type"] = "TEXT" + # Embedding + if ( + prop["type"] == "LIST" + and enhanced_info[prop["property"]]["max_size"] > LIST_LIMIT + ): + enhanced_info[prop["property"]]["type"] = "EMBEDDING" if prop["property"] in enhanced_info: prop.update(enhanced_info[prop["property"]]) # Update rel info @@ -754,7 +768,7 @@ def _enhanced_schema_cypher( prop_type = prop["type"] if prop_type == "STRING": with_clauses.append( - f"collect(distinct substring(toString(coalesce(n.`{prop_name}`, '')), 0, 50)) " + f"collect(distinct substring(toString(coalesce(n.`{prop_name}`, '')), 0, {LONG_TEXT_THRESHOLD})) " f"AS `{prop_name}_values`" ) return_clauses.append( @@ -781,11 +795,14 @@ def _enhanced_schema_cypher( elif prop_type == "LIST": with_clauses.append( f"min(size(coalesce(n.`{prop_name}`, []))) AS `{prop_name}_size_min`, " - f"max(size(coalesce(n.`{prop_name}`, []))) AS `{prop_name}_size_max`" + f"max(size(coalesce(n.`{prop_name}`, []))) AS `{prop_name}_size_max`, " + # Get first 3 sub-elements of the first element as sample values + f"collect(n.`{prop_name}`)[0][..3] AS `{prop_name}_values`" ) return_clauses.append( f"min_size: `{prop_name}_size_min`, " - f"max_size: `{prop_name}_size_max`" + f"max_size: `{prop_name}_size_max`, " + f"values:`{prop_name}_values`" ) elif prop_type in ["BOOLEAN", "POINT", "DURATION"]: continue @@ -821,7 +838,7 @@ def _enhanced_schema_cypher( ) else: with_clauses.append( - f"collect(distinct substring(n.`{prop_name}`, 0, 50)) " + f"collect(distinct substring(n.`{prop_name}`, 0, {LONG_TEXT_THRESHOLD})) " f"AS `{prop_name}_values`" ) return_clauses.append(f"values: `{prop_name}_values`") @@ -857,11 +874,14 @@ def _enhanced_schema_cypher( elif prop_type == "LIST": with_clauses.append( f"min(size(coalesce(n.`{prop_name}`, []))) AS `{prop_name}_size_min`, " - f"max(size(coalesce(n.`{prop_name}`, []))) AS `{prop_name}_size_max`" + f"max(size(coalesce(n.`{prop_name}`, []))) AS `{prop_name}_size_max`, " + # Get first 3 sub-elements of the first element as sample values + f"collect(n.`{prop_name}`)[0][..3] AS `{prop_name}_values`" ) return_clauses.append( f"min_size: `{prop_name}_size_min`, " - f"max_size: `{prop_name}_size_max`" + f"max_size: `{prop_name}_size_max`, " + f"values:`{prop_name}_values`" ) elif prop_type in ["BOOLEAN", "POINT", "DURATION"]: continue @@ -934,7 +954,12 @@ def filter_func(x: str) -> bool: if prop["values"] else "" ) - + elif prop["type"] == "TEXT": + example = ( + f'Example: "{clean_string_values(prop["values"][0])}"' + if prop["values"] + else "" + ) elif prop["type"] in [ "INTEGER", "FLOAT", @@ -952,9 +977,17 @@ def filter_func(x: str) -> bool: ) elif prop["type"] == "LIST": # Skip embeddings - if not prop.get("min_size") or prop["min_size"] > LIST_LIMIT: - continue - example = f'Min Size: {prop["min_size"]}, Max Size: {prop["max_size"]}' + # if not prop.get("min_size") or prop["min_size"] > LIST_LIMIT: + # continue + example = ( + f'Min Size: {prop.get("min_size", "N/A")}, ' + f'Max Size: {prop.get("max_size", "N/A")}, ' + + ( + f'Example: [{prop["values"][0]}]' + if prop.get("values") and len(prop["values"]) > 0 + else "" + ) + ) formatted_node_props.append( f" - `{prop['property']}`: {prop['type']} {example}" ) diff --git a/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/pyproject.toml b/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/pyproject.toml index cfc3cb033771c..c8c6f9ee8f62f 100644 --- a/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/pyproject.toml +++ b/llama-index-integrations/graph_stores/llama-index-graph-stores-neo4j/pyproject.toml @@ -28,7 +28,7 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-graph-stores-neo4j" readme = "README.md" -version = "0.4.3" +version = "0.4.4" [tool.poetry.dependencies] python = ">=3.9,<4.0" diff --git a/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/utils.py b/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/utils.py index dd1e906c43243..c41eb10d36857 100644 --- a/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/utils.py +++ b/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/utils.py @@ -12,13 +12,14 @@ TextBlock, ) -from anthropic.types import MessageParam, TextBlockParam, ImageBlockParam +from anthropic.types import ( + MessageParam, + TextBlockParam, + ImageBlockParam, + CacheControlEphemeralParam, +) from anthropic.types.tool_result_block_param import ToolResultBlockParam from anthropic.types.tool_use_block_param import ToolUseBlockParam -from anthropic.types.beta.prompt_caching import ( - PromptCachingBetaTextBlockParam, - PromptCachingBetaCacheControlEphemeralParam, -) HUMAN_PREFIX = "\n\nHuman:" ASSISTANT_PREFIX = "\n\nAssistant:" @@ -156,12 +157,10 @@ def messages_to_anthropic_messages( for block in message.blocks: if isinstance(block, TextBlock): content_ = ( - PromptCachingBetaTextBlockParam( + TextBlockParam( text=block.text, type="text", - cache_control=PromptCachingBetaCacheControlEphemeralParam( - type="ephemeral" - ), + cache_control=CacheControlEphemeralParam(type="ephemeral"), ) if "cache_control" in message.additional_kwargs else TextBlockParam(text=block.text, type="text") diff --git a/llama-index-integrations/llms/llama-index-llms-anthropic/pyproject.toml b/llama-index-integrations/llms/llama-index-llms-anthropic/pyproject.toml index 9756e0e500716..9cd67a3377b62 100644 --- a/llama-index-integrations/llms/llama-index-llms-anthropic/pyproject.toml +++ b/llama-index-integrations/llms/llama-index-llms-anthropic/pyproject.toml @@ -27,11 +27,11 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-llms-anthropic" readme = "README.md" -version = "0.6.1" +version = "0.6.3" [tool.poetry.dependencies] python = ">=3.9,<4.0" -anthropic = {extras = ["bedrock", "vertex"], version = ">=0.39.0"} +anthropic = {extras = ["bedrock", "vertex"], version = ">=0.41.0"} llama-index-core = "^0.12.5" [tool.poetry.group.dev.dependencies] diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/base.py b/llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/base.py index 706772fec648a..230585eac35a2 100644 --- a/llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/base.py +++ b/llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/base.py @@ -114,6 +114,21 @@ class BedrockConverse(FunctionCallingLLM): default=60.0, description="The timeout for the Bedrock API request in seconds. It will be used for both connect and read timeouts.", ) + guardrail_identifier: Optional[str] = ( + Field( + description="The unique identifier of the guardrail that you want to use. If you don’t provide a value, no guardrail is applied to the invocation." + ), + ) + guardrail_version: Optional[str] = ( + Field( + description="The version number for the guardrail. The value can also be DRAFT" + ), + ) + trace: Optional[str] = ( + Field( + description="Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace." + ), + ) additional_kwargs: Dict[str, Any] = Field( default_factory=dict, description="Additional kwargs for the bedrock invokeModel request.", @@ -145,6 +160,9 @@ def __init__( completion_to_prompt: Optional[Callable[[str], str]] = None, pydantic_program_mode: PydanticProgramMode = PydanticProgramMode.DEFAULT, output_parser: Optional[BaseOutputParser] = None, + guardrail_identifier: Optional[str] = None, + guardrail_version: Optional[str] = None, + trace: Optional[str] = None, ) -> None: additional_kwargs = additional_kwargs or {} callback_manager = callback_manager or CallbackManager([]) @@ -178,6 +196,9 @@ def __init__( region_name=region_name, botocore_session=botocore_session, botocore_config=botocore_config, + guardrail_identifier=guardrail_identifier, + guardrail_version=guardrail_version, + trace=trace, ) self._config = None @@ -292,6 +313,9 @@ def chat(self, messages: Sequence[ChatMessage], **kwargs: Any) -> ChatResponse: system_prompt=self.system_prompt, max_retries=self.max_retries, stream=False, + guardrail_identifier=self.guardrail_identifier, + guardrail_version=self.guardrail_version, + trace=self.trace, **all_kwargs, ) @@ -336,6 +360,9 @@ def stream_chat( system_prompt=self.system_prompt, max_retries=self.max_retries, stream=True, + guardrail_identifier=self.guardrail_identifier, + guardrail_version=self.guardrail_version, + trace=self.trace, **all_kwargs, ) @@ -416,6 +443,9 @@ async def achat( system_prompt=self.system_prompt, max_retries=self.max_retries, stream=False, + guardrail_identifier=self.guardrail_identifier, + guardrail_version=self.guardrail_version, + trace=self.trace, **all_kwargs, ) @@ -461,6 +491,9 @@ async def astream_chat( system_prompt=self.system_prompt, max_retries=self.max_retries, stream=True, + guardrail_identifier=self.guardrail_identifier, + guardrail_version=self.guardrail_version, + trace=self.trace, **all_kwargs, ) diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/utils.py b/llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/utils.py index 7d795dfc5c5e8..2ad32f78003d9 100644 --- a/llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/utils.py +++ b/llama-index-integrations/llms/llama-index-llms-bedrock-converse/llama_index/llms/bedrock_converse/utils.py @@ -307,6 +307,9 @@ def converse_with_retry( max_tokens: int = 1000, temperature: float = 0.1, stream: bool = False, + guardrail_identifier: Optional[str] = None, + guardrail_version: Optional[str] = None, + trace: Optional[str] = None, **kwargs: Any, ) -> Any: """Use tenacity to retry the completion call.""" @@ -323,8 +326,24 @@ def converse_with_retry( converse_kwargs["system"] = [{"text": system_prompt}] if tool_config := kwargs.get("tools"): converse_kwargs["toolConfig"] = tool_config + if guardrail_identifier and guardrail_version: + converse_kwargs["guardrailConfig"] = {} + converse_kwargs["guardrailConfig"]["guardrailIdentifier"] = guardrail_identifier + converse_kwargs["guardrailConfig"]["guardrailVersion"] = guardrail_version + if trace: + converse_kwargs["guardrailConfig"]["trace"] = trace converse_kwargs = join_two_dicts( - converse_kwargs, {k: v for k, v in kwargs.items() if k != "tools"} + converse_kwargs, + { + k: v + for k, v in kwargs.items() + if ( + k != "tools" + or k != "guardrail_identifier" + or k != "guardrail_version" + or k != "trace" + ) + }, ) @retry_decorator @@ -346,6 +365,9 @@ async def converse_with_retry_async( max_tokens: int = 1000, temperature: float = 0.1, stream: bool = False, + guardrail_identifier: Optional[str] = None, + guardrail_version: Optional[str] = None, + trace: Optional[str] = None, **kwargs: Any, ) -> Any: """Use tenacity to retry the completion call.""" @@ -362,8 +384,24 @@ async def converse_with_retry_async( converse_kwargs["system"] = [{"text": system_prompt}] if tool_config := kwargs.get("tools"): converse_kwargs["toolConfig"] = tool_config + if guardrail_identifier and guardrail_version: + converse_kwargs["guardrailConfig"] = {} + converse_kwargs["guardrailConfig"]["guardrailIdentifier"] = guardrail_identifier + converse_kwargs["guardrailConfig"]["guardrailVersion"] = guardrail_version + if trace: + converse_kwargs["guardrailConfig"]["trace"] = trace converse_kwargs = join_two_dicts( - converse_kwargs, {k: v for k, v in kwargs.items() if k != "tools"} + converse_kwargs, + { + k: v + for k, v in kwargs.items() + if ( + k != "tools" + or k != "guardrail_identifier" + or k != "guardrail_version" + or k != "trace" + ) + }, ) ## NOTE: Returning the generator directly from converse_stream doesn't work diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock-converse/pyproject.toml b/llama-index-integrations/llms/llama-index-llms-bedrock-converse/pyproject.toml index 52777b9f27786..ab4844f92d8f2 100644 --- a/llama-index-integrations/llms/llama-index-llms-bedrock-converse/pyproject.toml +++ b/llama-index-integrations/llms/llama-index-llms-bedrock-converse/pyproject.toml @@ -27,7 +27,7 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-llms-bedrock-converse" readme = "README.md" -version = "0.4.1" +version = "0.4.2" [tool.poetry.dependencies] python = ">=3.9,<4.0" diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock-converse/tests/test_llms_bedrock_converse.py b/llama-index-integrations/llms/llama-index-llms-bedrock-converse/tests/test_llms_bedrock_converse.py index b47266ee5236d..c1ecd85cc080d 100644 --- a/llama-index-integrations/llms/llama-index-llms-bedrock-converse/tests/test_llms_bedrock_converse.py +++ b/llama-index-integrations/llms/llama-index-llms-bedrock-converse/tests/test_llms_bedrock_converse.py @@ -14,6 +14,9 @@ EXP_MAX_TOKENS = 100 EXP_TEMPERATURE = 0.7 EXP_MODEL = "anthropic.claude-v2" +EXP_GUARDRAIL_ID = "IDENTIFIER" +EXP_GUARDRAIL_VERSION = "DRAFT" +EXP_GUARDRAIL_TRACE = "ENABLED" # Reused chat message and prompt messages = [ChatMessage(role=MessageRole.USER, content="Test")] @@ -88,6 +91,9 @@ def bedrock_converse(mock_boto3_session, mock_aioboto3_session): model=EXP_MODEL, max_tokens=EXP_MAX_TOKENS, temperature=EXP_TEMPERATURE, + guardrail_identifier=EXP_GUARDRAIL_ID, + guardrail_version=EXP_GUARDRAIL_VERSION, + trace=EXP_GUARDRAIL_TRACE, callback_manager=CallbackManager(), ) 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 55732f8598bdb..746e27a8ee1f1 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 @@ -94,6 +94,21 @@ class Bedrock(LLM): default=60.0, description="The timeout for the Bedrock API request in seconds. It will be used for both connect and read timeouts.", ) + guardrail_identifier: Optional[str] = ( + Field( + description="The unique identifier of the guardrail that you want to use. If you don’t provide a value, no guardrail is applied to the invocation." + ), + ) + guardrail_version: Optional[str] = ( + Field( + description="The version number for the guardrail. The value can also be DRAFT" + ), + ) + trace: Optional[str] = ( + Field( + description="Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace." + ), + ) additional_kwargs: Dict[str, Any] = Field( default_factory=dict, description="Additional kwargs for the bedrock invokeModel request.", @@ -125,6 +140,9 @@ def __init__( completion_to_prompt: Optional[Callable[[str], str]] = None, pydantic_program_mode: PydanticProgramMode = PydanticProgramMode.DEFAULT, output_parser: Optional[BaseOutputParser] = None, + guardrail_identifier: Optional[str] = None, + guardrail_version: Optional[str] = None, + trace: Optional[str] = None, **kwargs: Any, ) -> None: if context_size is None and model not in BEDROCK_FOUNDATION_LLMS: @@ -187,6 +205,9 @@ def __init__( completion_to_prompt=completion_to_prompt, pydantic_program_mode=pydantic_program_mode, output_parser=output_parser, + guardrail_identifier=guardrail_identifier, + guardrail_version=guardrail_version, + trace=trace, ) self._provider = get_provider(model) self.messages_to_prompt = ( @@ -257,6 +278,9 @@ def complete( model=self.model, request_body=request_body_str, max_retries=self.max_retries, + guardrail_identifier=self.guardrail_identifier, + guardrail_version=self.guardrail_version, + trace=self.trace, **all_kwargs, ) response_body = response["body"].read() @@ -287,6 +311,9 @@ def stream_complete( request_body=request_body_str, max_retries=self.max_retries, stream=True, + guardrail_identifier=self.guardrail_identifier, + guardrail_version=self.guardrail_version, + trace=self.trace, **all_kwargs, ) response_body = response["body"] 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 d9b90ed8b899f..f9e80e6e35624 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 @@ -299,6 +299,9 @@ def completion_with_retry( request_body: str, max_retries: int, stream: bool = False, + guardrail_identifier: Optional[str] = None, + guardrail_version: Optional[str] = None, + trace: Optional[str] = None, **kwargs: Any, ) -> Any: """Use tenacity to retry the completion call.""" @@ -307,9 +310,29 @@ def completion_with_retry( @retry_decorator def _completion_with_retry(**kwargs: Any) -> Any: if stream: - return client.invoke_model_with_response_stream( - modelId=model, body=request_body - ) - return client.invoke_model(modelId=model, body=request_body) + if guardrail_identifier is None or guardrail_version is None: + return client.invoke_model_with_response_stream( + modelId=model, + body=request_body, + ) + else: + return client.invoke_model_with_response_stream( + modelId=model, + body=request_body, + guardrailIdentifier=guardrail_identifier, + guardrailVersion=guardrail_version, + trace=trace, + ) + else: + if guardrail_identifier is None or guardrail_version is None: + return client.invoke_model(modelId=model, body=request_body) + else: + return client.invoke_model( + modelId=model, + body=request_body, + guardrailIdentifier=guardrail_identifier, + guardrailVersion=guardrail_version, + trace=trace, + ) return _completion_with_retry(**kwargs) diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock/pyproject.toml b/llama-index-integrations/llms/llama-index-llms-bedrock/pyproject.toml index 20f28280db1f3..a20a29619defe 100644 --- a/llama-index-integrations/llms/llama-index-llms-bedrock/pyproject.toml +++ b/llama-index-integrations/llms/llama-index-llms-bedrock/pyproject.toml @@ -27,11 +27,11 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-llms-bedrock" readme = "README.md" -version = "0.3.1" +version = "0.3.3" [tool.poetry.dependencies] python = ">=3.9,<4.0" -llama-index-llms-anthropic = "^0.5.0" +llama-index-llms-anthropic = "^0.6.3" boto3 = "^1.34.26" llama-index-core = "^0.12.0" diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_bedrock.py b/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_bedrock.py index 0f59f66bba493..e10dd0c93a161 100644 --- a/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_bedrock.py +++ b/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_bedrock.py @@ -147,6 +147,9 @@ def test_model_basic( profile_name=None, region_name="us-east-1", aws_access_key_id="test", + guardrail_identifier="test", + guardrail_version="test", + trace="ENABLED", ) bedrock_stubber = Stubber(llm._client) @@ -155,13 +158,25 @@ def test_model_basic( bedrock_stubber.add_response( "invoke_model", get_invoke_model_response(response_body), - {"body": complete_request, "modelId": model}, + { + "body": complete_request, + "modelId": model, + "guardrailIdentifier": "test", + "guardrailVersion": "test", + "trace": "ENABLED", + }, ) # response for llm.chat() bedrock_stubber.add_response( "invoke_model", get_invoke_model_response(response_body), - {"body": chat_request, "modelId": model}, + { + "body": chat_request, + "modelId": model, + "guardrailIdentifier": "test", + "guardrailVersion": "test", + "trace": "ENABLED", + }, ) bedrock_stubber.activate() diff --git a/llama-index-integrations/llms/llama-index-llms-cerebras/README.md b/llama-index-integrations/llms/llama-index-llms-cerebras/README.md index a8c2aa40d7efa..865256730b2ed 100644 --- a/llama-index-integrations/llms/llama-index-llms-cerebras/README.md +++ b/llama-index-integrations/llms/llama-index-llms-cerebras/README.md @@ -44,7 +44,7 @@ import os from llama_index.core.llms import ChatMessage from llama_index.llms.cerebras import Cerebras -llm = Cerebras(model="llama3.1-70b", api_key=os.environ["CEREBRAS_API_KEY"]) +llm = Cerebras(model="llama-3.3-70b", api_key=os.environ["CEREBRAS_API_KEY"]) messages = [ ChatMessage( @@ -63,7 +63,7 @@ import os from llama_index.llms.cerebras import Cerebras -llm = Cerebras(model="llama3.1-70b", api_key=os.environ["CEREBRAS_API_KEY"]) +llm = Cerebras(model="llama-3.3-70b", api_key=os.environ["CEREBRAS_API_KEY"]) response = llm.stream_complete("What is Generative AI?") for r in response: diff --git a/llama-index-integrations/llms/llama-index-llms-cerebras/llama_index/llms/cerebras/base.py b/llama-index-integrations/llms/llama-index-llms-cerebras/llama_index/llms/cerebras/base.py index 8e818cd04aa98..383624920cab6 100644 --- a/llama-index-integrations/llms/llama-index-llms-cerebras/llama_index/llms/cerebras/base.py +++ b/llama-index-integrations/llms/llama-index-llms-cerebras/llama_index/llms/cerebras/base.py @@ -15,7 +15,7 @@ class Cerebras(OpenAILike): from llama_index.llms.cerebras import Cerebras # Set up the Cerebras class with the required model and API key - llm = Cerebras(model="llama3.1-70b", api_key="your_api_key") + llm = Cerebras(model="llama-3.3-70b", api_key="your_api_key") # Call the complete method with a query response = llm.complete("Why is fast inference important?") diff --git a/llama-index-integrations/llms/llama-index-llms-cerebras/pyproject.toml b/llama-index-integrations/llms/llama-index-llms-cerebras/pyproject.toml index bb7df08dc378d..abcc406fab75c 100644 --- a/llama-index-integrations/llms/llama-index-llms-cerebras/pyproject.toml +++ b/llama-index-integrations/llms/llama-index-llms-cerebras/pyproject.toml @@ -30,7 +30,7 @@ license = "MIT" name = "llama-index-llms-cerebras" packages = [{include = "llama_index/"}] readme = "README.md" -version = "0.2.1" +version = "0.2.2" [tool.poetry.dependencies] python = ">=3.9,<4.0" 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 f549a29aeb42f..9a28550036d83 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 @@ -34,6 +34,8 @@ DEFAULT_OPENAI_API_VERSION = "" O1_MODELS: Dict[str, int] = { + "o1": 200000, + "o1-2024-12-17": 200000, "o1-preview": 128000, "o1-preview-2024-09-12": 128000, "o1-mini": 128000, @@ -304,7 +306,7 @@ def to_openai_message_dict( # TODO: O1 models do not support system prompts if model is not None and model in O1_MODELS: if message_dict["role"] == "system": - message_dict["role"] = "user" + message_dict["role"] = "developer" # NOTE: openai messages have additional arguments: # - function messages have `name` diff --git a/llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml b/llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml index 4d23c3daf4e20..6bf3eeeaa001f 100644 --- a/llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml +++ b/llama-index-integrations/llms/llama-index-llms-openai/pyproject.toml @@ -29,11 +29,11 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-llms-openai" readme = "README.md" -version = "0.3.10" +version = "0.3.11" [tool.poetry.dependencies] python = ">=3.9,<4.0" -openai = "^1.57.1" +openai = "^1.58.1" llama-index-core = "^0.12.4" [tool.poetry.group.dev.dependencies] diff --git a/llama-index-integrations/llms/llama-index-llms-portkey/pyproject.toml b/llama-index-integrations/llms/llama-index-llms-portkey/pyproject.toml index 0d29002982a3e..fc36a0bb50a1f 100644 --- a/llama-index-integrations/llms/llama-index-llms-portkey/pyproject.toml +++ b/llama-index-integrations/llms/llama-index-llms-portkey/pyproject.toml @@ -31,7 +31,7 @@ version = "0.3.0" [tool.poetry.dependencies] python = ">=3.9,<4.0" -llama-index-llms-anthropic = "^0.5.0" +llama-index-llms-anthropic = "^0.6.3" portkey-ai = "^1.1.4" portkey = "^0.1.2" llama-index-llms-openai = "^0.3.0" diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/llama_index/multi_modal_llms/anthropic/base.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/llama_index/multi_modal_llms/anthropic/base.py index a6e2af79dffee..cef442286e7e3 100644 --- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/llama_index/multi_modal_llms/anthropic/base.py +++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/llama_index/multi_modal_llms/anthropic/base.py @@ -194,6 +194,7 @@ def _get_response_token_counts(self, raw_response: Any) -> dict: def _complete( self, prompt: str, image_documents: Sequence[ImageNode], **kwargs: Any ) -> CompletionResponse: + """Complete the prompt with image support and optional tool calls.""" all_kwargs = self._get_model_kwargs(**kwargs) message_dict = self._get_multi_modal_chat_messages( prompt=prompt, role=MessageRole.USER, image_documents=image_documents @@ -206,8 +207,17 @@ def _complete( **all_kwargs, ) + # Handle both tool and text responses + content = response.content[0] + if hasattr(content, "input"): + # Tool response - convert to string for compatibility + text = str(content.input) + else: + # Standard text response + text = content.text + return CompletionResponse( - text=response.content[0].text, + text=text, raw=response, additional_kwargs=self._get_response_token_counts(response), ) diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/pyproject.toml b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/pyproject.toml index 6e8ee833785e4..b4f35187eafd5 100644 --- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/pyproject.toml +++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/pyproject.toml @@ -27,7 +27,7 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-multi-modal-llms-anthropic" readme = "README.md" -version = "0.3.0" +version = "0.3.1" [tool.poetry.dependencies] python = ">=3.9,<4.0" diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/tests/test_multi-modal-llms_anthropic.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/tests/test_multi-modal-llms_anthropic.py index 6645471d7e52f..4d812a8f1618f 100644 --- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/tests/test_multi-modal-llms_anthropic.py +++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-anthropic/tests/test_multi-modal-llms_anthropic.py @@ -1,5 +1,7 @@ +from unittest.mock import Mock, patch from llama_index.core.multi_modal_llms.base import MultiModalLLM from llama_index.multi_modal_llms.anthropic import AnthropicMultiModal +from llama_index.core.base.llms.types import CompletionResponse def test_embedding_class(): @@ -10,3 +12,45 @@ def test_embedding_class(): def test_init(): m = AnthropicMultiModal(max_tokens=400) assert m.max_tokens == 400 + + +def test_tool_response(): + """Test handling of tool responses.""" + llm = AnthropicMultiModal(max_tokens=400) + + # Create mock response with tool input + mock_content = Mock() + mock_content.input = { + "booking_number": "123", + "carrier": "Test Carrier", + "total_amount": 1000.0, + } + mock_response = Mock() + mock_response.content = [mock_content] + + with patch.object(llm._client.messages, "create", return_value=mock_response): + response = llm.complete( + prompt="test prompt", + image_documents=[], + tools=[ + { + "name": "tms_order_payload", + "description": "Test tool", + "input_schema": { + "type": "object", + "properties": { + "booking_number": {"type": "string"}, + "carrier": {"type": "string"}, + "total_amount": {"type": "number"}, + }, + }, + } + ], + tool_choice={"type": "tool", "name": "tms_order_payload"}, + ) + + assert isinstance(response, CompletionResponse) + assert isinstance(response.text, str) + assert "booking_number" in response.text + assert "123" in response.text + assert response.raw == mock_response diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/utils.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/utils.py index eb1a6a815984b..b664f33ad57d2 100644 --- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/utils.py +++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/utils.py @@ -18,6 +18,8 @@ "gpt-4o-2024-08-06": 128000, "gpt-4o-mini": 128000, "gpt-4o-mini-2024-07-18": 128000, + "o1": 200000, + "o1-2024-12-17": 200000, } diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/pyproject.toml b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/pyproject.toml index 15a1ee9d52ce8..3fa3678ed1736 100644 --- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/pyproject.toml +++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/pyproject.toml @@ -27,7 +27,7 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-multi-modal-llms-openai" readme = "README.md" -version = "0.4.0" +version = "0.4.1" [tool.poetry.dependencies] python = ">=3.9,<4.0" diff --git a/llama-index-integrations/readers/llama-index-readers-confluence/README.md b/llama-index-integrations/readers/llama-index-readers-confluence/README.md index 618780ea07e1b..25e8143733e4b 100644 --- a/llama-index-integrations/readers/llama-index-readers-confluence/README.md +++ b/llama-index-integrations/readers/llama-index-readers-confluence/README.md @@ -18,9 +18,10 @@ The following order is used for checking authentication credentials: 1. `oauth2` 2. `api_token` -3. `user_name` and `password` -4. Environment variable `CONFLUENCE_API_TOKEN` -5. Environment variable `CONFLUENCE_USERNAME` and `CONFLUENCE_PASSWORD` +3. `cookies` +4. `user_name` and `password` +5. Environment variable `CONFLUENCE_API_TOKEN` +6. Environment variable `CONFLUENCE_USERNAME` and `CONFLUENCE_PASSWORD` For more on authenticating using OAuth 2.0, checkout: diff --git a/llama-index-integrations/readers/llama-index-readers-confluence/llama_index/readers/confluence/base.py b/llama-index-integrations/readers/llama-index-readers-confluence/llama_index/readers/confluence/base.py index 973da486ea703..52d9faa371bd2 100644 --- a/llama-index-integrations/readers/llama-index-readers-confluence/llama_index/readers/confluence/base.py +++ b/llama-index-integrations/readers/llama-index-readers-confluence/llama_index/readers/confluence/base.py @@ -31,6 +31,7 @@ class ConfluenceReader(BaseReader): base_url (str): 'base_url' for confluence cloud instance, this is suffixed with '/wiki', eg 'https://yoursite.atlassian.com/wiki' cloud (bool): connecting to Confluence Cloud or self-hosted instance api_token (str): Confluence API token, see https://confluence.atlassian.com/cloud/api-tokens-938839638.html + cookies (dict): Confluence cookies, see https://atlassian-python-api.readthedocs.io/index.html user_name (str): Confluence username, used for basic auth. Must be used with `password`. password (str): Confluence password, used for basic auth. Must be used with `user_name`. client_args (dict): Additional keyword arguments to pass directly to the Atlassian Confluence client constructor, for example `{'backoff_and_retry': True}`. @@ -43,6 +44,7 @@ def __init__( oauth2: Optional[Dict] = None, cloud: bool = True, api_token: Optional[str] = None, + cookies: Optional[dict] = None, user_name: Optional[str] = None, password: Optional[str] = None, client_args: Optional[dict] = None, @@ -71,6 +73,10 @@ def __init__( self.confluence = Confluence( url=base_url, token=api_token, cloud=cloud, **client_args ) + elif cookies is not None: + self.confluence = Confluence( + url=base_url, cookies=cookies, cloud=cloud, **client_args + ) elif user_name is not None and password is not None: self.confluence = Confluence( url=base_url, diff --git a/llama-index-integrations/readers/llama-index-readers-confluence/pyproject.toml b/llama-index-integrations/readers/llama-index-readers-confluence/pyproject.toml index bcf7d636eb14f..8c5af3c40c32e 100644 --- a/llama-index-integrations/readers/llama-index-readers-confluence/pyproject.toml +++ b/llama-index-integrations/readers/llama-index-readers-confluence/pyproject.toml @@ -28,7 +28,7 @@ license = "MIT" maintainers = ["zywilliamli"] name = "llama-index-readers-confluence" readme = "README.md" -version = "0.3.0" +version = "0.3.1" [tool.poetry.dependencies] python = ">=3.9,<4.0" diff --git a/llama-index-integrations/readers/llama-index-readers-confluence/tests/test_readers_confluence.py b/llama-index-integrations/readers/llama-index-readers-confluence/tests/test_readers_confluence.py index 8040a37515970..2aec51af1705c 100644 --- a/llama-index-integrations/readers/llama-index-readers-confluence/tests/test_readers_confluence.py +++ b/llama-index-integrations/readers/llama-index-readers-confluence/tests/test_readers_confluence.py @@ -33,6 +33,14 @@ def test_confluence_reader_with_api_token(): assert reader.confluence is not None +def test_confluence_reader_with_cookies(): + reader = ConfluenceReader( + base_url="https://example.atlassian.net/wiki", + cookies={"key": "value"}, + ) + assert reader.confluence is not None + + def test_confluence_reader_with_client_args(): with patch("atlassian.Confluence") as MockConstructor: reader = ConfluenceReader( diff --git a/llama-index-integrations/tools/llama-index-tools-google/README.md b/llama-index-integrations/tools/llama-index-tools-google/README.md index abc7799fc1b68..a721848f11a03 100644 --- a/llama-index-integrations/tools/llama-index-tools-google/README.md +++ b/llama-index-integrations/tools/llama-index-tools-google/README.md @@ -1 +1,39 @@ # LlamaIndex Tools Integration: Google + +### Provides a set of tools to interact with Google services. + +- you need to enable each of the below services in your google cloud console, under a same API key for a service, in + order to use them. + +### Quick Start: + +```python +# pip install llama-index-tools-google +from llama_index.tools.google import GmailToolSpec +from llama_index.tools.google import GoogleCalendarToolSpec +from llama_index.tools.google import GoogleSearchToolSpec +``` + +#### [custom search service](https://developers.google.com/custom-search/v1/overview) + +```python +google_spec = GoogleSearchToolSpec(key="your-key", engine="your-engine") +``` + +- `key` collected from your service console +- `engine` which represents the search engine to use, you can create a custom search + engine [here](https://cse.google.com/cse/all) + +#### [calendar read, create]() + +- requires OAuth 2.0 credentials, you can create them [here](https://console.developers.google.com/apis/credentials) +- store oAuth`credentials.json` in the same directory as the runnable agent. +- you will need to manually approve the Oath every time this tool is invoked + +#### [gmail read, create]() + +- same as calendar + +### known defects + +- the calendar tool create is not able to generate an event if the agent is not able to infer the timezome diff --git a/llama-index-integrations/tools/llama-index-tools-scrapegraph/README.md b/llama-index-integrations/tools/llama-index-tools-scrapegraph/README.md index a0c74cddec642..da8537d14a456 100644 --- a/llama-index-integrations/tools/llama-index-tools-scrapegraph/README.md +++ b/llama-index-integrations/tools/llama-index-tools-scrapegraph/README.md @@ -1,6 +1,6 @@ # LlamaIndex Tool - Scrapegraph -This tool integrates [Scrapegraph](https://scrapegraph.ai) with LlamaIndex, providing intelligent web scraping capabilities with structured data extraction. +This tool integrates [Scrapegraph](https://scrapegraphai.com) with LlamaIndex, providing intelligent web scraping capabilities with structured data extraction. ## Installation diff --git a/llama-index-integrations/tools/llama-index-tools-tavily-research/README.md b/llama-index-integrations/tools/llama-index-tools-tavily-research/README.md index 129ea614e17ee..3521395d5ec3a 100644 --- a/llama-index-integrations/tools/llama-index-tools-tavily-research/README.md +++ b/llama-index-integrations/tools/llama-index-tools-tavily-research/README.md @@ -20,12 +20,16 @@ Here's an example usage of the TavilyToolSpec. ```python from llama_index.tools.tavily_research import TavilyToolSpec -from llama_index.agent.openai import OpenAIAgent +from llama_index.core.agent import FunctionCallingAgent +from llama_index.llms.openai import OpenAI tavily_tool = TavilyToolSpec( api_key="your-key", ) -agent = OpenAIAgent.from_tools(tavily_tool.to_tool_list()) +agent = FunctionCallingAgent.from_tools( + tavily_tool.to_tool_list(), + llm=OpenAI(model="gpt-4o"), +) agent.chat("What happened in the latest Burning Man festival?") ``` diff --git a/llama-index-integrations/tools/llama-index-tools-tavily-research/examples/tavily.ipynb b/llama-index-integrations/tools/llama-index-tools-tavily-research/examples/tavily.ipynb index d42ecb0286f8f..3b932a994ecc0 100644 --- a/llama-index-integrations/tools/llama-index-tools-tavily-research/examples/tavily.ipynb +++ b/llama-index-integrations/tools/llama-index-tools-tavily-research/examples/tavily.ipynb @@ -23,19 +23,7 @@ "metadata": {}, "outputs": [], "source": [ - "!pip install llama-index llama-hub tavily-python" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ce6c6e5d-f61e-461e-8e8d-99d27fb3fcaf", - "metadata": {}, - "outputs": [], - "source": [ - "# Set up OpenAI\n", - "import openai\n", - "from llama_index.agent import OpenAIAgent" + "%pip install llama-index-tools-tavily-research llama-index" ] }, { @@ -45,7 +33,11 @@ "metadata": {}, "outputs": [], "source": [ - "openai.api_key = \"sk-api-key\"" + "# set your openai key, if using openai\n", + "import os\n", + "\n", + "os.environ[\"OPENAI_API_KEY\"] = \"sk-...\"\n", + "os.environ[\"TAVILY_API_KEY\"] = \"...\"" ] }, { @@ -125,8 +117,12 @@ "metadata": {}, "outputs": [], "source": [ - "agent = OpenAIAgent.from_tools(\n", + "from llama_index.core.agent import FunctionCallingAgent\n", + "from llama_index.llms.openai import OpenAI\n", + "\n", + "agent = FunctionCallingAgent.from_tools(\n", " tavily_tool_list,\n", + " llm=OpenAI(model=\"gpt-4o\"),\n", ")" ] }, @@ -176,9 +172,9 @@ ], "metadata": { "kernelspec": { - "display_name": "llama_hub", + "display_name": "llama-index-caVs7DDe-py3.10", "language": "python", - "name": "llama_hub" + "name": "python3" }, "language_info": { "codemirror_mode": { diff --git a/llama-index-integrations/vector_stores/llama-index-vector-stores-nile/pyproject.toml b/llama-index-integrations/vector_stores/llama-index-vector-stores-nile/pyproject.toml index 7d03f26100db1..c97d58c8c0dd5 100644 --- a/llama-index-integrations/vector_stores/llama-index-vector-stores-nile/pyproject.toml +++ b/llama-index-integrations/vector_stores/llama-index-vector-stores-nile/pyproject.toml @@ -27,11 +27,11 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-vector-stores-nile" readme = "README.md" -version = "0.2.0" +version = "0.2.1" [tool.poetry.dependencies] python = ">=3.9,<4.0" -llama-index-core = "^0.12.0" +llama-index-core = "^0.12.6" psycopg = "^3.2" [tool.poetry.group.dev.dependencies] diff --git a/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/pyproject.toml b/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/pyproject.toml index 3b3c1d9922893..86ffd5af4aa9d 100644 --- a/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/pyproject.toml +++ b/llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/pyproject.toml @@ -27,14 +27,14 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-vector-stores-postgres" readme = "README.md" -version = "0.4.0" +version = "0.4.1" [tool.poetry.dependencies] python = ">=3.9,<4.0" pgvector = ">=0.3.6,<1.0.0" psycopg2-binary = ">=2.9.9,<3.0.0" asyncpg = ">=0.29.0,<1.0.0" -llama-index-core = "^0.12.0" +llama-index-core = "^0.12.6" [tool.poetry.dependencies.sqlalchemy] extras = ["asyncio"] diff --git a/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/pyproject.toml b/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/pyproject.toml index edbef55571db3..3a1c012c8f8fb 100644 --- a/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/pyproject.toml +++ b/llama-index-integrations/vector_stores/llama-index-vector-stores-qdrant/pyproject.toml @@ -27,13 +27,13 @@ exclude = ["**/BUILD"] license = "MIT" name = "llama-index-vector-stores-qdrant" readme = "README.md" -version = "0.4.0" +version = "0.4.1" [tool.poetry.dependencies] python = ">=3.9,<3.13" qdrant-client = ">=1.7.1" grpcio = "^1.60.0" -llama-index-core = "^0.12.0" +llama-index-core = "^0.12.6" [tool.poetry.extras] fastembed = ["fastembed"] diff --git a/poetry.lock b/poetry.lock index 03a9ab55b6ef3..3ba1832f8d7ae 100644 --- a/poetry.lock +++ b/poetry.lock @@ -111,13 +111,13 @@ speedups = ["Brotli", "aiodns (>=3.2.0)", "brotlicffi"] [[package]] name = "aiosignal" -version = "1.3.1" +version = "1.3.2" description = "aiosignal: a list of registered asynchronous callbacks" optional = false -python-versions = ">=3.7" +python-versions = ">=3.9" files = [ - {file = "aiosignal-1.3.1-py3-none-any.whl", hash = "sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17"}, - {file = "aiosignal-1.3.1.tar.gz", hash = "sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc"}, + {file = "aiosignal-1.3.2-py2.py3-none-any.whl", hash = "sha256:45cde58e409a301715980c2b01d0c28bdde3770d8290b5eb2173759d9acb31a5"}, + {file = "aiosignal-1.3.2.tar.gz", hash = "sha256:a8c255c66fafb1e499c9351d0bf32ff2d8a0321595ebac3b93713656d2436f54"}, ] [package.dependencies] @@ -214,19 +214,19 @@ files = [ [[package]] name = "attrs" -version = "24.2.0" +version = "24.3.0" description = "Classes Without Boilerplate" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "attrs-24.2.0-py3-none-any.whl", hash = "sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2"}, - {file = "attrs-24.2.0.tar.gz", hash = "sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346"}, + {file = "attrs-24.3.0-py3-none-any.whl", hash = "sha256:ac96cd038792094f438ad1f6ff80837353805ac950cd2aa0e0625ef19850c308"}, + {file = "attrs-24.3.0.tar.gz", hash = "sha256:8f5c07333d543103541ba7be0e2ce16eeee8130cb0b3f9238ab904ce1e85baff"}, ] [package.extras] benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"] cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"] tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] @@ -333,13 +333,13 @@ css = ["tinycss2 (>=1.1.0,<1.5)"] [[package]] name = "certifi" -version = "2024.8.30" +version = "2024.12.14" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, - {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, + {file = "certifi-2024.12.14-py3-none-any.whl", hash = "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56"}, + {file = "certifi-2024.12.14.tar.gz", hash = "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db"}, ] [[package]] @@ -674,37 +674,37 @@ typing-inspect = ">=0.4.0,<1" [[package]] name = "debugpy" -version = "1.8.9" +version = "1.8.11" description = "An implementation of the Debug Adapter Protocol for Python" optional = false python-versions = ">=3.8" files = [ - {file = "debugpy-1.8.9-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:cfe1e6c6ad7178265f74981edf1154ffce97b69005212fbc90ca22ddfe3d017e"}, - {file = "debugpy-1.8.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ada7fb65102a4d2c9ab62e8908e9e9f12aed9d76ef44880367bc9308ebe49a0f"}, - {file = "debugpy-1.8.9-cp310-cp310-win32.whl", hash = "sha256:c36856343cbaa448171cba62a721531e10e7ffb0abff838004701454149bc037"}, - {file = "debugpy-1.8.9-cp310-cp310-win_amd64.whl", hash = "sha256:17c5e0297678442511cf00a745c9709e928ea4ca263d764e90d233208889a19e"}, - {file = "debugpy-1.8.9-cp311-cp311-macosx_14_0_universal2.whl", hash = "sha256:b74a49753e21e33e7cf030883a92fa607bddc4ede1aa4145172debc637780040"}, - {file = "debugpy-1.8.9-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:62d22dacdb0e296966d7d74a7141aaab4bec123fa43d1a35ddcb39bf9fd29d70"}, - {file = "debugpy-1.8.9-cp311-cp311-win32.whl", hash = "sha256:8138efff315cd09b8dcd14226a21afda4ca582284bf4215126d87342bba1cc66"}, - {file = "debugpy-1.8.9-cp311-cp311-win_amd64.whl", hash = "sha256:ff54ef77ad9f5c425398efb150239f6fe8e20c53ae2f68367eba7ece1e96226d"}, - {file = "debugpy-1.8.9-cp312-cp312-macosx_14_0_universal2.whl", hash = "sha256:957363d9a7a6612a37458d9a15e72d03a635047f946e5fceee74b50d52a9c8e2"}, - {file = "debugpy-1.8.9-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e565fc54b680292b418bb809f1386f17081d1346dca9a871bf69a8ac4071afe"}, - {file = "debugpy-1.8.9-cp312-cp312-win32.whl", hash = "sha256:3e59842d6c4569c65ceb3751075ff8d7e6a6ada209ceca6308c9bde932bcef11"}, - {file = "debugpy-1.8.9-cp312-cp312-win_amd64.whl", hash = "sha256:66eeae42f3137eb428ea3a86d4a55f28da9bd5a4a3d369ba95ecc3a92c1bba53"}, - {file = "debugpy-1.8.9-cp313-cp313-macosx_14_0_universal2.whl", hash = "sha256:957ecffff80d47cafa9b6545de9e016ae8c9547c98a538ee96ab5947115fb3dd"}, - {file = "debugpy-1.8.9-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1efbb3ff61487e2c16b3e033bc8595aea578222c08aaf3c4bf0f93fadbd662ee"}, - {file = "debugpy-1.8.9-cp313-cp313-win32.whl", hash = "sha256:7c4d65d03bee875bcb211c76c1d8f10f600c305dbd734beaed4077e902606fee"}, - {file = "debugpy-1.8.9-cp313-cp313-win_amd64.whl", hash = "sha256:e46b420dc1bea64e5bbedd678148be512442bc589b0111bd799367cde051e71a"}, - {file = "debugpy-1.8.9-cp38-cp38-macosx_14_0_x86_64.whl", hash = "sha256:472a3994999fe6c0756945ffa359e9e7e2d690fb55d251639d07208dbc37caea"}, - {file = "debugpy-1.8.9-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:365e556a4772d7d0d151d7eb0e77ec4db03bcd95f26b67b15742b88cacff88e9"}, - {file = "debugpy-1.8.9-cp38-cp38-win32.whl", hash = "sha256:54a7e6d3014c408eb37b0b06021366ee985f1539e12fe49ca2ee0d392d9ceca5"}, - {file = "debugpy-1.8.9-cp38-cp38-win_amd64.whl", hash = "sha256:8e99c0b1cc7bf86d83fb95d5ccdc4ad0586d4432d489d1f54e4055bcc795f693"}, - {file = "debugpy-1.8.9-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:7e8b079323a56f719977fde9d8115590cb5e7a1cba2fcee0986ef8817116e7c1"}, - {file = "debugpy-1.8.9-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6953b335b804a41f16a192fa2e7851bdcfd92173cbb2f9f777bb934f49baab65"}, - {file = "debugpy-1.8.9-cp39-cp39-win32.whl", hash = "sha256:7e646e62d4602bb8956db88b1e72fe63172148c1e25c041e03b103a25f36673c"}, - {file = "debugpy-1.8.9-cp39-cp39-win_amd64.whl", hash = "sha256:3d9755e77a2d680ce3d2c5394a444cf42be4a592caaf246dbfbdd100ffcf7ae5"}, - {file = "debugpy-1.8.9-py2.py3-none-any.whl", hash = "sha256:cc37a6c9987ad743d9c3a14fa1b1a14b7e4e6041f9dd0c8abf8895fe7a97b899"}, - {file = "debugpy-1.8.9.zip", hash = "sha256:1339e14c7d980407248f09824d1b25ff5c5616651689f1e0f0e51bdead3ea13e"}, + {file = "debugpy-1.8.11-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:2b26fefc4e31ff85593d68b9022e35e8925714a10ab4858fb1b577a8a48cb8cd"}, + {file = "debugpy-1.8.11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61bc8b3b265e6949855300e84dc93d02d7a3a637f2aec6d382afd4ceb9120c9f"}, + {file = "debugpy-1.8.11-cp310-cp310-win32.whl", hash = "sha256:c928bbf47f65288574b78518449edaa46c82572d340e2750889bbf8cd92f3737"}, + {file = "debugpy-1.8.11-cp310-cp310-win_amd64.whl", hash = "sha256:8da1db4ca4f22583e834dcabdc7832e56fe16275253ee53ba66627b86e304da1"}, + {file = "debugpy-1.8.11-cp311-cp311-macosx_14_0_universal2.whl", hash = "sha256:85de8474ad53ad546ff1c7c7c89230db215b9b8a02754d41cb5a76f70d0be296"}, + {file = "debugpy-1.8.11-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ffc382e4afa4aee367bf413f55ed17bd91b191dcaf979890af239dda435f2a1"}, + {file = "debugpy-1.8.11-cp311-cp311-win32.whl", hash = "sha256:40499a9979c55f72f4eb2fc38695419546b62594f8af194b879d2a18439c97a9"}, + {file = "debugpy-1.8.11-cp311-cp311-win_amd64.whl", hash = "sha256:987bce16e86efa86f747d5151c54e91b3c1e36acc03ce1ddb50f9d09d16ded0e"}, + {file = "debugpy-1.8.11-cp312-cp312-macosx_14_0_universal2.whl", hash = "sha256:84e511a7545d11683d32cdb8f809ef63fc17ea2a00455cc62d0a4dbb4ed1c308"}, + {file = "debugpy-1.8.11-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce291a5aca4985d82875d6779f61375e959208cdf09fcec40001e65fb0a54768"}, + {file = "debugpy-1.8.11-cp312-cp312-win32.whl", hash = "sha256:28e45b3f827d3bf2592f3cf7ae63282e859f3259db44ed2b129093ca0ac7940b"}, + {file = "debugpy-1.8.11-cp312-cp312-win_amd64.whl", hash = "sha256:44b1b8e6253bceada11f714acf4309ffb98bfa9ac55e4fce14f9e5d4484287a1"}, + {file = "debugpy-1.8.11-cp313-cp313-macosx_14_0_universal2.whl", hash = "sha256:8988f7163e4381b0da7696f37eec7aca19deb02e500245df68a7159739bbd0d3"}, + {file = "debugpy-1.8.11-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c1f6a173d1140e557347419767d2b14ac1c9cd847e0b4c5444c7f3144697e4e"}, + {file = "debugpy-1.8.11-cp313-cp313-win32.whl", hash = "sha256:bb3b15e25891f38da3ca0740271e63ab9db61f41d4d8541745cfc1824252cb28"}, + {file = "debugpy-1.8.11-cp313-cp313-win_amd64.whl", hash = "sha256:d8768edcbeb34da9e11bcb8b5c2e0958d25218df7a6e56adf415ef262cd7b6d1"}, + {file = "debugpy-1.8.11-cp38-cp38-macosx_14_0_x86_64.whl", hash = "sha256:ad7efe588c8f5cf940f40c3de0cd683cc5b76819446abaa50dc0829a30c094db"}, + {file = "debugpy-1.8.11-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:189058d03a40103a57144752652b3ab08ff02b7595d0ce1f651b9acc3a3a35a0"}, + {file = "debugpy-1.8.11-cp38-cp38-win32.whl", hash = "sha256:32db46ba45849daed7ccf3f2e26f7a386867b077f39b2a974bb5c4c2c3b0a280"}, + {file = "debugpy-1.8.11-cp38-cp38-win_amd64.whl", hash = "sha256:116bf8342062246ca749013df4f6ea106f23bc159305843491f64672a55af2e5"}, + {file = "debugpy-1.8.11-cp39-cp39-macosx_14_0_x86_64.whl", hash = "sha256:654130ca6ad5de73d978057eaf9e582244ff72d4574b3e106fb8d3d2a0d32458"}, + {file = "debugpy-1.8.11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:23dc34c5e03b0212fa3c49a874df2b8b1b8fda95160bd79c01eb3ab51ea8d851"}, + {file = "debugpy-1.8.11-cp39-cp39-win32.whl", hash = "sha256:52d8a3166c9f2815bfae05f386114b0b2d274456980d41f320299a8d9a5615a7"}, + {file = "debugpy-1.8.11-cp39-cp39-win_amd64.whl", hash = "sha256:52c3cf9ecda273a19cc092961ee34eb9ba8687d67ba34cc7b79a521c1c64c4c0"}, + {file = "debugpy-1.8.11-py2.py3-none-any.whl", hash = "sha256:0e22f846f4211383e6a416d04b4c13ed174d24cc5d43f5fd52e7821d0ebc8920"}, + {file = "debugpy-1.8.11.tar.gz", hash = "sha256:6ad2688b69235c43b020e04fecccdf6a96c8943ca9c2fb340b8adc103c655e57"}, ] [[package]] @@ -1559,13 +1559,13 @@ files = [ [[package]] name = "jupytext" -version = "1.16.4" +version = "1.16.6" description = "Jupyter notebooks as Markdown documents, Julia, Python or R scripts" optional = false python-versions = ">=3.8" files = [ - {file = "jupytext-1.16.4-py3-none-any.whl", hash = "sha256:76989d2690e65667ea6fb411d8056abe7cd0437c07bd774660b83d62acf9490a"}, - {file = "jupytext-1.16.4.tar.gz", hash = "sha256:28e33f46f2ce7a41fb9d677a4a2c95327285579b64ca104437c4b9eb1e4174e9"}, + {file = "jupytext-1.16.6-py3-none-any.whl", hash = "sha256:900132031f73fee15a1c9ebd862e05eb5f51e1ad6ab3a2c6fdd97ce2f9c913b4"}, + {file = "jupytext-1.16.6.tar.gz", hash = "sha256:dbd03f9263c34b737003f388fc069e9030834fb7136879c4c32c32473557baa0"}, ] [package.dependencies] @@ -1577,11 +1577,11 @@ pyyaml = "*" tomli = {version = "*", markers = "python_version < \"3.11\""} [package.extras] -dev = ["autopep8", "black", "flake8", "gitpython", "ipykernel", "isort", "jupyter-fs (>=1.0)", "jupyter-server (!=2.11)", "nbconvert", "pre-commit", "pytest", "pytest-cov (>=2.6.1)", "pytest-randomly", "pytest-xdist", "sphinx-gallery (<0.8)"] +dev = ["autopep8", "black", "flake8", "gitpython", "ipykernel", "isort", "jupyter-fs (>=1.0)", "jupyter-server (!=2.11)", "nbconvert", "pre-commit", "pytest", "pytest-cov (>=2.6.1)", "pytest-randomly", "pytest-xdist", "sphinx (<8)", "sphinx-gallery (<0.8)"] docs = ["myst-parser", "sphinx", "sphinx-copybutton", "sphinx-rtd-theme"] test = ["pytest", "pytest-randomly", "pytest-xdist"] test-cov = ["ipykernel", "jupyter-server (!=2.11)", "nbconvert", "pytest", "pytest-cov (>=2.6.1)", "pytest-randomly", "pytest-xdist"] -test-external = ["autopep8", "black", "flake8", "gitpython", "ipykernel", "isort", "jupyter-fs (>=1.0)", "jupyter-server (!=2.11)", "nbconvert", "pre-commit", "pytest", "pytest-randomly", "pytest-xdist", "sphinx-gallery (<0.8)"] +test-external = ["autopep8", "black", "flake8", "gitpython", "ipykernel", "isort", "jupyter-fs (>=1.0)", "jupyter-server (!=2.11)", "nbconvert", "pre-commit", "pytest", "pytest-randomly", "pytest-xdist", "sphinx (<8)", "sphinx-gallery (<0.8)"] test-functional = ["pytest", "pytest-randomly", "pytest-xdist"] test-integration = ["ipykernel", "jupyter-server (!=2.11)", "nbconvert", "pytest", "pytest-randomly", "pytest-xdist"] test-ui = ["calysto-bash"] @@ -1681,13 +1681,13 @@ llama-index-llms-openai = ">=0.3.0,<0.4.0" [[package]] name = "llama-index-core" -version = "0.12.5" +version = "0.12.6" description = "Interface between LLMs and your data" optional = false python-versions = "<4.0,>=3.9" files = [ - {file = "llama_index_core-0.12.5-py3-none-any.whl", hash = "sha256:1fe6dd39b2dc5a945b4702d780a2f5962a553e187524a255429461dc92a664db"}, - {file = "llama_index_core-0.12.5.tar.gz", hash = "sha256:1d967323891920579fad3d6497587c137894df3f76718a3ec134f9201f2f4fc0"}, + {file = "llama_index_core-0.12.6-py3-none-any.whl", hash = "sha256:31d72b61c9f582bb879bf110e09a97b0106acdee155ce92cbbeed4df74ce0b8c"}, + {file = "llama_index_core-0.12.6.tar.gz", hash = "sha256:fb380db6472d1d5e25297676b4e82a7644890fcc4d264ab10ac12490ebf359d4"}, ] [package.dependencies] @@ -1747,13 +1747,13 @@ llama-index-core = ">=0.12.0,<0.13.0" [[package]] name = "llama-index-llms-openai" -version = "0.3.4" +version = "0.3.10" description = "llama-index llms openai integration" optional = false python-versions = "<4.0,>=3.9" files = [ - {file = "llama_index_llms_openai-0.3.4-py3-none-any.whl", hash = "sha256:48fa34ce53330829bc4bd99a3da7137c0d4739a1598fe4029c0ea6cfbc10fda4"}, - {file = "llama_index_llms_openai-0.3.4.tar.gz", hash = "sha256:e0fd6faf43e4bcaf99ebbff1633eb6a51c9727698605118d81f0bf7881098a00"}, + {file = "llama_index_llms_openai-0.3.10-py3-none-any.whl", hash = "sha256:ceb344f4a1424970096652135d9c2663a50fa53eb6d24d146c7f989d8c098e2e"}, + {file = "llama_index_llms_openai-0.3.10.tar.gz", hash = "sha256:fda3345aa4ba41b25d92817ee8a5699931e79c7c879243f172d6e0e6cbc5c5b3"}, ] [package.dependencies] @@ -2166,13 +2166,13 @@ pygments = ">2.12.0" [[package]] name = "mkdocs-material" -version = "9.5.48" +version = "9.5.49" description = "Documentation that simply works" optional = false python-versions = ">=3.8" files = [ - {file = "mkdocs_material-9.5.48-py3-none-any.whl", hash = "sha256:b695c998f4b939ce748adbc0d3bff73fa886a670ece948cf27818fa115dc16f8"}, - {file = "mkdocs_material-9.5.48.tar.gz", hash = "sha256:a582531e8b34f4c7ed38c29d5c44763053832cf2a32f7409567e0c74749a47db"}, + {file = "mkdocs_material-9.5.49-py3-none-any.whl", hash = "sha256:c3c2d8176b18198435d3a3e119011922f3e11424074645c24019c2dcf08a360e"}, + {file = "mkdocs_material-9.5.49.tar.gz", hash = "sha256:3671bb282b4f53a1c72e08adbe04d2481a98f85fed392530051f80ff94a9621d"}, ] [package.dependencies] @@ -2627,13 +2627,13 @@ files = [ [[package]] name = "openai" -version = "1.57.2" +version = "1.58.1" description = "The official Python library for the openai API" optional = false python-versions = ">=3.8" files = [ - {file = "openai-1.57.2-py3-none-any.whl", hash = "sha256:f7326283c156fdee875746e7e54d36959fb198eadc683952ee05e3302fbd638d"}, - {file = "openai-1.57.2.tar.gz", hash = "sha256:5f49fd0f38e9f2131cda7deb45dafdd1aee4f52a637e190ce0ecf40147ce8cee"}, + {file = "openai-1.58.1-py3-none-any.whl", hash = "sha256:e2910b1170a6b7f88ef491ac3a42c387f08bd3db533411f7ee391d166571d63c"}, + {file = "openai-1.58.1.tar.gz", hash = "sha256:f5a035fd01e141fc743f4b0e02c41ca49be8fab0866d3b67f5f29b4f4d3c0973"}, ] [package.dependencies] @@ -2648,6 +2648,7 @@ typing-extensions = ">=4.11,<5" [package.extras] datalib = ["numpy (>=1)", "pandas (>=1.2.3)", "pandas-stubs (>=1.1.0.11)"] +realtime = ["websockets (>=13,<15)"] [[package]] name = "packaging" @@ -3363,20 +3364,20 @@ dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments [[package]] name = "pytest-asyncio" -version = "0.24.0" +version = "0.25.0" description = "Pytest support for asyncio" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "pytest_asyncio-0.24.0-py3-none-any.whl", hash = "sha256:a811296ed596b69bf0b6f3dc40f83bcaf341b155a269052d82efa2b25ac7037b"}, - {file = "pytest_asyncio-0.24.0.tar.gz", hash = "sha256:d081d828e576d85f875399194281e92bf8a68d60d72d1a2faf2feddb6c46b276"}, + {file = "pytest_asyncio-0.25.0-py3-none-any.whl", hash = "sha256:db5432d18eac6b7e28b46dcd9b69921b55c3b1086e85febfe04e70b18d9e81b3"}, + {file = "pytest_asyncio-0.25.0.tar.gz", hash = "sha256:8c0610303c9e0442a5db8604505fc0f545456ba1528824842b37b4a626cbf609"}, ] [package.dependencies] pytest = ">=8.2,<9" [package.extras] -docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] +docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1)"] testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] [[package]] @@ -4110,7 +4111,6 @@ files = [ {file = "tiktoken-0.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d8c2d0e5ba6453a290b86cd65fc51fedf247e1ba170191715b049dac1f628005"}, {file = "tiktoken-0.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d622d8011e6d6f239297efa42a2657043aaed06c4f68833550cac9e9bc723ef1"}, {file = "tiktoken-0.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2efaf6199717b4485031b4d6edb94075e4d79177a172f38dd934d911b588d54a"}, - {file = "tiktoken-0.8.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5637e425ce1fc49cf716d88df3092048359a4b3bbb7da762840426e937ada06d"}, {file = "tiktoken-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fb0e352d1dbe15aba082883058b3cce9e48d33101bdaac1eccf66424feb5b47"}, {file = "tiktoken-0.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:56edfefe896c8f10aba372ab5706b9e3558e78db39dd497c940b47bf228bc419"}, {file = "tiktoken-0.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:326624128590def898775b722ccc327e90b073714227175ea8febbc920ac0a99"}, @@ -4827,4 +4827,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "f2d124721dcc72672b852b8ddff07b00f876df27758c64205e5d9ccd87ccd484" +content-hash = "ea0986450834a66f9deca7907e09a071322ab7f608cdea83c5d8af9ad78bd55f" diff --git a/pyproject.toml b/pyproject.toml index f39e3e8fbe085..27aff3fec993a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ name = "llama-index" packages = [{from = "_llama-index", include = "llama_index"}] readme = "README.md" repository = "https://github.com/run-llama/llama_index" -version = "0.12.5" +version = "0.12.6" [tool.poetry.dependencies] python = ">=3.9,<4.0" @@ -57,7 +57,7 @@ llama-index-agent-openai = "^0.4.0" llama-index-readers-file = "^0.4.0" llama-index-readers-llama-parse = ">=0.4.0" llama-index-indices-managed-llama-cloud = ">=0.4.0" -llama-index-core = "^0.12.5" +llama-index-core = "^0.12.6" llama-index-multi-modal-llms-openai = "^0.4.0" llama-index-cli = "^0.4.0" nltk = ">3.8.1" # avoids a CVE, temp until next release, should be in llama-index-core