@@ -279,7 +279,7 @@ def __init__(self, langbase_client: Langbase, debug: bool = False):
279279 langbase_client: Langbase client instance
280280 debug: Whether to enable debug mode
281281 """
282- self .lb = langbase_client
282+ self .langbase = langbase_client
283283 self .workflow = Workflow (debug = debug )
284284
285285 async def generate_blog_post (
@@ -299,7 +299,7 @@ async def generate_blog_post(
299299
300300 # Step 1: Generate outline
301301 async def create_outline ():
302- response = self .lb .agent .run (
302+ response = self .langbase .agent .run (
303303 input = f"Create a { target_length } blog post outline about: { topic } " ,
304304 model = "openai:gpt-4o-mini" ,
305305 api_key = os .environ .get ("LLM_API_KEY" ),
@@ -309,7 +309,7 @@ async def create_outline():
309309 # Step 2: Generate introduction
310310 async def write_introduction ():
311311 outline = self .workflow .context ["outputs" ]["outline" ]
312- response = self .lb .agent .run (
312+ response = self .langbase .agent .run (
313313 input = f"Write an engaging introduction for this outline: { outline } . Tone: { tone } " ,
314314 model = "openai:gpt-4o-mini" ,
315315 api_key = os .environ .get ("LLM_API_KEY" ),
@@ -320,7 +320,7 @@ async def write_introduction():
320320 async def write_main_content ():
321321 outline = self .workflow .context ["outputs" ]["outline" ]
322322 intro = self .workflow .context ["outputs" ]["introduction" ]
323- response = self .lb .agent .run (
323+ response = self .langbase .agent .run (
324324 input = f"Write the main content based on outline: { outline } \n Introduction: { intro } \n Tone: { tone } " ,
325325 model = "openai:gpt-4o-mini" ,
326326 api_key = os .environ .get ("LLM_API_KEY" ),
@@ -331,7 +331,7 @@ async def write_main_content():
331331 async def write_conclusion ():
332332 outline = self .workflow .context ["outputs" ]["outline" ]
333333 content = self .workflow .context ["outputs" ]["main_content" ]
334- response = self .lb .agent .run (
334+ response = self .langbase .agent .run (
335335 input = f"Write a conclusion for this content: { content [:500 ]} ..." ,
336336 model = "openai:gpt-4o-mini" ,
337337 api_key = os .environ .get ("LLM_API_KEY" ),
@@ -392,8 +392,8 @@ async def advanced_workflow_example():
392392 print ("\n 🚀 Advanced Workflow Example" )
393393 print ("=" * 50 )
394394
395- lb = Langbase (api_key = os .environ .get ("LANGBASE_API_KEY" ))
396- blog_workflow = AIContentWorkflow (lb , debug = True )
395+ langbase = Langbase (api_key = os .environ .get ("LANGBASE_API_KEY" ))
396+ blog_workflow = AIContentWorkflow (langbase , debug = True )
397397
398398 result = await blog_workflow .generate_blog_post (
399399 topic = "The Future of Artificial Intelligence" ,
0 commit comments