Skip to content

Commit

Permalink
Addressing comments in: #301 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomron-aws committed Jan 22, 2025
1 parent e52d3ee commit b7378ea
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions libs/aws/langchain_aws/runnables/q_business.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,11 @@ class AmazonQ(LLM):
extra="forbid",
)

@property
def _llm_type(self) -> str:
"""Return type of llm."""
return "amazon_q"
def __init__(self, **kwargs: Any) -> None:
"""Initialize the Amazon Q client."""
super().__init__(**kwargs)

def _call(
def invoke(
self,
prompt: str,
stop: Optional[List[str]] = None,
Expand Down Expand Up @@ -113,7 +109,7 @@ def get_last_response(self) -> Dict:
"""Method to access the full response from the last call"""
return self._last_response

async def _acall(
async def ainvoke(
self,
prompt: str,
stop: Optional[List[str]] = None,
Expand All @@ -123,7 +119,7 @@ async def _acall(
"""Async call to Amazon Q service."""

def _execute_call():
return self._call(prompt, stop=stop, **kwargs)
return self.invoke(prompt, stop=stop, **kwargs)

# Run the synchronous call in a thread pool
return await asyncio.get_running_loop().run_in_executor(
Expand Down

0 comments on commit b7378ea

Please sign in to comment.