mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-11 20:40:40 +00:00
rename
This commit is contained in:
parent
c010d25dc0
commit
4c25287923
1 changed files with 6 additions and 6 deletions
|
@ -87,7 +87,7 @@ class MetaReferenceAgentsImpl(Agents):
|
||||||
agent_id=agent_id,
|
agent_id=agent_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def get_chat_agent(self, agent_id: str) -> ChatAgent:
|
async def _get_agent_impl(self, agent_id: str) -> ChatAgent:
|
||||||
agent_config = await self.persistence_store.get(
|
agent_config = await self.persistence_store.get(
|
||||||
key=f"agent:{agent_id}",
|
key=f"agent:{agent_id}",
|
||||||
)
|
)
|
||||||
|
@ -123,7 +123,7 @@ class MetaReferenceAgentsImpl(Agents):
|
||||||
agent_id: str,
|
agent_id: str,
|
||||||
session_name: str,
|
session_name: str,
|
||||||
) -> AgentSessionCreateResponse:
|
) -> AgentSessionCreateResponse:
|
||||||
agent = await self.get_chat_agent(agent_id)
|
agent = await self._get_agent_impl(agent_id)
|
||||||
|
|
||||||
session_id = await agent.create_session(session_name)
|
session_id = await agent.create_session(session_name)
|
||||||
return AgentSessionCreateResponse(
|
return AgentSessionCreateResponse(
|
||||||
|
@ -163,7 +163,7 @@ class MetaReferenceAgentsImpl(Agents):
|
||||||
self,
|
self,
|
||||||
request: AgentTurnCreateRequest,
|
request: AgentTurnCreateRequest,
|
||||||
) -> AsyncGenerator:
|
) -> AsyncGenerator:
|
||||||
agent = await self.get_chat_agent(request.agent_id)
|
agent = await self._get_agent_impl(request.agent_id)
|
||||||
async for event in agent.create_and_execute_turn(request):
|
async for event in agent.create_and_execute_turn(request):
|
||||||
yield event
|
yield event
|
||||||
|
|
||||||
|
@ -191,12 +191,12 @@ class MetaReferenceAgentsImpl(Agents):
|
||||||
self,
|
self,
|
||||||
request: AgentTurnResumeRequest,
|
request: AgentTurnResumeRequest,
|
||||||
) -> AsyncGenerator:
|
) -> AsyncGenerator:
|
||||||
agent = await self.get_chat_agent(request.agent_id)
|
agent = await self._get_agent_impl(request.agent_id)
|
||||||
async for event in agent.resume_turn(request):
|
async for event in agent.resume_turn(request):
|
||||||
yield event
|
yield event
|
||||||
|
|
||||||
async def get_agents_turn(self, agent_id: str, session_id: str, turn_id: str) -> Turn:
|
async def get_agents_turn(self, agent_id: str, session_id: str, turn_id: str) -> Turn:
|
||||||
agent = await self.get_chat_agent(agent_id)
|
agent = await self._get_agent_impl(agent_id)
|
||||||
turn = await agent.storage.get_session_turn(session_id, turn_id)
|
turn = await agent.storage.get_session_turn(session_id, turn_id)
|
||||||
return turn
|
return turn
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ class MetaReferenceAgentsImpl(Agents):
|
||||||
session_id: str,
|
session_id: str,
|
||||||
turn_ids: Optional[List[str]] = None,
|
turn_ids: Optional[List[str]] = None,
|
||||||
) -> Session:
|
) -> Session:
|
||||||
agent = await self.get_chat_agent(agent_id)
|
agent = await self._get_agent_impl(agent_id)
|
||||||
session_info = await agent.storage.get_session_info(session_id)
|
session_info = await agent.storage.get_session_info(session_id)
|
||||||
if session_info is None:
|
if session_info is None:
|
||||||
raise ValueError(f"Session {session_id} not found")
|
raise ValueError(f"Session {session_id} not found")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue