Skip to content

Commit 0415a5e

Browse files
committed
fix examples
1 parent 1e0a56b commit 0415a5e

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

src/examples/mistral_example/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
from examples.mistral_example.complete import chat_complete
33
from examples.mistral_example.complete_async import complete_async
44
from examples.mistral_example.embeddings import embeddings_create
5-
from langtrace_python_sdk import with_langtrace_root_span
5+
from langtrace_python_sdk import langtrace, with_langtrace_root_span
66

7+
langtrace.init()
78

89
class MistralRunner:
910
@with_langtrace_root_span("Mistral")

src/examples/mistral_example/complete.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
from dotenv import find_dotenv, load_dotenv
2-
from langtrace_python_sdk import langtrace, with_langtrace_root_span
2+
from langtrace_python_sdk import with_langtrace_root_span
33
from mistralai import Mistral
44

55
_ = load_dotenv(find_dotenv())
66

7-
langtrace.init()
8-
97
@with_langtrace_root_span("chat_complete")
108
def chat_complete():
119
model = "mistral-large-latest"

src/examples/mistral_example/complete_async.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
from dotenv import find_dotenv, load_dotenv
2-
from langtrace_python_sdk import langtrace, with_langtrace_root_span
2+
from langtrace_python_sdk import with_langtrace_root_span
33
from mistralai import Mistral
44

55
_ = load_dotenv(find_dotenv())
66

7-
langtrace.init()
8-
97
@with_langtrace_root_span("chat_complete_async")
108
async def complete_async():
119
client = Mistral()

src/examples/mistral_example/embeddings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
from dotenv import find_dotenv, load_dotenv
2-
from langtrace_python_sdk import langtrace, with_langtrace_root_span
2+
from langtrace_python_sdk import with_langtrace_root_span
33
from mistralai import Mistral
44

55
_ = load_dotenv(find_dotenv())
66

7-
langtrace.init()
8-
97

108
@with_langtrace_root_span("create_embeddings")
119
def embeddings_create():

0 commit comments

Comments
 (0)