File tree Expand file tree Collapse file tree
packages/sample-app/sample_app Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from traceloop .sdk import Traceloop
55from traceloop .sdk .decorators import workflow
66
7- # Initialize with console exporter for debugging
8- Traceloop .init (
9- app_name = "gemini_example" ,
10- )
7+ Traceloop .init (app_name = "gemini_example" )
118
12- # Configure client with API key
139client = genai .Client (api_key = os .environ .get ("GENAI_API_KEY" ))
1410
1511
@@ -40,19 +36,13 @@ async def async_predict_text() -> str:
4036@workflow ("chat" )
4137def chat () -> str :
4238 """Chat example with a Large Language Model"""
43-
44- # For chat, we'll simulate with multiple generate_content calls
45- response1 = client .models .generate_content (
46- model = "gemini-1.5-pro-002" ,
47- contents = "Hello, how are you?" ,
48- )
4939
50- response2 = client .models .generate_content (
40+ response = client .models .generate_content (
5141 model = "gemini-1.5-pro-002" ,
5242 contents = "What is the capital of France?" ,
5343 )
5444
55- return response2 .text
45+ return response .text
5646
5747
5848if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments