Skip to content

Commit

Permalink
fixes to test imports
Browse files Browse the repository at this point in the history
  • Loading branch information
alekst23 committed Sep 5, 2024
1 parent 350fed5 commit 8bbdf1a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/test_text_backend_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from openai import OpenAI
from openai.types.beta.vector_store import VectorStore

from leapfrogai_api.backend.types import VectorStoreStatus
from leapfrogai_api.typedef.vectorstores import VectorStoreStatus


def download_arxiv_pdf():
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/api/test_assistants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
from openai.types.beta.vector_store import ExpiresAfter

import leapfrogai_api.backend.rag.index
from leapfrogai_api.backend.types import CreateVectorStoreRequest
from leapfrogai_api.routers.openai.vector_stores import router as vector_store_router
from leapfrogai_api.routers.openai.files import router as files_router
from leapfrogai_api.routers.openai.assistants import router as assistants_router
from leapfrogai_api.routers.openai.requests.create_modify_assistant_request import (
from leapfrogai_api.typedef.vectorstores import CreateVectorStoreRequest
from leapfrogai_api.typedef.assistants import (
CreateAssistantRequest,
ModifyAssistantRequest,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/api/test_vector_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from langchain_core.embeddings.fake import FakeEmbeddings

import leapfrogai_api.backend.rag.index
from leapfrogai_api.backend.types import (
from leapfrogai_api.typedef.vectorstores import (
CreateVectorStoreRequest,
ModifyVectorStoreRequest,
)
Expand Down
13 changes: 7 additions & 6 deletions tests/pytest/leapfrogai_api/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
from fastapi.testclient import TestClient
from starlette.middleware.base import _CachedRequest
from supabase import ClientOptions
import leapfrogai_api.backend.types as lfai_types
from leapfrogai_api.typedef.chat import ChatCompletionRequest, ChatMessage
from leapfrogai_api.typedef.embeddings import CreateEmbeddingRequest
from leapfrogai_api.main import app
from leapfrogai_api.routers.supabase_session import init_supabase_client

Expand Down Expand Up @@ -209,7 +210,7 @@ def test_embedding(dummy_auth_middleware):

with TestClient(app) as client:
# Send request to client
embedding_request = lfai_types.CreateEmbeddingRequest(
embedding_request = CreateEmbeddingRequest(
model="repeater",
input="This is the embedding input text.",
)
Expand Down Expand Up @@ -237,9 +238,9 @@ def test_chat_completion(dummy_auth_middleware):
"""Test the chat completion endpoint."""
with TestClient(app) as client:
input_content = "this is the chat completion input."
chat_completion_request = lfai_types.ChatCompletionRequest(
chat_completion_request = ChatCompletionRequest(
model="repeater",
messages=[lfai_types.ChatMessage(role="user", content=input_content)],
messages=[ChatMessage(role="user", content=input_content)],
)
response = client.post(
"/openai/v1/chat/completions", json=chat_completion_request.model_dump()
Expand Down Expand Up @@ -284,9 +285,9 @@ def test_stream_chat_completion(dummy_auth_middleware):
with TestClient(app) as client:
input_content = "this is the stream chat completion input."

chat_completion_request = lfai_types.ChatCompletionRequest(
chat_completion_request = ChatCompletionRequest(
model="repeater",
messages=[lfai_types.ChatMessage(role="user", content=input_content)],
messages=[ChatMessage(role="user", content=input_content)],
stream=True,
)

Expand Down
5 changes: 1 addition & 4 deletions tests/unit/leapfrogai_api/routers/openai/test_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
ToolResourcesFileSearch,
)

from leapfrogai_api.routers.openai.requests.create_thread_request import (
CreateThreadRequest,
)
from leapfrogai_api.backend.types import ModifyThreadRequest
from leapfrogai_api.typedef.threads import ModifyThreadRequest, CreateThreadRequest
from leapfrogai_api.data.crud_thread import CRUDThread
from leapfrogai_api.data.crud_message import CRUDMessage
from leapfrogai_api.routers.openai.threads import (
Expand Down

0 comments on commit 8bbdf1a

Please sign in to comment.