Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Cleanup playground file #1155

Merged
merged 5 commits into from
Sep 27, 2024

Conversation

manthanguptaa
Copy link
Contributor

No description provided.

Copy link
Contributor

@ashpreetbedi ashpreetbedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic PR and mostly LGTM, just have a few comments regd imports

from typing import List, Optional

from phi.agent.agent import Agent, Tool, Toolkit, Function
from phi.utils.log import logger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update import ordering

from phi.agent.session import AgentSession
from phi.utils.log import logger

class GetAgentSessionsResponse(BaseModel):
session_id: Optional[str] = None
title: Optional[str] = None
from .routes import create_playground_routes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a fan of relative routes, lets use phi.playground.routes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


from pydantic import BaseModel
from phi.agent.agent import Agent, RunResponse, Tool, Toolkit, Function
from phi.agent.agent import Agent
from phi.playground.settings import PlaygroundSettings
from phi.utils.log import logger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import ordering

from phi.agent.agent import Agent, RunResponse
from phi.utils.log import logger
from phi.agent.session import AgentSession
from .operator import get_agent_by_id, get_session_title, format_tools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use absolute imports

from fastapi.responses import StreamingResponse, JSONResponse

from phi.agent.agent import Agent, RunResponse
from phi.utils.log import logger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import ordering, phi.utils should be at the end

@@ -0,0 +1,133 @@
from typing import List, Optional, Generator, Dict, cast, Union
import base64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base64 should be at the top

@@ -0,0 +1,133 @@
from typing import List, Optional, Generator, Dict, cast, Union
import base64
from fastapi import APIRouter, HTTPException, UploadFile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line between std lib imports and 3rd party imports

from phi.playground.operator import format_tools, get_agent_by_id, get_session_title
from phi.utils.log import logger

from .schemas import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manthanguptaa here we should do phi.playground.schemas

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

@manthanguptaa manthanguptaa merged commit 9a5d11a into release/v2.5.0 Sep 27, 2024
1 check passed
@manthanguptaa manthanguptaa deleted the cleanup-playground-file-phi-1255 branch November 13, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants