Skip to content
Snippets Groups Projects
Unverified Commit baf973fb authored by Logan's avatar Logan Committed by GitHub
Browse files

version bumps [v0.10.7] (#10981)

parent 68639a67
No related branches found
No related tags found
No related merge requests found
"""Init file of LlamaIndex.""" """Init file of LlamaIndex."""
__version__ = "0.10.6" __version__ = "0.10.7"
import logging import logging
from logging import NullHandler from logging import NullHandler
......
...@@ -42,7 +42,7 @@ name = "llama-index-core" ...@@ -42,7 +42,7 @@ name = "llama-index-core"
packages = [{include = "llama_index"}] packages = [{include = "llama_index"}]
readme = "README.md" readme = "README.md"
repository = "https://github.com/run-llama/llama_index" repository = "https://github.com/run-llama/llama_index"
version = "0.10.6.post1" version = "0.10.7"
[tool.poetry.dependencies] [tool.poetry.dependencies]
SQLAlchemy = {extras = ["asyncio"], version = ">=1.4.49"} SQLAlchemy = {extras = ["asyncio"], version = ">=1.4.49"}
......
...@@ -24,7 +24,7 @@ description = "llama-index embeddings clip integration" ...@@ -24,7 +24,7 @@ description = "llama-index embeddings clip integration"
license = "MIT" license = "MIT"
name = "llama-index-embeddings-clip" name = "llama-index-embeddings-clip"
readme = "README.md" readme = "README.md"
version = "0.1.2" version = "0.1.3"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.8.1,<3.12" python = ">=3.8.1,<3.12"
......
...@@ -176,7 +176,7 @@ class BaseGithubClient(Protocol): ...@@ -176,7 +176,7 @@ class BaseGithubClient(Protocol):
owner: str, owner: str,
repo: str, repo: str,
file_sha: str, file_sha: str,
) -> GitBlobResponseModel: ) -> Optional[GitBlobResponseModel]:
... ...
async def get_commit( async def get_commit(
...@@ -405,7 +405,7 @@ class GithubClient: ...@@ -405,7 +405,7 @@ class GithubClient:
repo: str, repo: str,
file_sha: str, file_sha: str,
timeout: Optional[int] = 5, timeout: Optional[int] = 5,
) -> GitBlobResponseModel: ) -> Optional[GitBlobResponseModel]:
""" """
Get information about a blob. (Github API endpoint: getBlob). Get information about a blob. (Github API endpoint: getBlob).
...@@ -421,18 +421,22 @@ class GithubClient: ...@@ -421,18 +421,22 @@ class GithubClient:
Examples: Examples:
>>> blob_info = client.get_blob("owner", "repo", "file_sha") >>> blob_info = client.get_blob("owner", "repo", "file_sha")
""" """
return GitBlobResponseModel.from_json( try:
( return GitBlobResponseModel.from_json(
await self.request( (
"getBlob", await self.request(
"GET", "getBlob",
owner=owner, "GET",
repo=repo, owner=owner,
file_sha=file_sha, repo=repo,
timeout=timeout, file_sha=file_sha,
) timeout=timeout,
).text )
) ).text
)
except KeyError:
print(f"Failed to get blob for {owner}/{repo}/{file_sha}")
return None
async def get_commit( async def get_commit(
self, self,
...@@ -487,6 +491,6 @@ if __name__ == "__main__": ...@@ -487,6 +491,6 @@ if __name__ == "__main__":
blob_response = await client.get_blob( blob_response = await client.get_blob(
owner="ahmetkca", repo="CommitAI", file_sha=obj.sha owner="ahmetkca", repo="CommitAI", file_sha=obj.sha
) )
print(blob_response.content) print(blob_response.content if blob_response else "None")
asyncio.run(main()) asyncio.run(main())
...@@ -8,7 +8,7 @@ import asyncio ...@@ -8,7 +8,7 @@ import asyncio
import os import os
import time import time
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from typing import List, Tuple from typing import List, Optional, Tuple
from llama_index.readers.github.repository.github_client import ( from llama_index.readers.github.repository.github_client import (
GitBlobResponseModel, GitBlobResponseModel,
...@@ -146,7 +146,7 @@ class BufferedGitBlobDataIterator(BufferedAsyncIterator): ...@@ -146,7 +146,7 @@ class BufferedGitBlobDataIterator(BufferedAsyncIterator):
if self._verbose: if self._verbose:
start_t = time.time() start_t = time.time()
results: List[GitBlobResponseModel] = await asyncio.gather( results: List[Optional[GitBlobResponseModel]] = await asyncio.gather(
*[ *[
self._github_client.get_blob(self._owner, self._repo, blob.sha) self._github_client.get_blob(self._owner, self._repo, blob.sha)
for blob, _ in self._blobs_and_paths[ for blob, _ in self._blobs_and_paths[
...@@ -154,6 +154,9 @@ class BufferedGitBlobDataIterator(BufferedAsyncIterator): ...@@ -154,6 +154,9 @@ class BufferedGitBlobDataIterator(BufferedAsyncIterator):
] # TODO: use batch_size instead of buffer_size for concurrent requests ] # TODO: use batch_size instead of buffer_size for concurrent requests
] ]
) )
filtered_results = [result for result in results if result is not None]
if self._verbose: if self._verbose:
end_t = time.time() end_t = time.time()
blob_names_and_sizes = [ blob_names_and_sizes = [
...@@ -167,5 +170,7 @@ class BufferedGitBlobDataIterator(BufferedAsyncIterator): ...@@ -167,5 +170,7 @@ class BufferedGitBlobDataIterator(BufferedAsyncIterator):
self._buffer = [ self._buffer = [
(result, path) (result, path)
for result, (_, path) in zip(results, self._blobs_and_paths[start:end]) for result, (_, path) in zip(
filtered_results, self._blobs_and_paths[start:end]
)
] ]
...@@ -26,7 +26,7 @@ license = "MIT" ...@@ -26,7 +26,7 @@ license = "MIT"
maintainers = ["ahmetkca", "moncho", "rwood-97"] maintainers = ["ahmetkca", "moncho", "rwood-97"]
name = "llama-index-readers-github" name = "llama-index-readers-github"
readme = "README.md" readme = "README.md"
version = "0.1.4" version = "0.1.5"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.8.1,<3.12" python = ">=3.8.1,<3.12"
......
...@@ -44,7 +44,7 @@ name = "llama-index" ...@@ -44,7 +44,7 @@ name = "llama-index"
packages = [{from = "_llama-index", include = "llama_index"}] packages = [{from = "_llama-index", include = "llama_index"}]
readme = "README.md" readme = "README.md"
repository = "https://github.com/run-llama/llama_index" repository = "https://github.com/run-llama/llama_index"
version = "0.10.6" version = "0.10.7"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.8.1,<4.0" python = ">=3.8.1,<4.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment