1Q896nRvyY2idcqEJOivT9g

Tomé un cuaderno OpenAI y lo puse a funcionar en un entorno Colab…

Tabla de contenidos

Consideraciones clave para la creación de aplicaciones de agentes

Mientras prototipaba agentes de IA con los cuadernos de OpenAI, me topé con su API y modelo de investigación; esto me generó algunas ideas interesantes sobre los agentes de IA…
La complejidad debe residir en algún lugar del sistema.

Podrías delegarla al proveedor del modelo, dejándole que se encargue del trabajo pesado por una tarifa, pero eso a menudo implica sacrificar el control preciso sobre el funcionamiento de las cosas.

Sin embargo, para las empresas, tiene sentido integrar esa complejidad en su propia pila y gestionarla internamente.

Ahí es donde entran en juego las verdaderas eficiencias: la personalización según las necesidades sin depender de soluciones de caja negra.

El cuaderno que comparto a continuación muestra una aplicación de agentes que coordina un equipo de agentes de IA, cada uno con una función distinta.

Cada agente se construye en torno a un modelo de lenguaje personalizado, elegido para alinearse con las exigencias de la tarea en términos de coste y sofisticación.

De esta manera, no se sobrecargan las tareas sencillas con modelos complejos ni se escatiman las complejas.

En esta configuración, me baso en agentes de IA orientados a la investigación, impulsados por una API y un modelo de investigación dedicados, en lugar de agentes de propósito general.
Un par de desventajas a tener en cuenta…

En primer lugar, las respuestas de esta API y modelo tardan considerablemente más y probablemente tengan un coste adicional (aunque aún no he calculado los costes).

En segundo lugar, los resultados son muy detallados y completos, lo que explica la mayor latencia: se realiza un razonamiento más profundo en segundo plano.

Esto plantea un dilema fundamental en el diseño de aplicaciones de agentes: ¿Debería delegarse todo el proceso de investigación a las capacidades integradas del modelo o integrarse como código personalizado en el propio agente?

Se trata de encontrar el equilibrio adecuado: ¿cuánto aprovechas las funciones estándar del modelo en comparación con desarrollar las tuyas propias para que se ajusten a tu flujo de trabajo?

Working Notebook

Tuve que hacer algunos cambios en el cuaderno compartido por OpenAI para que funcionara…
Ejecutar las instalaciones iniciales…

 %pip install --upgrade "openai>=1.88" "openai-agents>=0.0.19"

Configuré mi clave API de OpenAI en la funcionalidad de secretos de Colab…

OpenAI

El sistema desactiva la retención de datos mediante la configuración os.environ que aparece a continuación, lo que permite a las empresas operar en un entorno de cero retención de datos con investigación profunda.

Si la retención de datos no es una restricción activa para los usuarios, deberían considerar mantenerla activada para beneficiarse de la trazabilidad automatizada de los flujos de trabajo de sus agentes de IA y de una integración profunda con otras herramientas de la plataforma, como evaluaciones y ajustes.

import os
from agents import Agent, Runner, WebSearchTool, RunConfig, set_default_openai_client, HostedMCPTool
from typing import List, Dict, Optional
from pydantic import BaseModel
from openai import AsyncOpenAI
from google.colab import userdata

# Use env var for API key and set a long timeout
client = AsyncOpenAI(api_key=userdata.get('OPENAI_API_KEY'), timeout=600.0)
set_default_openai_client(client)
os.environ["OPENAI_AGENTS_DISABLE_TRACING"] = "1" # Disable tracing for Zero Data Retention (ZDR) Organizations

Agente de Investigación Profunda Básica

El Agente de Investigación Profunda Básica realiza Investigación Profunda utilizando el modelo o4-mini-deep-research-alpha.

Tiene acceso nativo de WebSearch a internet público y transmite sus hallazgos directamente al notebook.

En este caso, se utiliza el modelo o4-mini-deep-research-alpha porque es más rápido que el modelo completo de investigación profunda o3, con una inteligencia aceptable.

# Define the research agent
research_agent = Agent(
name="Research Agent",
model="o4-mini-deep-research-2025-06-26",
tools=[WebSearchTool()],
instructions="You perform deep empirical research based on the user's question."
)

# Async function to run the research and print streaming progress
async def basic_research(query):
print(f"Researching: {query}")
result_stream = Runner.run_streamed(
research_agent,
query
)

async for ev in result_stream.stream_events():
if ev.type == "agent_updated_stream_event":
print(f"\n--- switched to agent: {ev.new_agent.name} ---")
print(f"\n--- RESEARCHING ---")
elif (
ev.type == "raw_response_event"
and hasattr(ev.data, "item")
and hasattr(ev.data.item, "action")
and ev.data.item.action is not None # Add this check
):
action = ev.data.item.action
if action.type == "search":
print(f"[Web search] query={action.query!r}")

# streaming is complete → final_output is now populated
return result_stream.final_output

# Run the research and print the result
result = await basic_research("Research the economic impact of semaglutide on global healthcare systems.")
print(result)

El output:

Researching: Research the economic impact of semaglutide on global healthcare systems.

--- switched to agent: Research Agent ---

--- RESEARCHING ---
[Web search] query='economic impact semaglutide global healthcare'
[Web search] query='semaglutide economic impact healthcare cost obesity diabetes'
[Web search] query='semaglutide healthcare cost global budgets impact'
[Web search] query='semaglutide global health economic impact system analysis'
[Web search] query='budget semaglutide UK NHS obesity cost'
[Web search] query='semaglutide NHS budget shortage injunction shortage cost obesity Denmark'
[Web search] query='cost of obesity global economy healthcare semaglutide'
[Web search] query='semaglutide WHO global cost access obesity inclusion'
[Web search] query='"Exclusive-WHO to back use of weight-loss drugs for adults globally"'
[Web search] query='semaglutide global healthcare budget shortages obesity insurance'
[Web search] query='"In only nine was obesity pharmacotherapy made available"'
[Web search] query='global semaglutide market size 2024 revenue'
# Overview of Semaglutide and Health Economics

Semaglutide (brand names Ozempic/Wegovy/Rybelsus) is a GLP-1 receptor agonist approved for type-2 diabetes and obesity management. It potently lowers blood sugar and body weight, reducing complications and improving outcomes. These clinical benefits offer the potential to decrease long-term healthcare use (e.g. fewer heart attacks or kidney disease), but semaglutide’s high price raises concerns about short-term costs. Global spending on diabetes care alone is enormous – roughly **US$966 billion in 2021** for adults worldwide ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC12094200/#:~:text=The%20economic%20burden%20of%20type,value%2C%20preventive%20health)) – so any effective intervention could offset parts of that cost. Nonetheless, semaglutide therapy currently costs on the order of **>$1,000 USD per month** ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/who-set-back-use-weight-loss-drugs-adults-globally-raises-cost-issue-2025-05-01/#:~:text=The%20World%20Health%20Organization%20,and%20may%20require%20lifelong%20usage)), which can strain health budgets if used broadly. Health economists therefore emphasize a careful balance: semaglutide may yield long-term savings by preventing obesity-related illness, but its **up-front expense** means healthcare systems must target use rigorously.

# Cost-Effectiveness Analyses

Numerous studies have evaluated semaglutide’s cost-effectiveness compared to other treatments. In type-2 diabetes, a 2025 systematic review/meta-analysis of 119 comparisons across Europe, North America, and China found semaglutide to be *dominant or cost-effective* in about **73.9% of trials** ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC12094200/#:~:text=DATA%20SYNTHESIS)). However, results often varied by study sponsorship and assumptions: industry-sponsored analyses uniformly showed semaglutide as cost-effective, whereas non-industry studies found it cost-effective only about half the time ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC12094200/#:~:text=DATA%20SYNTHESIS)). In general, semaglutide’s superior glucose and weight control translates into more *quality-adjusted life-years* (QALYs) gained than older glucose-lowering drugs, and in many models the extra health benefit justifies its cost.

