Skip to content

Commit

Permalink
chore: rename project to ragbits (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhordynski authored Sep 16, 2024
1 parent c8ae2f9 commit 9082362
Show file tree
Hide file tree
Showing 82 changed files with 82 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/01_feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: 🚀 Feature Request
description: Submit a proposal/request for a new ragnarok feature.
description: Submit a proposal/request for a new ragbits feature.
title: "feat: "
labels: ["feature"]
body:
- type: markdown
attributes:
value: |
Thanks for contributing to ragnarok!
Thanks for contributing to ragbits!
- type: textarea
id: feature-description
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/02_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ body:
attributes:
label: How can we reproduce it?
description: Please provide a code snippet to reproduce the bug.
placeholder: import ragnarok
placeholder: import ragbits
render: python
- type: textarea
id: logs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ragnarok
# ragbits

Repository for internal experiment with our upcoming LLM framework.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from pydantic import BaseModel

from ragnarok_common.llms.litellm import LiteLLM
from ragnarok_common.prompt import Prompt
from ragbits_common.llms.litellm import LiteLLM
from ragbits_common.prompt import Prompt


class LoremPromptInput(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pydantic import BaseModel

from ragnarok_common.prompt import Prompt
from ragbits_common.prompt import Prompt


class LoremPromptInput(BaseModel):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = ragnarok-common
name = ragbits-common
version = 0.0.1
description = "common utilities for the ragnarok framework"
description = "common utilities for the ragbits framework"
author = deepsense.ai
author_email = [email protected]
license = Other/Proprietary License
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
except ImportError:
HAS_LITELLM = False

from ragnarok_common.embeddings.base import Embeddings
from ragnarok_common.embeddings.exceptions import EmbeddingConnectionError, EmbeddingResponseError, EmbeddingStatusError
from ragbits_common.embeddings.base import Embeddings
from ragbits_common.embeddings.exceptions import EmbeddingConnectionError, EmbeddingResponseError, EmbeddingStatusError


class LiteLLMEmbeddings(Embeddings):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from functools import cached_property
from typing import Generic, Optional, Type, cast, overload

from ragnarok_common.prompt.base import BasePrompt, BasePromptWithParser, OutputT
from ragbits_common.prompt.base import BasePrompt, BasePromptWithParser, OutputT

from .clients.base import LLMClient, LLMClientOptions, LLMOptions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pydantic import BaseModel

from ragnarok_common.prompt import ChatFormat
from ragbits_common.prompt import ChatFormat

from ..types import NotGiven

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
HAS_LITELLM = False


from ragnarok_common.prompt import ChatFormat
from ragbits_common.prompt import ChatFormat

from ..types import NOT_GIVEN, NotGiven
from .base import LLMClient, LLMOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
except ImportError:
HAS_LOCAL_LLM = False

from ragnarok_common.prompt import ChatFormat
from ragbits_common.prompt import ChatFormat

from ..types import NOT_GIVEN, NotGiven
from .base import LLMClient, LLMOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
except ImportError:
HAS_LITELLM = False

from ragnarok_common.prompt.base import BasePrompt
from ragbits_common.prompt.base import BasePrompt

from .base import LLM
from .clients.litellm import LiteLLMClient, LiteLLMOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
except ImportError:
HAS_LOCAL_LLM = False

from ragnarok_common.prompt.base import BasePrompt
from ragbits_common.prompt.base import BasePrompt

from .base import LLM
from .clients.local import LocalLLMClient, LocalLLMOptions
Expand Down
3 changes: 3 additions & 0 deletions packages/ragbits-common/src/ragbits_common/prompt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from ragbits_common.prompt.prompt import ChatFormat, Prompt

__all__ = ["Prompt", "ChatFormat"]
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pydantic import BaseModel

from ragnarok_common.llms.clients.litellm import LiteLLMOptions
from ragnarok_common.llms.litellm import LiteLLM
from ragnarok_common.prompt import Prompt
from ragnarok_common.prompt.base import BasePrompt, BasePromptWithParser, ChatFormat
from ragbits_common.llms.clients.litellm import LiteLLMOptions
from ragbits_common.llms.litellm import LiteLLM
from ragbits_common.prompt import Prompt
from ragbits_common.prompt.base import BasePrompt, BasePromptWithParser, ChatFormat


class MockPrompt(BasePrompt):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import pytest

from ragnarok_common.prompt import Prompt
from ragnarok_common.prompt.parsers import ResponseParsingError
from ragbits_common.prompt import Prompt
from ragbits_common.prompt.parsers import ResponseParsingError

from .test_prompt import _PromptOutput

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pydantic
import pytest

from ragnarok_common.prompt import Prompt
from ragbits_common.prompt import Prompt


class _PromptInput(pydantic.BaseModel):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[metadata]
name = ragnarok-dev-kit
name = ragbits-dev-kit
version = 0.0.1
description = "dev kit for ragnarok framework"
description = "dev kit for ragbits framework"
author = deepsense.ai
author_email = [email protected]
license = Other/Proprietary License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import jinja2
import typer
from pydantic import BaseModel
from ragnarok_dev_kit.discovery.prompt_discovery import PromptDiscovery
from ragbits_dev_kit.discovery.prompt_discovery import PromptDiscovery

from ragnarok_common.llms import LiteLLM
from ragnarok_common.llms.clients import LiteLLMOptions
from ragbits_common.llms import LiteLLM
from ragbits_common.llms.clients import LiteLLMOptions


class PromptState:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from ragbits_dev_kit.discovery.prompt_discovery import PromptDiscovery

__all__ = ["PromptDiscovery"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from collections import namedtuple
from typing import Any

from ragnarok_common.prompt import Prompt
from ragbits_common.prompt import Prompt

PromptDetails = namedtuple("PromptDetails", ["system_prompt", "user_prompt", "input_type", "object"])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pydantic import BaseModel

from ragnarok_common.prompt import Prompt
from ragbits_common.prompt import Prompt


class PromptForTestInput(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pydantic import BaseModel

from ragnarok_common.prompt import Prompt
from ragbits_common.prompt import Prompt


class PromptForTestInputA(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pydantic import BaseModel

from ragnarok_common.prompt import Prompt
from ragbits_common.prompt import Prompt


class PromptForTestInputB(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from pathlib import Path

from ragnarok_dev_kit.discovery.prompt_discovery import PromptDiscovery
from ragbits_dev_kit.discovery.prompt_discovery import PromptDiscovery


def test_prompt_discovery_from_file():
Expand All @@ -28,7 +28,7 @@ def test_prompt_discovery_from_file():

def test_prompt_discovery_from_package():
sys.path.append(str(Path(__file__).parent))
test_paths = ["ragnarok_tests_pkg_with_prompts"]
test_paths = ["ragbits_tests_pkg_with_prompts"]

discovery_result = PromptDiscovery(test_paths).discover()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import asyncio

from ragnarok_document_search import DocumentSearch
from ragnarok_document_search.documents.document import DocumentMeta
from ragnarok_document_search.vector_store.in_memory import InMemoryVectorStore
from ragbits_document_search import DocumentSearch
from ragbits_document_search.documents.document import DocumentMeta
from ragbits_document_search.vector_store.in_memory import InMemoryVectorStore

from ragnarok_common.embeddings.litellm import LiteLLMEmbeddings
from ragbits_common.embeddings.litellm import LiteLLMEmbeddings

documents = [
DocumentMeta.create_text_document_from_literal("RIP boiled water. You will be mist."),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
name = ragnarok-document-search
name = ragbits-document-search
# do not change version by hand: use bump_version.sh
version = 0.0.1
description = "The ragstack module responsible for fetching data from unstructured data sources."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from ragnarok_document_search.documents.document import DocumentMeta
from ragnarok_document_search.documents.element import Element
from ragnarok_document_search.ingestion.document_processor import DocumentProcessor
from ragnarok_document_search.retrieval.rephrasers.base import QueryRephraser
from ragnarok_document_search.retrieval.rephrasers.noop import NoopQueryRephraser
from ragnarok_document_search.retrieval.rerankers.base import Reranker
from ragnarok_document_search.retrieval.rerankers.noop import NoopReranker
from ragnarok_document_search.vector_store.base import VectorStore

from ragnarok_common.embeddings.base import Embeddings
from ragbits_document_search.documents.document import DocumentMeta
from ragbits_document_search.documents.element import Element
from ragbits_document_search.ingestion.document_processor import DocumentProcessor
from ragbits_document_search.retrieval.rephrasers.base import QueryRephraser
from ragbits_document_search.retrieval.rephrasers.noop import NoopQueryRephraser
from ragbits_document_search.retrieval.rerankers.base import Reranker
from ragbits_document_search.retrieval.rerankers.noop import NoopReranker
from ragbits_document_search.vector_store.base import VectorStore

from ragbits_common.embeddings.base import Embeddings


class DocumentSearch:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Union

from pydantic import BaseModel, Field
from ragnarok_document_search.documents.sources import LocalFileSource
from ragbits_document_search.documents.sources import LocalFileSource


class DocumentType(str, Enum):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from typing import ClassVar

from pydantic import BaseModel
from ragnarok_document_search.documents.document import DocumentMeta
from ragnarok_document_search.vector_store.base import VectorDBEntry
from ragbits_document_search.documents.document import DocumentMeta
from ragbits_document_search.vector_store.base import VectorDBEntry


class Element(BaseModel, ABC):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from typing import List

from ragnarok_document_search.documents.document import DocumentMeta, TextDocument
from ragnarok_document_search.documents.element import Element, TextElement
from ragbits_document_search.documents.document import DocumentMeta, TextDocument
from ragbits_document_search.documents.element import Element, TextElement


class DocumentProcessor:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ragnarok_document_search.retrieval.rephrasers.base import QueryRephraser
from ragbits_document_search.retrieval.rephrasers.base import QueryRephraser


class NoopQueryRephraser(QueryRephraser):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import abc

from ragnarok_document_search.documents.element import Element
from ragbits_document_search.documents.element import Element


class Reranker(abc.ABC):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List

from ragnarok_document_search.documents.element import Element
from ragnarok_document_search.retrieval.rerankers.base import Reranker
from ragbits_document_search.documents.element import Element
from ragbits_document_search.retrieval.rerankers.base import Reranker


class NoopReranker(Reranker):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
from ragnarok_document_search.vector_store.base import VectorDBEntry, VectorStore
from ragbits_document_search.vector_store.base import VectorDBEntry, VectorStore


class InMemoryVectorStore(VectorStore):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from unittest.mock import AsyncMock

from ragnarok_document_search import DocumentSearch
from ragnarok_document_search.documents.document import DocumentMeta
from ragnarok_document_search.documents.element import TextElement
from ragnarok_document_search.vector_store.in_memory import InMemoryVectorStore
from ragbits_document_search import DocumentSearch
from ragbits_document_search.documents.document import DocumentMeta
from ragbits_document_search.documents.element import TextElement
from ragbits_document_search.vector_store.in_memory import InMemoryVectorStore


async def test_document_search():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import tempfile
from pathlib import Path

from ragnarok_document_search.documents.document import DocumentMeta, DocumentType, TextDocument
from ragnarok_document_search.documents.sources import LocalFileSource
from ragbits_document_search.documents.document import DocumentMeta, DocumentType, TextDocument
from ragbits_document_search.documents.sources import LocalFileSource


async def test_loading_local_file_source():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ragnarok_document_search.documents.document import DocumentType
from ragnarok_document_search.documents.element import Element
from ragnarok_document_search.vector_store.base import VectorDBEntry
from ragbits_document_search.documents.document import DocumentType
from ragbits_document_search.documents.element import Element
from ragbits_document_search.vector_store.base import VectorDBEntry


def test_resolving_element_type():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from pathlib import Path

from ragnarok_document_search.documents.document import DocumentMeta, DocumentType
from ragnarok_document_search.documents.element import TextElement
from ragnarok_document_search.documents.sources import LocalFileSource
from ragnarok_document_search.vector_store.in_memory import InMemoryVectorStore
from ragbits_document_search.documents.document import DocumentMeta, DocumentType
from ragbits_document_search.documents.element import TextElement
from ragbits_document_search.documents.sources import LocalFileSource
from ragbits_document_search.vector_store.in_memory import InMemoryVectorStore


async def test_simple_vector_store():
Expand Down
Loading

0 comments on commit 9082362

Please sign in to comment.