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

chore: Disable all the routes except of tasks and agents #439

Merged
merged 1 commit into from
Aug 3, 2024
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
20 changes: 11 additions & 9 deletions agents-api/agents_api/routers/agents/update_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ async def update_agent(
x_developer_id: Annotated[UUID4, Depends(get_developer_id)],
) -> ResourceUpdatedResponse:
try:
updated_agent = update_agent_query(
agent_id=agent_id,
developer_id=x_developer_id,
name=request.name,
about=request.about,
model=request.model,
default_settings=request.default_settings,
metadata=request.metadata,
instructions=request.instructions,
_, updated_agent = next(
Copy link
Contributor

Choose a reason for hiding this comment

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

Using next() and .iterrows() suggests that update_agent_query returns a DataFrame, which is unusual and potentially inefficient for a web API. Consider modifying update_agent_query to return a more suitable data structure, like a dictionary, directly applicable to the API's needs.

update_agent_query(
agent_id=agent_id,
developer_id=x_developer_id,
name=request.name,
about=request.about,
model=request.model,
default_settings=request.default_settings,
metadata=request.metadata,
instructions=request.instructions,
).iterrows()
)
return ResourceUpdatedResponse(**updated_agent)
except AgentNotFoundError as e:
Expand Down
6 changes: 3 additions & 3 deletions agents-api/agents_api/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def register_exceptions(app: FastAPI):
register_exceptions(app)

app.include_router(agents.router)
app.include_router(sessions.router)
app.include_router(users.router)
app.include_router(jobs.router)
# app.include_router(sessions.router)
# app.include_router(users.router)
# app.include_router(jobs.router)
app.include_router(tasks.router)


Expand Down
Loading