Skip to content

Commit

Permalink
sync repo
Browse files Browse the repository at this point in the history
  • Loading branch information
yanxi0830 committed Sep 19, 2024
1 parent f567252 commit e00013a
Show file tree
Hide file tree
Showing 39 changed files with 400 additions and 436 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ The REST API documentation can be found on [docs.llama-stack.todo](https://docs.
## Installation

```sh
# install from this staging repo
pip install llama-stack-client
```

Expand All @@ -31,7 +30,7 @@ client = LlamaStack(
environment="sandbox",
)

session = client.agentic_system.sessions.create(
session = client.agents.sessions.create(
agent_id="agent_id",
session_name="session_name",
)
Expand All @@ -53,7 +52,7 @@ client = AsyncLlamaStack(


async def main() -> None:
session = await client.agentic_system.sessions.create(
session = await client.agents.sessions.create(
agent_id="agent_id",
session_name="session_name",
)
Expand Down Expand Up @@ -90,7 +89,7 @@ from llama_stack import LlamaStack
client = LlamaStack()

try:
client.agentic_system.sessions.create(
client.agents.sessions.create(
agent_id="agent_id",
session_name="session_name",
)
Expand Down Expand Up @@ -136,7 +135,7 @@ client = LlamaStack(
)

# Or, configure per-request:
client.with_options(max_retries=5).agentic_system.sessions.create(
client.with_options(max_retries=5).agents.sessions.create(
agent_id="agent_id",
session_name="session_name",
)
Expand All @@ -162,7 +161,7 @@ client = LlamaStack(
)

# Override per-request:
client.with_options(timeout=5.0).agentic_system.sessions.create(
client.with_options(timeout=5.0).agents.sessions.create(
agent_id="agent_id",
session_name="session_name",
)
Expand Down Expand Up @@ -204,13 +203,13 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
from llama_stack import LlamaStack

client = LlamaStack()
response = client.agentic_system.sessions.with_raw_response.create(
response = client.agents.sessions.with_raw_response.create(
agent_id="agent_id",
session_name="session_name",
)
print(response.headers.get('X-My-Header'))

session = response.parse() # get the object that `agentic_system.sessions.create()` would have returned
session = response.parse() # get the object that `agents.sessions.create()` would have returned
print(session.session_id)
```

Expand All @@ -225,7 +224,7 @@ The above interface eagerly reads the full response body when you make the reque
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

```python
with client.agentic_system.sessions.with_streaming_response.create(
with client.agents.sessions.with_streaming_response.create(
agent_id="agent_id",
session_name="session_name",
) as response:
Expand Down
26 changes: 13 additions & 13 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Methods:
- <code title="get /telemetry/get_trace">client.telemetry.<a href="./src/llama_stack/resources/telemetry.py">get_trace</a>(\*\*<a href="src/llama_stack/types/telemetry_get_trace_params.py">params</a>) -> <a href="./src/llama_stack/types/telemetry_get_trace_response.py">TelemetryGetTraceResponse</a></code>
- <code title="post /telemetry/log_event">client.telemetry.<a href="./src/llama_stack/resources/telemetry.py">log</a>(\*\*<a href="src/llama_stack/types/telemetry_log_params.py">params</a>) -> None</code>

# AgenticSystem
# Agents

Types:

Expand All @@ -42,53 +42,53 @@ from llama_stack.types import (
ShieldDefinition,
ToolExecutionStep,
ToolParamDefinition,
AgenticSystemCreateResponse,
AgentCreateResponse,
)
```

Methods:

- <code title="post /agentic_system/create">client.agentic_system.<a href="./src/llama_stack/resources/agentic_system/agentic_system.py">create</a>(\*\*<a href="src/llama_stack/types/agentic_system_create_params.py">params</a>) -> <a href="./src/llama_stack/types/agentic_system_create_response.py">AgenticSystemCreateResponse</a></code>
- <code title="post /agentic_system/delete">client.agentic_system.<a href="./src/llama_stack/resources/agentic_system/agentic_system.py">delete</a>(\*\*<a href="src/llama_stack/types/agentic_system_delete_params.py">params</a>) -> None</code>
- <code title="post /agents/create">client.agents.<a href="./src/llama_stack/resources/agents/agents.py">create</a>(\*\*<a href="src/llama_stack/types/agent_create_params.py">params</a>) -> <a href="./src/llama_stack/types/agent_create_response.py">AgentCreateResponse</a></code>
- <code title="post /agents/delete">client.agents.<a href="./src/llama_stack/resources/agents/agents.py">delete</a>(\*\*<a href="src/llama_stack/types/agent_delete_params.py">params</a>) -> None</code>

## Sessions

Types:

```python
from llama_stack.types.agentic_system import Session, SessionCreateResponse
from llama_stack.types.agents import Session, SessionCreateResponse
```

Methods:

- <code title="post /agentic_system/session/create">client.agentic_system.sessions.<a href="./src/llama_stack/resources/agentic_system/sessions.py">create</a>(\*\*<a href="src/llama_stack/types/agentic_system/session_create_params.py">params</a>) -> <a href="./src/llama_stack/types/agentic_system/session_create_response.py">SessionCreateResponse</a></code>
- <code title="post /agentic_system/session/get">client.agentic_system.sessions.<a href="./src/llama_stack/resources/agentic_system/sessions.py">retrieve</a>(\*\*<a href="src/llama_stack/types/agentic_system/session_retrieve_params.py">params</a>) -> <a href="./src/llama_stack/types/agentic_system/session.py">Session</a></code>
- <code title="post /agentic_system/session/delete">client.agentic_system.sessions.<a href="./src/llama_stack/resources/agentic_system/sessions.py">delete</a>(\*\*<a href="src/llama_stack/types/agentic_system/session_delete_params.py">params</a>) -> None</code>
- <code title="post /agents/session/create">client.agents.sessions.<a href="./src/llama_stack/resources/agents/sessions.py">create</a>(\*\*<a href="src/llama_stack/types/agents/session_create_params.py">params</a>) -> <a href="./src/llama_stack/types/agents/session_create_response.py">SessionCreateResponse</a></code>
- <code title="post /agents/session/get">client.agents.sessions.<a href="./src/llama_stack/resources/agents/sessions.py">retrieve</a>(\*\*<a href="src/llama_stack/types/agents/session_retrieve_params.py">params</a>) -> <a href="./src/llama_stack/types/agents/session.py">Session</a></code>
- <code title="post /agents/session/delete">client.agents.sessions.<a href="./src/llama_stack/resources/agents/sessions.py">delete</a>(\*\*<a href="src/llama_stack/types/agents/session_delete_params.py">params</a>) -> None</code>

## Steps

Types:

```python
from llama_stack.types.agentic_system import AgenticSystemStep
from llama_stack.types.agents import AgentsStep
```

Methods:

- <code title="get /agentic_system/step/get">client.agentic_system.steps.<a href="./src/llama_stack/resources/agentic_system/steps.py">retrieve</a>(\*\*<a href="src/llama_stack/types/agentic_system/step_retrieve_params.py">params</a>) -> <a href="./src/llama_stack/types/agentic_system/agentic_system_step.py">AgenticSystemStep</a></code>
- <code title="get /agents/step/get">client.agents.steps.<a href="./src/llama_stack/resources/agents/steps.py">retrieve</a>(\*\*<a href="src/llama_stack/types/agents/step_retrieve_params.py">params</a>) -> <a href="./src/llama_stack/types/agents/agents_step.py">AgentsStep</a></code>

## Turns

Types:

```python
from llama_stack.types.agentic_system import AgenticSystemTurnStreamChunk, Turn, TurnStreamEvent
from llama_stack.types.agents import AgentsTurnStreamChunk, Turn, TurnStreamEvent
```

Methods:

- <code title="post /agentic_system/turn/create">client.agentic_system.turns.<a href="./src/llama_stack/resources/agentic_system/turns.py">create</a>(\*\*<a href="src/llama_stack/types/agentic_system/turn_create_params.py">params</a>) -> <a href="./src/llama_stack/types/agentic_system/agentic_system_turn_stream_chunk.py">AgenticSystemTurnStreamChunk</a></code>
- <code title="get /agentic_system/turn/get">client.agentic_system.turns.<a href="./src/llama_stack/resources/agentic_system/turns.py">retrieve</a>(\*\*<a href="src/llama_stack/types/agentic_system/turn_retrieve_params.py">params</a>) -> <a href="./src/llama_stack/types/agentic_system/turn.py">Turn</a></code>
- <code title="post /agents/turn/create">client.agents.turns.<a href="./src/llama_stack/resources/agents/turns.py">create</a>(\*\*<a href="src/llama_stack/types/agents/turn_create_params.py">params</a>) -> <a href="./src/llama_stack/types/agents/agents_turn_stream_chunk.py">AgentsTurnStreamChunk</a></code>
- <code title="get /agents/turn/get">client.agents.turns.<a href="./src/llama_stack/resources/agents/turns.py">retrieve</a>(\*\*<a href="src/llama_stack/types/agents/turn_retrieve_params.py">params</a>) -> <a href="./src/llama_stack/types/agents/turn.py">Turn</a></code>

# Datasets

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "llama_stack_client"
version = "0.0.1-alpha.0"
version = "0.0.2-alpha.0"
description = "The official Python library for the llama-stack API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
16 changes: 8 additions & 8 deletions src/llama_stack/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

class LlamaStack(SyncAPIClient):
telemetry: resources.TelemetryResource
agentic_system: resources.AgenticSystemResource
agents: resources.AgentsResource
datasets: resources.DatasetsResource
evaluate: resources.EvaluateResource
evaluations: resources.EvaluationsResource
Expand Down Expand Up @@ -133,7 +133,7 @@ def __init__(
)

self.telemetry = resources.TelemetryResource(self)
self.agentic_system = resources.AgenticSystemResource(self)
self.agents = resources.AgentsResource(self)
self.datasets = resources.DatasetsResource(self)
self.evaluate = resources.EvaluateResource(self)
self.evaluations = resources.EvaluationsResource(self)
Expand Down Expand Up @@ -248,7 +248,7 @@ def _make_status_error(

class AsyncLlamaStack(AsyncAPIClient):
telemetry: resources.AsyncTelemetryResource
agentic_system: resources.AsyncAgenticSystemResource
agents: resources.AsyncAgentsResource
datasets: resources.AsyncDatasetsResource
evaluate: resources.AsyncEvaluateResource
evaluations: resources.AsyncEvaluationsResource
Expand Down Expand Up @@ -328,7 +328,7 @@ def __init__(
)

self.telemetry = resources.AsyncTelemetryResource(self)
self.agentic_system = resources.AsyncAgenticSystemResource(self)
self.agents = resources.AsyncAgentsResource(self)
self.datasets = resources.AsyncDatasetsResource(self)
self.evaluate = resources.AsyncEvaluateResource(self)
self.evaluations = resources.AsyncEvaluationsResource(self)
Expand Down Expand Up @@ -444,7 +444,7 @@ def _make_status_error(
class LlamaStackWithRawResponse:
def __init__(self, client: LlamaStack) -> None:
self.telemetry = resources.TelemetryResourceWithRawResponse(client.telemetry)
self.agentic_system = resources.AgenticSystemResourceWithRawResponse(client.agentic_system)
self.agents = resources.AgentsResourceWithRawResponse(client.agents)
self.datasets = resources.DatasetsResourceWithRawResponse(client.datasets)
self.evaluate = resources.EvaluateResourceWithRawResponse(client.evaluate)
self.evaluations = resources.EvaluationsResourceWithRawResponse(client.evaluations)
Expand All @@ -462,7 +462,7 @@ def __init__(self, client: LlamaStack) -> None:
class AsyncLlamaStackWithRawResponse:
def __init__(self, client: AsyncLlamaStack) -> None:
self.telemetry = resources.AsyncTelemetryResourceWithRawResponse(client.telemetry)
self.agentic_system = resources.AsyncAgenticSystemResourceWithRawResponse(client.agentic_system)
self.agents = resources.AsyncAgentsResourceWithRawResponse(client.agents)
self.datasets = resources.AsyncDatasetsResourceWithRawResponse(client.datasets)
self.evaluate = resources.AsyncEvaluateResourceWithRawResponse(client.evaluate)
self.evaluations = resources.AsyncEvaluationsResourceWithRawResponse(client.evaluations)
Expand All @@ -480,7 +480,7 @@ def __init__(self, client: AsyncLlamaStack) -> None:
class LlamaStackWithStreamedResponse:
def __init__(self, client: LlamaStack) -> None:
self.telemetry = resources.TelemetryResourceWithStreamingResponse(client.telemetry)
self.agentic_system = resources.AgenticSystemResourceWithStreamingResponse(client.agentic_system)
self.agents = resources.AgentsResourceWithStreamingResponse(client.agents)
self.datasets = resources.DatasetsResourceWithStreamingResponse(client.datasets)
self.evaluate = resources.EvaluateResourceWithStreamingResponse(client.evaluate)
self.evaluations = resources.EvaluationsResourceWithStreamingResponse(client.evaluations)
Expand All @@ -498,7 +498,7 @@ def __init__(self, client: LlamaStack) -> None:
class AsyncLlamaStackWithStreamedResponse:
def __init__(self, client: AsyncLlamaStack) -> None:
self.telemetry = resources.AsyncTelemetryResourceWithStreamingResponse(client.telemetry)
self.agentic_system = resources.AsyncAgenticSystemResourceWithStreamingResponse(client.agentic_system)
self.agents = resources.AsyncAgentsResourceWithStreamingResponse(client.agents)
self.datasets = resources.AsyncDatasetsResourceWithStreamingResponse(client.datasets)
self.evaluate = resources.AsyncEvaluateResourceWithStreamingResponse(client.evaluate)
self.evaluations = resources.AsyncEvaluationsResourceWithStreamingResponse(client.evaluations)
Expand Down
28 changes: 14 additions & 14 deletions src/llama_stack/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .agents import (
AgentsResource,
AsyncAgentsResource,
AgentsResourceWithRawResponse,
AsyncAgentsResourceWithRawResponse,
AgentsResourceWithStreamingResponse,
AsyncAgentsResourceWithStreamingResponse,
)
from .safety import (
SafetyResource,
AsyncSafetyResource,
Expand Down Expand Up @@ -64,14 +72,6 @@
PostTrainingResourceWithStreamingResponse,
AsyncPostTrainingResourceWithStreamingResponse,
)
from .agentic_system import (
AgenticSystemResource,
AsyncAgenticSystemResource,
AgenticSystemResourceWithRawResponse,
AsyncAgenticSystemResourceWithRawResponse,
AgenticSystemResourceWithStreamingResponse,
AsyncAgenticSystemResourceWithStreamingResponse,
)
from .reward_scoring import (
RewardScoringResource,
AsyncRewardScoringResource,
Expand Down Expand Up @@ -104,12 +104,12 @@
"AsyncTelemetryResourceWithRawResponse",
"TelemetryResourceWithStreamingResponse",
"AsyncTelemetryResourceWithStreamingResponse",
"AgenticSystemResource",
"AsyncAgenticSystemResource",
"AgenticSystemResourceWithRawResponse",
"AsyncAgenticSystemResourceWithRawResponse",
"AgenticSystemResourceWithStreamingResponse",
"AsyncAgenticSystemResourceWithStreamingResponse",
"AgentsResource",
"AsyncAgentsResource",
"AgentsResourceWithRawResponse",
"AsyncAgentsResourceWithRawResponse",
"AgentsResourceWithStreamingResponse",
"AsyncAgentsResourceWithStreamingResponse",
"DatasetsResource",
"AsyncDatasetsResource",
"DatasetsResourceWithRawResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
TurnsResourceWithStreamingResponse,
AsyncTurnsResourceWithStreamingResponse,
)
from .agents import (
AgentsResource,
AsyncAgentsResource,
AgentsResourceWithRawResponse,
AsyncAgentsResourceWithRawResponse,
AgentsResourceWithStreamingResponse,
AsyncAgentsResourceWithStreamingResponse,
)
from .sessions import (
SessionsResource,
AsyncSessionsResource,
Expand All @@ -24,14 +32,6 @@
SessionsResourceWithStreamingResponse,
AsyncSessionsResourceWithStreamingResponse,
)
from .agentic_system import (
AgenticSystemResource,
AsyncAgenticSystemResource,
AgenticSystemResourceWithRawResponse,
AsyncAgenticSystemResourceWithRawResponse,
AgenticSystemResourceWithStreamingResponse,
AsyncAgenticSystemResourceWithStreamingResponse,
)

__all__ = [
"SessionsResource",
Expand All @@ -52,10 +52,10 @@
"AsyncTurnsResourceWithRawResponse",
"TurnsResourceWithStreamingResponse",
"AsyncTurnsResourceWithStreamingResponse",
"AgenticSystemResource",
"AsyncAgenticSystemResource",
"AgenticSystemResourceWithRawResponse",
"AsyncAgenticSystemResourceWithRawResponse",
"AgenticSystemResourceWithStreamingResponse",
"AsyncAgenticSystemResourceWithStreamingResponse",
"AgentsResource",
"AsyncAgentsResource",
"AgentsResourceWithRawResponse",
"AsyncAgentsResourceWithRawResponse",
"AgentsResourceWithStreamingResponse",
"AsyncAgentsResourceWithStreamingResponse",
]
Loading

0 comments on commit e00013a

Please sign in to comment.