Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BeatrixCohere committed Jul 12, 2024
1 parent 323209f commit e8952a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/backend/chat/custom/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@ def call_tools(self, chat_history, deployment_model, **kwargs: Any):
if not tool:
continue

outputs = asyncio.run(tool.implementation().call(
outputs = tool.implementation().call(
parameters=tool_call.get("parameters"),
session=kwargs.get("session"),
model_deployment=deployment_model,
user_id=kwargs.get("user_id"),
trace_id=kwargs.get("trace_id"),
agent_id=kwargs.get("agent_id"),
))
)

# If the tool returns a list of outputs, append each output to the tool_results list
# Otherwise, append the single output to the tool_results list
Expand Down
2 changes: 1 addition & 1 deletion src/backend/model_deployments/cohere_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, **kwargs: Any):

@property
def rerank_enabled(self) -> bool:
return False
return True

@classmethod
def list_models(cls) -> List[str]:
Expand Down
4 changes: 4 additions & 0 deletions src/backend/tools/google_drive/tool.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import os
import time
from typing import Any, Dict, List
Expand Down Expand Up @@ -61,6 +62,9 @@ def _handle_tool_specific_errors(cls, error: Exception, **kwargs: Any):
raise Exception(message)

async def call(self, parameters: dict, **kwargs: Any) -> List[Dict[str, Any]]:
return asyncio.run(self.call_async(parameters, **kwargs))

async def call_async(self, parameters: dict, **kwargs: Any) -> List[Dict[str, Any]]:
"""
Google Drive logic
"""
Expand Down

0 comments on commit e8952a8

Please sign in to comment.