Skip to content
Open
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
3 changes: 3 additions & 0 deletions packages/sample-app/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ dependencies = [
"fastmcp>=2.12.3,<3",
"agno>=2.4.0,<3",
"voyageai>=0.3.7",
"aleph-alpha-client>=7.1.0,<8",
"opentelemetry-instrumentation-openai",
"opentelemetry-instrumentation-haystack",
"opentelemetry-instrumentation-pinecone",
Expand All @@ -64,6 +65,7 @@ dependencies = [
"opentelemetry-instrumentation-anthropic",
"opentelemetry-instrumentation-bedrock",
"opentelemetry-instrumentation-voyageai",
"opentelemetry-instrumentation-alephalpha",
"traceloop-sdk",
]

Expand All @@ -84,6 +86,7 @@ opentelemetry-instrumentation-agno = { path = "../opentelemetry-instrumentation-
opentelemetry-instrumentation-anthropic = { path = "../opentelemetry-instrumentation-anthropic", editable = true }
opentelemetry-instrumentation-bedrock = { path = "../opentelemetry-instrumentation-bedrock", editable = true }
opentelemetry-instrumentation-voyageai = { path = "../opentelemetry-instrumentation-voyageai", editable = true }
opentelemetry-instrumentation-alephalpha = { path = "../opentelemetry-instrumentation-alephalpha", editable = true }
traceloop-sdk = { path = "../traceloop-sdk", editable = true }

[dependency-groups]
Expand Down
31 changes: 31 additions & 0 deletions packages/sample-app/sample_app/alephalpha_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os

from aleph_alpha_client import Client, CompletionRequest, Prompt
from traceloop.sdk import Traceloop
from traceloop.sdk.decorators import task, workflow


Traceloop.init(app_name="alephalpha_example")

client = Client(token=os.environ.get("ALEPH_ALPHA_API_KEY") or os.environ.get("AA_TOKEN"))


@task(name="complete_prompt")
def complete_prompt():
request = CompletionRequest(
prompt=Prompt.from_text("Tell me one sentence about OpenTelemetry."),
maximum_tokens=64,
)

response = client.complete(request, model="luminous-base")
return response.completions[0].completion


@workflow(name="alephalpha_completion_demo")
def alephalpha_completion_demo():
completion = complete_prompt()
print(completion)


if __name__ == "__main__":
alephalpha_completion_demo()