Skip to content

Commit

Permalink
linting and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
George Burton committed Mar 21, 2024
1 parent 6a4c048 commit f635e35
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
11 changes: 0 additions & 11 deletions core_api/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import logging
from datetime import datetime
from uuid import UUID
from uuid import uuid4

import pydantic
from fastapi import FastAPI, HTTPException
from fastapi import UploadFile
from fastapi.responses import RedirectResponse
Expand All @@ -18,7 +16,6 @@
StatusResponse,
Settings,
)
from redbox.models.llm import Embedding
from redbox.storage import ElasticsearchStorageHandler

# === Logging ===
Expand Down Expand Up @@ -55,14 +52,6 @@

storage_handler = ElasticsearchStorageHandler(es_client=es, root_index="redbox-data")

# === Data Models ===


class StatusResponse(pydantic.BaseModel):
status: str
uptime_seconds: float
version: str


# === API Setup ===

Expand Down
26 changes: 19 additions & 7 deletions django_app/redbox_app/redbox_core/migrations/0003_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,31 @@


class Migration(migrations.Migration):

dependencies = [
('redbox_core', '0002_user_invite_accepted_at_user_invited_at_and_more'),
("redbox_core", "0002_user_invite_accepted_at_user_invited_at_and_more"),
]

operations = [
migrations.CreateModel(
name='File',
name="File",
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('path', models.TextField()),
('name', models.TextField()),
('processing_status', models.CharField(choices=[('uploaded', 'Uploaded'), ('parsing', 'Parsing'), ('chunking', 'Chunking'), ('embedding', 'Embedding'), ('indexing', 'Indexing'), ('complete', 'Complete')], default='uploaded')),
("id", models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
("path", models.TextField()),
("name", models.TextField()),
(
"processing_status",
models.CharField(
choices=[
("uploaded", "Uploaded"),
("parsing", "Parsing"),
("chunking", "Chunking"),
("embedding", "Embedding"),
("indexing", "Indexing"),
("complete", "Complete"),
],
default="uploaded",
),
),
],
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@


class Migration(migrations.Migration):

dependencies = [
('redbox_core', '0003_file'),
("redbox_core", "0003_file"),
]

operations = [
migrations.AlterField(
model_name='file',
name='path',
field=models.TextField(help_text='location of file'),
model_name="file",
name="path",
field=models.TextField(help_text="location of file"),
),
]
2 changes: 1 addition & 1 deletion django_app/redbox_app/redbox_core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ def get_processing_text(self) -> str:
stage = processing_status_list.index(self.processing_status)
if stage == len(processing_status_list) - 1:
return self.processing_status
return f"{stage + 1}/{len(processing_status_list) - 1} {self.processing_status}"
return f"{stage + 1}/{len(processing_status_list) - 1} {self.processing_status}"
2 changes: 0 additions & 2 deletions streamlit_app/pages/5_Persona_Chat.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import json
from datetime import date, datetime

import pydantic
import streamlit as st
from langchain.schema import AIMessage, HumanMessage, SystemMessage
from streamlit_feedback import streamlit_feedback
from utils import StreamlitStreamHandler, init_session_state, load_llm_handler, replace_doc_ref, submit_feedback

from redbox.llm.prompts.core import CORE_REDBOX_PROMPT
from redbox.models.chat import ChatMessage
from redbox.models.persona import ChatPersona

st.set_page_config(page_title="Redbox Copilot - Ask the Box", page_icon="📮", layout="wide")

Expand Down

0 comments on commit f635e35

Please sign in to comment.