Skip to content

Commit

Permalink
[CLEANUP]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye Gomez authored and Kye Gomez committed Jul 27, 2024
1 parent 05a538f commit 22878cd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
11 changes: 8 additions & 3 deletions servers/agent/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
from swarms import Agent, Anthropic, GPT4VisionAPI, OpenAIChat
from swarms.utils.loguru_logger import logger
from swarms_cloud.schema.cog_vlm_schemas import ChatCompletionResponse, UsageInfo
from swarms_cloud.schema.agent_api_schemas import AgentInput, AgentOutput, ModelList, ModelSchema
from swarms_cloud.schema.agent_api_schemas import (
AgentInput,
AgentOutput,
ModelList,
ModelSchema,
)


async def count_tokens(text: str) -> int:
Expand Down Expand Up @@ -81,15 +86,15 @@ async def list_models() -> List[str]:
This is useful for clients to query and understand what models are available for use.
"""
models = ModelList(
data = [
data=[
ModelSchema(id="gpt-4o", created_at="OpenAI"),
ModelSchema(id="gpt-4-vision-preview", created_at="OpenAI"),
ModelSchema(id="Anthropic", created_at="Anthropic"),
# ModelSchema(id="gpt-4o", created_at="OpenAI"),
## Llama3.1
]
)

return models


Expand Down
10 changes: 8 additions & 2 deletions swarms_cloud/schema/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from swarms_cloud.schema.agent_api_schemas import AgentInput, ModelSchema, ModelList, GenerationMetrics, AgentOutput
from swarms_cloud.schema.agent_api_schemas import (
AgentInput,
ModelSchema,
ModelList,
GenerationMetrics,
AgentOutput,
)


__all__ = [
Expand All @@ -7,4 +13,4 @@
"ModelList",
"GenerationMetrics",
"AgentOutput",
]
]
2 changes: 0 additions & 2 deletions swarms_cloud/schema/agent_api_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from swarms_cloud.schema.cog_vlm_schemas import ChatCompletionResponse



# Define the input model using Pydantic
class AgentInput(BaseModel):
agent_name: str = "Swarm Agent"
Expand Down Expand Up @@ -76,4 +75,3 @@ class AgentOutput(BaseModel):
agent: AgentInput
completions: ChatCompletionResponse
# metrics: GenerationMetrics

0 comments on commit 22878cd

Please sign in to comment.