For obesity management (in patients without diabetes), the picture is more mixed. One recent systematic review of cost-effectiveness in obese adults found that **semaglutide delivers more QALYs but at much higher cost** than alternative therapies ([pubmed.ncbi.nlm.nih.gov](https://pubmed.ncbi.nlm.nih.gov/39254692/#:~:text=Conclusion%3A%20The%20current%20systematic%20review,sleeve%20gastroplasty%2C%20and%20gastric%20bypass)). The incremental cost-effectiveness ratio (ICER) often exceeds typical willingness-to-pay thresholds, meaning its price is the main barrier. For example, one analysis projected **lifetime per-person costs** of about **$370,000 USD** for semaglutide (BMI 33), versus ~$125,000–$140,000 for bariatric or other interventions ([pubmed.ncbi.nlm.nih.gov](https://pubmed.ncbi.nlm.nih.gov/39254692/#:~:text=class%20I%20obesity%20,126%2C732%3B%20%24139%2C971%3B%20and%20%24370%2C776%2C%20respectively)). In summary, semaglutide can be cost-effective *only if* its price is substantially lowered or its use is limited to patients most likely to benefit.

Even in high-risk subgroups, semaglutide may not meet standard cost-effectiveness cutoffs at current prices. A Canadian modeling study of obese patients with cardiovascular disease (but without diabetes) found semaglutide’s ICER ≈ **C$72,962 per QALY**, exceeding the common threshold (~C$50,000) ([www.news-medical.net](https://www.news-medical.net/news/20250109/Statistical-model-analyzes-the-cost-effectiveness-of-semaglutide-for-non-diabetic-obese-individuals.aspx#:~:text=is%20considered%20acceptable%20healthcare%20value,effectiveness%20at%20a%20CAN%2450%2C000%2FQALY%20threshold)). With this pricing it had just a 14% chance of being “worth it.” However, if its price were cut by **50%** the ICER fell to ~C$37,190/QALY (with an ~80% chance of being cost-effective) ([www.news-medical.net](https://www.news-medical.net/news/20250109/Statistical-model-analyzes-the-cost-effectiveness-of-semaglutide-for-non-diabetic-obese-individuals.aspx#:~:text=is%20considered%20acceptable%20healthcare%20value,effectiveness%20at%20a%20CAN%2450%2C000%2FQALY%20threshold)). In short, without discounts, semaglutide often fails conventional cost-effectiveness tests in obesity. The pattern is consistent: at today’s list price it yields significant health gains, but the extra cost is high. If price drops into range (e.g. via generics or rebates), many studies predict it would then represent good value.

> **Key cost-effectiveness findings:**
> - *Type 2 diabetes:* Semaglutide was found dominant or cost-effective vs. other drugs in ~74% of models ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC12094200/#:~:text=DATA%20SYNTHESIS)).
> - *Obesity:* Compared to diet/exercise or older drugs (e.g. liraglutide), semaglutide adds QALYs but at ~$30k–40k extra cost per QALY ([pubmed.ncbi.nlm.nih.gov](https://pubmed.ncbi.nlm.nih.gov/39254692/#:~:text=Conclusion%3A%20The%20current%20systematic%20review,sleeve%20gastroplasty%2C%20and%20gastric%20bypass)) ([www.news-medical.net](https://www.news-medical.net/news/20250109/Statistical-model-analyzes-the-cost-effectiveness-of-semaglutide-for-non-diabetic-obese-individuals.aspx#:~:text=is%20considered%20acceptable%20healthcare%20value,effectiveness%20at%20a%20CAN%2450%2C000%2FQALY%20threshold)).
> - *Budget thresholds:* Many models fail to meet typical $50k/QALY benchmarks unless prices fall by roughly half ([www.news-medical.net](https://www.news-medical.net/news/20250109/Statistical-model-analyzes-the-cost-effectiveness-of-semaglutide-for-non-diabetic-obese-individuals.aspx#:~:text=For%20overweight%20or%20obese%20individuals,An%20article%20in)) ([www.news-medical.net](https://www.news-medical.net/news/20250109/Statistical-model-analyzes-the-cost-effectiveness-of-semaglutide-for-non-diabetic-obese-individuals.aspx#:~:text=is%20considered%20acceptable%20healthcare%20value,effectiveness%20at%20a%20CAN%2450%2C000%2FQALY%20threshold)).

# Health System Budget Impacts

Semaglutide’s adoption has significant budget implications for public and private payers. Even if it prevents costly complications later, broad subsidization entails **large upfront spending**. For example, in the UK the National Health Service (NHS) spent about **£107 million (~$135M USD)** on semaglutide injections in one year (making it the 11th largest drug cost) ([www.diabetes.co.uk](https://www.diabetes.co.uk/news/2023/jun/obesity-epidemic-drives-nhs-prescription-cost-past-10-billion.html#:~:text=Otherwise%20known%20as%20Ozempic%20and,th%7D%20most%20expensive%20prescription%20drug)). The UK government is now piloting broader use for obesity, but NICE restricts it to very obese patients: NHS guidance limits Wegovy (semaglutide) to those with BMI≥35 (or ≥30 with comorbidity) and only for up to 2 years ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC10921848/#:~:text=In%202022%2C%20the%20UK%20National,only%20extend%20out%20to%202)). This reflects the trade-off: NICE judged semaglutide cost-effective only under those strict conditions, given its high price.

In modeled scenarios, expanding access can produce substantial downstream savings. U.S. analysts using microsimulation have estimated that broad Medicare coverage of GLP-1 drugs could **save hundreds of billions** in future costs. For instance, one model projected that covering semaglutide for all eligible patients in Medicare would offset roughly **$245 billion** in Part A/B spending over 10 years (and $1.4 trillion over 30 years) by preventing comorbidities ([www.ncbi.nlm.nih.gov](https://www.ncbi.nlm.nih.gov/books/NBK609400/#:~:text=The%20scenario%20in%20which%20both,would%20lead%20to%20a%209)). Extending coverage to Medicaid and uninsured yields even larger “social benefits” – on the order of **$4 trillion in 10 years** ([www.ncbi.nlm.nih.gov](https://www.ncbi.nlm.nih.gov/books/NBK609400/#:~:text=disease%29,within%2020%20years%2C%20and%20over)). In these analyses, most savings came from avoided hospitalizations and less advanced disease. Thus, while annual drug spending would rise, the net effect could be a budgetary *break-even or gain* over decades.

Other countries face similar calculations. A 2024 budget-impact study in Saudi Arabia found that adding oral semaglutide to the diabetes program would increase immediate drug budgets, but lead to better patient outcomes ([pubmed.ncbi.nlm.nih.gov](https://pubmed.ncbi.nlm.nih.gov/37933169/#:~:text=Budget%20impact%20of%20introducing%20oral,with%20diabetes%20an%20essential%20part)) ([pubmed.ncbi.nlm.nih.gov](https://pubmed.ncbi.nlm.nih.gov/39254692/#:~:text=The%20cost,patients%20with%20obesity%20or%20overweight)). In public health terms, treating obesity and diabetes aggressively may reduce costs of related conditions (heart disease, kidney failure, etc.). One report by ING Bank estimated that UK obesity costs ~£100 billion per year (with £19bn on healthcare alone) ([www.theguardian.com](https://www.theguardian.com/society/2024/sep/22/health-productivity-losses-obesity-weight-loss-jab-costs#:~:text=The%20ING%20healthcare%20analyst%20Diederik,and%20%E2%82%AC2%2C500%20in%20the%20US)). By comparison, a year’s supply of Ozempic costs only £830 in the UK ([www.theguardian.com](https://www.theguardian.com/society/2024/sep/22/health-productivity-losses-obesity-weight-loss-jab-costs#:~:text=A%20year%E2%80%99s%20supply%20of%20Ozempic%2C,Netherlands%20and%20%E2%82%AC14%2C500%20in%20the)) – meaning even widespread semaglutide treatment could be cheaper than doing nothing. The ING analyst concluded that long-term savings from obesity drugs could vastly outweigh drug costs, if their weight-loss effects persist ([www.theguardian.com](https://www.theguardian.com/society/2024/sep/22/health-productivity-losses-obesity-weight-loss-jab-costs#:~:text=%E2%80%9CIf%20the%20drugs%20are%20effective,save%20society%20money%2C%E2%80%9D%20he%20said)).

However, this optimistic view is tempered by realities of current budgets. In the UK, one productivity analysis found that each semaglutide-treated person gained ~5 extra workdays per year, translating to ~£1,127 in productivity value per person ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=A%20new%20study%2C%20presented%20at,well%20as%20reducing%20their%20consumption)). Across the eligible population this implied ~£4.5 billion/year in economic gains (plus smaller health savings) ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=Giving%20weight%20loss%20jabs%20to,5bn%2C%20according%20to%20research)) ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=A%20new%20study%2C%20presented%20at,well%20as%20reducing%20their%20consumption)). But experts cautioned these gains do not immediately pay for the drugs: the roughly **£2,500 per patient per year** cost (for Wegovy) means total drug spend would *exceed* these societal savings ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=society%20from%20weight%20loss%20medication,total%20health%20and%20societal%20gains)). In practical terms: treating every eligible person now is unaffordable, so most systems focus on **high-risk groups** (highest BMI or comorbidities) where cost-offsets are greatest ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=society%20from%20weight%20loss%20medication,total%20health%20and%20societal%20gains)) ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=In%20terms%20of%20AOMs%E2%80%99%20inclusion,economic%20ones%2C%20to%20evaluate%20true)).

> **Budget impact examples:**
> - *United Kingdom:* NHS spent ~£107M on semaglutide in 2022/23 ([www.diabetes.co.uk](https://www.diabetes.co.uk/news/2023/jun/obesity-epidemic-drives-nhs-prescription-cost-past-10-billion.html#:~:text=Otherwise%20known%20as%20Ozempic%20and,th%7D%20most%20expensive%20prescription%20drug)) and restricts its use to BMI≥35 patients ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC10921848/#:~:text=In%202022%2C%20the%20UK%20National,only%20extend%20out%20to%202)). A study found £4.5 bn in potential productivity gains if all eligible were treated ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=Giving%20weight%20loss%20jabs%20to,5bn%2C%20according%20to%20research)), but drug costs far exceed those gains ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=society%20from%20weight%20loss%20medication,total%20health%20and%20societal%20gains)).
> - *United States:* Simulations indicate Medicare coverage of GLP-1 drugs could recover ~$245–704 bn in healthcare spending over 10–30 years ([www.ncbi.nlm.nih.gov](https://www.ncbi.nlm.nih.gov/books/NBK609400/#:~:text=The%20scenario%20in%20which%20both,would%20lead%20to%20a%209)). Early expanded coverage (Medicare + private) yields even larger offsets (>$1.4 tn in 30 years) ([www.ncbi.nlm.nih.gov](https://www.ncbi.nlm.nih.gov/books/NBK609400/#:~:text=The%20scenario%20in%20which%20both,would%20lead%20to%20a%209)).
> - *Saudi Arabia:* Introducing semaglutide into public formularies raises immediate costs but is projected to improve outcomes (analyses ongoing) ([pubmed.ncbi.nlm.nih.gov](https://pubmed.ncbi.nlm.nih.gov/37933169/#:~:text=Budget%20impact%20of%20introducing%20oral,with%20diabetes%20an%20essential%20part)) ([pubmed.ncbi.nlm.nih.gov](https://pubmed.ncbi.nlm.nih.gov/39254692/#:~:text=The%20cost,patients%20with%20obesity%20or%20overweight)).

# Global Market and Access Trends

Semaglutide’s economic impact unfolds in a **global market** that is rapidly expanding. The global weight-loss drug market (dominated by GLP-1 therapies like Wegovy/Ozempic) is estimated at **US$80–140 billion** ([www.ft.com](https://www.ft.com/content/3f03b203-72a8-4921-9ecc-0c9ea9ec0f62#:~:text=help%20treat%20obesity%2C%20which%20in,Hikma%E2%80%99s)). Soaring demand has already forced insurers and governments to ration access at current prices ([www.ft.com](https://www.ft.com/content/3f03b203-72a8-4921-9ecc-0c9ea9ec0f62#:~:text=help%20treat%20obesity%2C%20which%20in,Hikma%E2%80%99s)). For example, the FT reports that some European health systems and private payers are limiting semaglutide use due to cost ([www.ft.com](https://www.ft.com/content/3f03b203-72a8-4921-9ecc-0c9ea9ec0f62#:~:text=help%20treat%20obesity%2C%20which%20in,Hikma%E2%80%99s)). By contrast, manufacturers see blockbuster sales: Novo Nordisk’s Wegovy was prescribed to tens of thousands in H2 2024 ([www.ft.com](https://www.ft.com/content/dcc1e573-0b5d-4d3a-a581-abd93388ff76#:~:text=2024,The%20company%20is%20now%20prescribing)), and China and India have recently approved or are expected to approve it ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/novo-nordisk-says-semaglutide-approved-long-term-weight-management-china-2024-06-25/#:~:text=2024,key%20ingredient%2C%20is%20set%20to)) ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/demand-obesity-drugs-shoots-up-india-lilly-novo-jostle-market-share-2025-07-07/#:~:text=2025,doubling%20its%20sales%20in%20June)), tapping massive populations.

Patent expiries and generic competition are poised to reshape economics soon. Semaglutide’s composition will lose marketing exclusivity in major markets in **2026–2027** ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=As%20in%20HICs%2C%20out,reduce%20obesity%20and%20downstream%20comorbidities)) ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/who-set-back-use-weight-loss-drugs-adults-globally-raises-cost-issue-2025-05-01/#:~:text=WHO%20plans%20to%20release%20updated,cost%20option)). Generic manufacturers (e.g. Hikma) are developing copycat versions that typically cost **80–85% less than branded drugs ([www.ft.com](https://www.ft.com/content/3f03b203-72a8-4921-9ecc-0c9ea9ec0f62#:~:text=Hikma%2C%20a%20major%20drugmaker%2C%20is,Hikma%E2%80%99s)). When generics arrive, the price of semaglutide-like therapies could drop dramatically. The WHO and IQVIA anticipate that falling prices will be crucial for wider adoption, especially in lower-income countries ([globalsouthworld.com](https://globalsouthworld.com/article/exclusive-who-set-to-back-use-of-weight-loss-drugs-for-adults-globally-raises-cost-issue#:~:text=But%20it%20also%20notes%20that,in%20some%20markets%20next%20year)) ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=For%20LMICs%2C%20people%20with%20obesity,or%20other%20forms%20of%20socio)). For instance, the WHO notes that semaglutide’s patent expiry will allow *cheaper generics* next year ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/who-set-back-use-weight-loss-drugs-adults-globally-raises-cost-issue-2025-05-01/#:~:text=WHO%20plans%20to%20release%20updated,cost%20option)). Lower-cost competition could enable many health systems to expand coverage beyond current high-risk limits.

Even without generics, some risk-sharing deals have emerged. For instance, the UK NHS negotiated outcomes-based agreements with manufacturers (like the one for tirzepatide) to cap costs for certain patient groups ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=In%20terms%20of%20AOMs%E2%80%99%20inclusion,economic%20ones%2C%20to%20evaluate%20true)). In the U.S., some insurers and Medicare pilots are beginning to cover GLP-1 drugs for obesity (e.g. Medicare covers older adults with cardiac risk factors) ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=In%20terms%20of%20AOMs%E2%80%99%20inclusion,economic%20ones%2C%20to%20evaluate%20true)). Across Europe and North America, the pattern is cautious expansion: most national programs still require severe obesity (BMI≥35) and limited duration ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC10921848/#:~:text=In%202022%2C%20the%20UK%20National,only%20extend%20out%20to%202)), even as research bodies (NICE, WHO) validate their health value ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC10921848/#:~:text=In%202022%2C%20the%20UK%20National,only%20extend%20out%20to%202)) ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/weight-loss-drugs-could-help-end-obesity-risks-remain-who-says-2024-12-18/#:~:text=Wegovy%2C%20Mounjaro%2C%20and%20Zepbound,are%20expected%20by%20July%202025)).

# Equity and Global Access

A critical economic concern is **inequality in access**. Currently, GLP-1 drugs are far more accessible to patients with diabetes (where they are labeled) than to patients with obesity alone. One commentary notes that in practice, “patients with diabetes have greater access to GLP-1 therapy than those with overweight and obesity without diabetes” ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC10921848/#:~:text=%28with%20semaglutide%20preferable%20to%20liraglutide%29,2)). Insurance and national formularies often restrict coverage to approved indications, so many obese patients pay fully out-of-pocket (or go without).

Global disparities are stark. A survey of 23 European countries found only **9 allowed any obesity pharmacotherapy**, while most did not reimburse drugs at all ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC10921848/#:~:text=Obesity%20management%20standards%20and%20coverage,centered%20approach%20that%20includes)). Similarly, many low- and middle-income countries (LMICs) have no public coverage for these new drugs, even though 70% of the world’s 1+ billion obese people live in LMICs ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/who-set-back-use-weight-loss-drugs-adults-globally-raises-cost-issue-2025-05-01/#:~:text=The%20World%20Health%20Organization%20,and%20may%20require%20lifelong%20usage)). The WHO is now urging equitable access: it plans to endorse GLP-1 drugs for adult obesity treatment and consider them for the Essential Medicines List ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/who-set-back-use-weight-loss-drugs-adults-globally-raises-cost-issue-2025-05-01/#:~:text=WHO%20plans%20to%20release%20updated,cost%20option)). But it explicitly acknowledges cost barriers. WHO’s draft guidance highlights the need for long-term cost-effectiveness data and recommends pooled procurement or tiered pricing to improve affordability ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/who-set-back-use-weight-loss-drugs-adults-globally-raises-cost-issue-2025-05-01/#:~:text=WHO%20plans%20to%20release%20updated,cost%20option)). In other words, global health authorities see semaglutide as a powerful tool but emphasize that **without price reductions or subsidies, many populations will remain excluded**.

> **Access challenges:**
> - *High-income countries:* Even where approved, many restrict semaglutide to severe cases. NICE (UK) allows only BMI≥35 (or ≥30 with comorbidity) for up to 2 years ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC10921848/#:~:text=In%202022%2C%20the%20UK%20National,only%20extend%20out%20to%202)), and most insurers require strict criteria.
> - *Low/Middle-income countries:* Semaglutide is mostly not government-funded yet. Out-of-pocket purchases dominate ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=As%20in%20HICs%2C%20out,reduce%20obesity%20and%20downstream%20comorbidities)) ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=For%20LMICs%2C%20people%20with%20obesity,or%20other%20forms%20of%20socio)). Experts warn that until generics arrive, it will remain largely inaccessible outside private markets.
> - *Equity dept:* Efforts like potential WHO listing and tiered pricing aim to narrow the gap ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/who-set-back-use-weight-loss-drugs-adults-globally-raises-cost-issue-2025-05-01/#:~:text=WHO%20plans%20to%20release%20updated,cost%20option)), but widespread access will likely wait for cheaper generics ([globalsouthworld.com](https://globalsouthworld.com/article/exclusive-who-set-to-back-use-of-weight-loss-drugs-for-adults-globally-raises-cost-issue#:~:text=But%20it%20also%20notes%20that,in%20some%20markets%20next%20year)) ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=For%20LMICs%2C%20people%20with%20obesity,or%20other%20forms%20of%20socio)).

