Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
18 changes: 9 additions & 9 deletions slack_index/app.py → cocobee/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Pipeline entry point.

cocoindex update slack_index/app.py # one-shot catch-up
cocoindex update -L slack_index/app.py # live: re-scan every poll interval
cocoindex update cocobee/app.py # one-shot catch-up
cocoindex update -L cocobee/app.py # live: re-scan every poll interval
"""

from __future__ import annotations
Expand All @@ -15,13 +15,13 @@
from cocoindex.resources.rate_limit import RateLimiter
from slack_sdk.web.async_client import AsyncWebClient

from slack_index import config
from slack_index.context import DISTILLER, EMBEDDER, LANCE_DB, SLACK, SLACK_LIMIT
from slack_index.distill import Distiller
from slack_index.files import process_file
from slack_index.models import SlackChunk
from slack_index.source import SlackChannelFiles, SlackChannelThreads
from slack_index.threads import process_thread
from cocobee import config
from cocobee.context import DISTILLER, EMBEDDER, LANCE_DB, SLACK, SLACK_LIMIT
from cocobee.distill import Distiller
from cocobee.files import process_file
from cocobee.models import SlackChunk
from cocobee.source import SlackChannelFiles, SlackChannelThreads
from cocobee.threads import process_thread

_settings = config.Settings.from_env()

Expand Down
6 changes: 3 additions & 3 deletions slack_index/chunking.py → cocobee/chunking.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from cocoindex.resources.chunk import Chunk
from cocoindex.resources.id import IdGenerator

from slack_index.config import CHUNK_OVERLAP, CHUNK_SIZE
from slack_index.context import EMBEDDER
from slack_index.models import SlackChunk
from cocobee.config import CHUNK_OVERLAP, CHUNK_SIZE
from cocobee.context import EMBEDDER
from cocobee.models import SlackChunk

_splitter = RecursiveSplitter()

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion slack_index/context.py → cocobee/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from slack_sdk.web.async_client import AsyncWebClient

if _typing.TYPE_CHECKING:
from slack_index import distill
from cocobee import distill

SLACK = coco.ContextKey[AsyncWebClient]("slack")
# detect_change: a different distillation model must re-distill everything.
Expand Down
4 changes: 2 additions & 2 deletions slack_index/distill.py → cocobee/distill.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from anthropic import AsyncAnthropic
from pydantic import BaseModel, Field

from slack_index.config import DISTILL_MAX_TOKENS, DISTILL_TEMPERATURE
from slack_index.context import DISTILLER
from cocobee.config import DISTILL_MAX_TOKENS, DISTILL_TEMPERATURE
from cocobee.context import DISTILLER

_SYSTEM = """You summarise chat from a molecular biology lab's Slack channel.
The chat is Korean and informal; the science terms are not. Write in Korean.
Expand Down
6 changes: 3 additions & 3 deletions slack_index/evals.py → cocobee/evals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Score the index against a hand-labelled question set.

python -m slack_index.evals
python -m slack_index.evals --questions evals/questions.yaml --top-k 10
python -m cocobee.evals
python -m cocobee.evals --questions evals/questions.yaml --top-k 10

Every retrieval change — a different embedding model, grouping, a reranker — is
judged by re-running this against the same questions.
Expand All @@ -18,7 +18,7 @@

import yaml

from slack_index.search import Searcher
from cocobee.search import Searcher

DEFAULT_QUESTIONS = pathlib.Path("evals/questions.yaml")
# The labels quote channel content, so the repo carries only this encrypted copy;
Expand Down
10 changes: 5 additions & 5 deletions slack_index/files.py → cocobee/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import cocoindex as coco
from cocoindex.connectors import lancedb

from slack_index.chunking import ChunkMeta, declare_chunks
from slack_index.config import bot_token
from slack_index.context import SLACK_LIMIT
from slack_index.models import FileRef, SlackChunk
from slack_index.users import display_name
from cocobee.chunking import ChunkMeta, declare_chunks
from cocobee.config import bot_token
from cocobee.context import SLACK_LIMIT
from cocobee.models import FileRef, SlackChunk
from cocobee.users import display_name

_logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion slack_index/models.py → cocobee/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from numpy.typing import NDArray

from slack_index.context import EMBEDDER
from cocobee.context import EMBEDDER


@dataclass(frozen=True, slots=True)
Expand Down
4 changes: 2 additions & 2 deletions slack_index/query.py → cocobee/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import asyncio
import sys

from slack_index.search import Searcher
from cocobee.search import Searcher

TOP_K = 5

Expand All @@ -20,7 +20,7 @@ async def run(query: str, *, top_k: int = TOP_K) -> None:

def main() -> None:
if len(sys.argv) < 2:
sys.exit("usage: python -m slack_index.query <query>")
sys.exit("usage: python -m cocobee.query <query>")
asyncio.run(run(" ".join(sys.argv[1:])))


Expand Down
4 changes: 2 additions & 2 deletions slack_index/rerank.py → cocobee/rerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import torch
from sentence_transformers import CrossEncoder

from slack_index import config
from cocobee import config

if TYPE_CHECKING:
from slack_index.search import Hit
from cocobee.search import Hit


def default_device() -> str:
Expand Down
4 changes: 2 additions & 2 deletions slack_index/search.py → cocobee/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from cocoindex.ops.sentence_transformers import SentenceTransformerEmbedder
from lancedb.table import AsyncTable

from slack_index import config
from slack_index.rerank import Reranker
from cocobee import config
from cocobee.rerank import Reranker

# One source can own many chunks; over-fetch so that collapsing them still
# leaves top_k distinct sources.
Expand Down
4 changes: 2 additions & 2 deletions slack_index/source.py → cocobee/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from cocoindex.resources.rate_limit import RateLimiter
from slack_sdk.web.async_client import AsyncWebClient

from slack_index.config import WINDOW_GAP, WINDOW_MAX_CHARS, WINDOW_MAX_MESSAGES
from slack_index.models import ConversationRef, FileRef, Message
from cocobee.config import WINDOW_GAP, WINDOW_MAX_CHARS, WINDOW_MAX_MESSAGES
from cocobee.models import ConversationRef, FileRef, Message

# Joins, leaves and topic changes carry no content worth searching.
SKIP_SUBTYPES = frozenset(
Expand Down
12 changes: 6 additions & 6 deletions slack_index/threads.py → cocobee/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import cocoindex as coco
from cocoindex.connectors import lancedb

from slack_index.chunking import ChunkMeta, declare_chunks
from slack_index.context import SLACK, SLACK_LIMIT
from slack_index.distill import distill
from slack_index.models import ConversationRef, Message, SlackChunk
from slack_index.source import next_cursor
from slack_index.users import display_name
from cocobee.chunking import ChunkMeta, declare_chunks
from cocobee.context import SLACK, SLACK_LIMIT
from cocobee.distill import distill
from cocobee.models import ConversationRef, Message, SlackChunk
from cocobee.source import next_cursor
from cocobee.users import display_name


def thread_permalink(channel: str, thread_ts: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion slack_index/users.py → cocobee/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import cocoindex as coco
from slack_sdk.errors import SlackApiError

from slack_index.context import SLACK, SLACK_LIMIT
from cocobee.context import SLACK, SLACK_LIMIT

UNKNOWN_AUTHOR = "unknown"

Expand Down
Loading
Loading