# Societal and Productivity Benefits

Beyond direct healthcare budgets, semaglutide’s diffusion can have broader economic effects. By enabling weight loss and diabetes control, it may keep people healthier and in the workforce longer. For example, one recent UK analysis of semaglutide trial data found treated patients worked **~5 more days** per year (and performed ~12 more days of unpaid work), on average ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=A%20new%20study%2C%20presented%20at,well%20as%20reducing%20their%20consumption)). Extrapolated nationally, this implies **£4.31 billion per year** in productivity gains for severely obese people (and £0.2bn for eligible diabetics) ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=A%20new%20study%2C%20presented%20at,well%20as%20reducing%20their%20consumption)). Such gains accrue from reduced absenteeism and better day-to-day functioning.

These societal benefits are integral to economic impact. The ING Bank report cited earlier noted that obesity costs include lost productivity and personal expenses – roughly three-quarters of total obesity costs ([www.theguardian.com](https://www.theguardian.com/society/2024/sep/22/health-productivity-losses-obesity-weight-loss-jab-costs#:~:text=Healthcare%20costs%20represented%20roughly%20a,adapted%20living%20facilities%2C%20Stadig%20said)). If semaglutide’s weight-loss effects are durable, reduced obesity could translate into large labor-market gains and savings on private costs (transportation, special equipment, etc.). The challenge is that **these payoffs are long-term**, while drug costs hit budgets immediately. As a result, even optimistic analyses caution that governments “cannot afford to treat all” eligible people right now; instead, they should “prioritise those with highest needs” where cost offsets are greatest ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=society%20from%20weight%20loss%20medication,total%20health%20and%20societal%20gains)) ([www.theguardian.com](https://www.theguardian.com/society/2024/sep/22/health-productivity-losses-obesity-weight-loss-jab-costs#:~:text=Healthcare%20costs%20represented%20roughly%20a,adapted%20living%20facilities%2C%20Stadig%20said)).

# Conclusion

In sum, semaglutide represents a paradigm shift in metabolic care with profound economic implications. On the one hand, it can markedly reduce obesity-related illness, yielding huge health and productivity benefits for societies ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=A%20new%20study%2C%20presented%20at,well%20as%20reducing%20their%20consumption)) ([www.theguardian.com](https://www.theguardian.com/society/2024/sep/22/health-productivity-losses-obesity-weight-loss-jab-costs#:~:text=Healthcare%20costs%20represented%20roughly%20a,adapted%20living%20facilities%2C%20Stadig%20said)). Many cost-effectiveness studies and health models predict that, when targeted to the right patients, its long-term savings (fewer complications, hospitalizations, lost work) can offset its price. Indeed, broad coverage models in the U.S. anticipate hundreds of billions in future cost offsets ([www.ncbi.nlm.nih.gov](https://www.ncbi.nlm.nih.gov/books/NBK609400/#:~:text=The%20scenario%20in%20which%20both,would%20lead%20to%20a%209)).

On the other hand, **its high cost creates serious budgetary strain**. Most health systems currently restrict semaglutide use to severe cases (e.g. BMI≥35) and high-risk patients ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC10921848/#:~:text=In%202022%2C%20the%20UK%20National,only%20extend%20out%20to%202)) ([www.news-medical.net](https://www.news-medical.net/news/20250109/Statistical-model-analyzes-the-cost-effectiveness-of-semaglutide-for-non-diabetic-obese-individuals.aspx#:~:text=For%20overweight%20or%20obese%20individuals,An%20article%20in)). Even then, uptake can sharply raise drug budgets in the short run (as evidenced by NHS spending and payer hesitance ([www.diabetes.co.uk](https://www.diabetes.co.uk/news/2023/jun/obesity-epidemic-drives-nhs-prescription-cost-past-10-billion.html#:~:text=Otherwise%20known%20as%20Ozempic%20and,th%7D%20most%20expensive%20prescription%20drug)) ([www.ft.com](https://www.ft.com/content/3f03b203-72a8-4921-9ecc-0c9ea9ec0f62#:~:text=help%20treat%20obesity%2C%20which%20in,Hikma%E2%80%99s))). Policymakers face the tension that treating obesity at scale is desirable but unaffordable at today’s prices. The WHO and others are therefore pushing for measures to reduce prices (tiered pricing, generics) and to use the drugs within a comprehensive lifestyle strategy ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/who-set-back-use-weight-loss-drugs-adults-globally-raises-cost-issue-2025-05-01/#:~:text=WHO%20plans%20to%20release%20updated,cost%20option)) ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=For%20LMICs%2C%20people%20with%20obesity,or%20other%20forms%20of%20socio)).

**Bottom line:** Semaglutide has the potential to reduce total healthcare costs of obesity and diabetes considerably – but only if its price is managed or offset by long-term health gains. Until then, its economic impact is a tightrope between large upfront expenditures and the promise of future savings.

**Sources:** Cost-effectiveness analyses and budget impact studies ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC12094200/#:~:text=DATA%20SYNTHESIS)) ([pubmed.ncbi.nlm.nih.gov](https://pubmed.ncbi.nlm.nih.gov/39254692/#:~:text=Conclusion%3A%20The%20current%20systematic%20review,sleeve%20gastroplasty%2C%20and%20gastric%20bypass)) ([www.news-medical.net](https://www.news-medical.net/news/20250109/Statistical-model-analyzes-the-cost-effectiveness-of-semaglutide-for-non-diabetic-obese-individuals.aspx#:~:text=is%20considered%20acceptable%20healthcare%20value,effectiveness%20at%20a%20CAN%2450%2C000%2FQALY%20threshold)); modeling of coverage scenarios ([www.ncbi.nlm.nih.gov](https://www.ncbi.nlm.nih.gov/books/NBK609400/#:~:text=The%20scenario%20in%20which%20both,would%20lead%20to%20a%209)); health ministry reports and news on spending ([www.diabetes.co.uk](https://www.diabetes.co.uk/news/2023/jun/obesity-epidemic-drives-nhs-prescription-cost-past-10-billion.html#:~:text=Otherwise%20known%20as%20Ozempic%20and,th%7D%20most%20expensive%20prescription%20drug)) ([pmc.ncbi.nlm.nih.gov](https://pmc.ncbi.nlm.nih.gov/articles/PMC10921848/#:~:text=In%202022%2C%20the%20UK%20National,only%20extend%20out%20to%202)); global health policy commentary ([www.reuters.com](https://www.reuters.com/business/healthcare-pharmaceuticals/who-set-back-use-weight-loss-drugs-adults-globally-raises-cost-issue-2025-05-01/#:~:text=WHO%20plans%20to%20release%20updated,cost%20option)) ([www.ft.com](https://www.ft.com/content/3f03b203-72a8-4921-9ecc-0c9ea9ec0f62#:~:text=help%20treat%20obesity%2C%20which%20in,Hikma%E2%80%99s)) ([www.weforum.org](https://www.weforum.org/stories/2025/01/anti-obesity-medication-lower-middle-income-countries/#:~:text=In%20terms%20of%20AOMs%E2%80%99%20inclusion,economic%20ones%2C%20to%20evaluate%20true)); productivity research ([www.theguardian.com](https://www.theguardian.com/society/2025/may/09/weight-loss-jabs-bolster-uk-economy-study-semaglutide#:~:text=A%20new%20study%2C%20presented%20at,well%20as%20reducing%20their%20consumption)) ([www.theguardian.com](https://www.theguardian.com/society/2024/sep/22/health-productivity-losses-obesity-weight-loss-jab-costs#:~:text=Healthcare%20costs%20represented%20roughly%20a,adapted%20living%20facilities%2C%20Stadig%20said)). Each citation denotes specific findings as excerpted above.

Línea de investigación de cuatro agentes de IA

image 15

Enriquecimiento de las indicaciones del subagente

Las indicaciones de apoyo del agente de IA están diseñadas específicamente para mejorar la calidad del resultado final de la investigación, proporcionando estructura y rigor a la consulta inicial del usuario.

# ─────────────────────────────────────────────────────────────
# Prompts
# ─────────────────────────────────────────────────────────────

CLARIFYING_AGENT_PROMPT = """
If the user hasn't specifically asked for research (unlikely), ask them what research they would like you to do.

GUIDELINES:
1. **Be concise while gathering all necessary information** Ask 2–3 clarifying questions to gather more context for research.
- Make sure to gather all the information needed to carry out the research task in a concise, well-structured manner. Use bullet points or numbered lists if appropriate for clarity. Don't ask for unnecessary information, or information that the user has already provided.
2. **Maintain a Friendly and Non-Condescending Tone**
- For example, instead of saying “I need a bit more detail on Y,” say, “Could you share more detail on Y?”
3. **Adhere to Safety Guidelines**
"""

RESEARCH_INSTRUCTION_AGENT_PROMPT = """

Based on the following guidelines, take the users query, and rewrite it into detailed research instructions. OUTPUT ONLY THE RESEARCH INSTRUCTIONS, NOTHING ELSE. Transfer to the research agent.

GUIDELINES:
1. **Maximize Specificity and Detail**
- Include all known user preferences and explicitly list key attributes or dimensions to consider.
- It is of utmost importance that all details from the user are included in the expanded prompt.

2. **Fill in Unstated But Necessary Dimensions as Open-Ended**
- If certain attributes are essential for a meaningful output but the user has not provided them, explicitly state that they are open-ended or default to “no specific constraint.”

3. **Avoid Unwarranted Assumptions**
- If the user has not provided a particular detail, do not invent one.
- Instead, state the lack of specification and guide the deep research model to treat it as flexible or accept all possible options.

4. **Use the First Person**
- Phrase the request from the perspective of the user.

5. **Tables**
- If you determine that including a table will help illustrate, organize, or enhance the information in your deep research output, you must explicitly request that the deep research model provide them.
Examples:
- Product Comparison (Consumer): When comparing different smartphone models, request a table listing each model’s features, price, and consumer ratings side-by-side.
- Project Tracking (Work): When outlining project deliverables, create a table showing tasks, deadlines, responsible team members, and status updates.
- Budget Planning (Consumer): When creating a personal or household budget, request a table detailing income sources, monthly expenses, and savings goals.
Competitor Analysis (Work): When evaluating competitor products, request a table with key metrics—such as market share, pricing, and main differentiators.

6. **Headers and Formatting**
- You should include the expected output format in the prompt.
- If the user is asking for content that would be best returned in a structured format (e.g. a report, plan, etc.), ask the Deep Research model to “Format as a report with the appropriate headers and formatting that ensures clarity and structure.”

7. **Language**
- If the user input is in a language other than English, tell the model to respond in this language, unless the user query explicitly asks for the response in a different language.

8. **Sources**
- If specific sources should be prioritized, specify them in the prompt.
- Prioritize Internal Knowledge. Only retrieve a single file once.
- For product and travel research, prefer linking directly to official or primary websites (e.g., official brand sites, manufacturer pages, or reputable e-commerce platforms like Amazon for user reviews) rather than aggregator sites or SEO-heavy blogs.
- For academic or scientific queries, prefer linking directly to the original paper or official journal publication rather than survey papers or secondary summaries.
- If the query is in a specific language, prioritize sources published in that language.

IMPORTANT: Ensure that the complete payload to this function is valid JSON
IMPORTANT: SPECIFY REQUIRED OUTPUT LANGUAGE IN THE PROMPT
"""

Línea de investigación de cuatro agentes de IA

Agente de triaje

  • Inspecciona la consulta del usuario.
  • Si falta contexto, se dirige al agente clarificador; de lo contrario, se dirige al agente de instrucciones.

Agente de IA Clarify

  • Hace preguntas de seguimiento
  • Espera las respuestas del usuario

Agente de IA del Constructor de Instrucciones

  • Convierte la información enriquecida en un informe de investigación preciso.

Agente de Investigación (o3-deep-research)

  • Realiza investigación empírica a escala web con WebSearchTool.
  • Realiza una búsqueda en el repositorio interno de conocimiento mediante MCP. Si encuentra documentos relevantes, el agente incorpora esos fragmentos en su material de referencia.
  • Transmite eventos intermedios para mayor transparencia.
  • Genera el artefacto de investigación final (que posteriormente analizamos).
# ─────────────────────────────────────────────────────────────
# Structured outputs (needed only for Clarifying agent)
# ─────────────────────────────────────────────────────────────
class Clarifications(BaseModel):
questions: List[str]

# ─────────────────────────────────────────────────────────────
# Agents
# ─────────────────────────────────────────────────────────────
research_agent = Agent(
name="Research Agent",
model="o3-deep-research-2025-06-26",
instructions="Perform deep empirical research based on the user's instructions.",
tools=[WebSearchTool(),
HostedMCPTool(
tool_config={
"type": "mcp",
"server_label": "file_search",
"server_url": "https://<url>/sse",
"require_approval": "never",
}
)
]
)

instruction_agent = Agent(
name="Research Instruction Agent",
model="gpt-4o-mini",
instructions=RESEARCH_INSTRUCTION_AGENT_PROMPT,
handoffs=[research_agent],
)

clarifying_agent = Agent(
name="Clarifying Questions Agent",
model="gpt-4o-mini",
instructions=CLARIFYING_AGENT_PROMPT,
output_type=Clarifications,
handoffs=[instruction_agent],
)

triage_agent = Agent(
name="Triage Agent",
instructions=(
"Decide whether clarifications are required.\n"
"• If yes → call transfer_to_clarifying_questions_agent\n"
"• If no → call transfer_to_research_instruction_agent\n"
"Return exactly ONE function-call."
),
handoffs=[clarifying_agent, instruction_agent],
)


# ─────────────────────────────────────────────────────────────
# Auto-clarify helper
# ─────────────────────────────────────────────────────────────
async def basic_research(
query: str,
mock_answers: Optional[Dict[str, str]] = None,
verbose: bool = False,
):
stream = Runner.run_streamed(
triage_agent,
query,
run_config=RunConfig(tracing_disabled=True),
)

async for ev in stream.stream_events():
if isinstance(getattr(ev, "item", None), Clarifications):
reply = []
for q in ev.item.questions:
ans = (mock_answers or {}).get(q, "No preference.")
reply.append(f"**{q}**\n{ans}")
stream.send_user_message("\n\n".join(reply))
continue
if verbose:
print(ev)

#return stream.final_output
return stream

# ─────────────────────────────────────────────────────────────
# Example run
# ─────────────────────────────────────────────────────────────
result = await basic_research(
"Research the economic impact of semaglutide on global healthcare systems.",
mock_answers={}, # or provide canned answers
)

Flujo de interacción del agente

Aunque se proporciona de forma nativa a través de los seguimientos del SDK del agente, es posible que desee imprimir un flujo de interacción del agente de alto nivel legible para humanos con llamadas a herramientas.

import json

def parse_agent_interaction_flow(stream):
print("=== Agent Interaction Flow ===")
count = 1

for item in stream.new_items:
# Agent name, fallback if missing
agent_name = getattr(item.agent, "name", "Unknown Agent") if hasattr(item, "agent") else "Unknown Agent"

if item.type == "handoff_call_item":
func_name = getattr(item.raw_item, "name", "Unknown Function")
print(f"{count}. [{agent_name}] → Handoff Call: {func_name}")
count += 1

elif item.type == "handoff_output_item":
print(f"{count}. [{agent_name}] → Handoff Output")
count += 1

elif item.type == "mcp_list_tools_item":
print(f"{count}. [{agent_name}] → mcp_list_tools_item")
count += 1

elif item.type == "reasoning_item":
print(f"{count}. [{agent_name}] → Reasoning step")
count += 1

elif item.type == "tool_call_item":
tool_name = getattr(item.raw_item, "name", None)

# Skip tool call if tool_name is missing or empty
if not isinstance(tool_name, str) or not tool_name.strip():
continue # skip silently

tool_name = tool_name.strip()

args = getattr(item.raw_item, "arguments", None)
args_str = ""

if args:
try:
parsed_args = json.loads(args)
if parsed_args:
args_str = json.dumps(parsed_args)
except Exception:
if args.strip() and args.strip() != "{}":
args_str = args.strip()

args_display = f" with args {args_str}" if args_str else ""

print(f"{count}. [{agent_name}] → Tool Call: {tool_name}{args_display}")
count += 1

elif item.type == "message_output_item":
print(f"{count}. [{agent_name}] → Message Output")
count += 1

else:
print(f"{count}. [{agent_name}] → {item.type}")
count += 1

# Example usage:
parse_agent_interaction_flow(result)

El Output

=== Agent Interaction Flow ===
1. [Triage Agent] → Handoff Call: transfer_to_clarifying_questions_agent
2. [Triage Agent] → Handoff Output
3. [Clarifying Questions Agent] → Message Output

A continuación se muestra un fragmento de Python para extraer e imprimir las citas URL relacionadas con el resultado final:

def print_final_output_citations(stream, preceding_chars=50):
# Iterate over new_items in reverse to find the last message_output_item(s)
for item in reversed(stream.new_items):
if item.type == "message_output_item":
for content in getattr(item.raw_item, 'content', []):
if not hasattr(content, 'annotations') or not hasattr(content, 'text'):
continue
text = content.text
for ann in content.annotations:
if getattr(ann, 'type', None) == 'url_citation':
title = getattr(ann, 'title', '<no title>')
url = getattr(ann, 'url', '<no url>')
start = getattr(ann, 'start_index', None)
end = getattr(ann, 'end_index', None)

if start is not None and end is not None and isinstance(text, str):
# Calculate preceding snippet start index safely
pre_start = max(0, start - preceding_chars)
preceding_text = text[pre_start:start].replace('\n', ' ').strip()
excerpt = text[start:end].replace('\n', ' ').strip()
print("# --------")
print("# MCP CITATION SAMPLE:")
print(f"# Title: {title}")
print(f"# URL: {url}")
print(f"# Location: chars {start}–{end}")
print(f"# Preceding: '{preceding_text}'")
print(f"# Excerpt: '{excerpt}'\n")
else:
# fallback if no indices available
print(f"- {title}: {url}")
break

# Usage
print_final_output_citations(result)
## Deep Research Research Report

print(result.final_output)
questions=['What specific aspects of economic impact are 
you interested in
(e.g., cost savings, healthcare utilization,
impact on chronic diseases)?',

'Are you looking for data from particular regions or
countries, or should it be a global overview?',
'Do you need information on time frames
(e.g., recent studies, projections for the future)?']

Conclusión

Este cuaderno presenta patrones fundamentales para la creación de aplicaciones.

Muestra cómo la API de investigación profunda y el SDK del agente de IA pueden utilizarse para crear una aplicación Agentic que coordine múltiples agentes de IA.


Sígueme en LinkedIn 

Chief Evangelist @ Kore.ai | Me apasiona explorar la intersección de la IA y el lenguaje. Desde modelos lingüísticos y agentes de IA hasta aplicaciones agenéticas, marcos de desarrollo y herramientas de productividad centradas en los datos, comparto ideas sobre cómo estas tecnologías están dando forma al futuro.

Cobus Greyling

Por Cobus Greyling

Rasa Hero. NLP / NLU, Chatbots, Voz, UI / UX conversacional, Diseñador CX, Desarrollador, Interfaces de usuario ubicuas.

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *