OpenAI Agent 长工具描述的变通方法¶
在此演示中,我们将展示一个变通方法,用于定义其描述超出 OpenAI 当前 1024 字符限制的 OpenAI 工具。为简单起见,我们将基于 `QueryPlanTool` notebook 示例进行构建。
如果您在 Colab 上打开此 Notebook,您可能需要安装 LlamaIndex 🦙。
%pip install llama-index-agent-openai
%pip install llama-index-llms-openai
!pip install llama-index
%load_ext autoreload
%autoreload 2
from llama_index.core import SimpleDirectoryReader, VectorStoreIndex
from llama_index.llms.openai import OpenAI
import os
os.environ["OPENAI_API_KEY"] = "sk-..."
llm = OpenAI(temperature=0, model="gpt-4")
下载数据¶
!mkdir -p 'data/10q/'
!wget 'https://raw.githubusercontent.com/run-llama/llama_index/main/docs/docs/examples/data/10q/uber_10q_march_2022.pdf' -O 'data/10q/uber_10q_march_2022.pdf'
!wget 'https://raw.githubusercontent.com/run-llama/llama_index/main/docs/docs/examples/data/10q/uber_10q_june_2022.pdf' -O 'data/10q/uber_10q_june_2022.pdf'
!wget 'https://raw.githubusercontent.com/run-llama/llama_index/main/docs/docs/examples/data/10q/uber_10q_sept_2022.pdf' -O 'data/10q/uber_10q_sept_2022.pdf'
--2024-05-23 13:36:24-- https://raw.githubusercontent.com/run-llama/llama_index/main/docs/docs/examples/data/10q/uber_10q_march_2022.pdf Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1260185 (1.2M) [application/octet-stream] Saving to: ‘data/10q/uber_10q_march_2022.pdf’ data/10q/uber_10q_m 100%[===================>] 1.20M --.-KB/s in 0.04s 2024-05-23 13:36:24 (29.0 MB/s) - ‘data/10q/uber_10q_march_2022.pdf’ saved [1260185/1260185] --2024-05-23 13:36:24-- https://raw.githubusercontent.com/run-llama/llama_index/main/docs/docs/examples/data/10q/uber_10q_june_2022.pdf Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1238483 (1.2M) [application/octet-stream] Saving to: ‘data/10q/uber_10q_june_2022.pdf’ data/10q/uber_10q_j 100%[===================>] 1.18M --.-KB/s in 0.04s 2024-05-23 13:36:24 (26.4 MB/s) - ‘data/10q/uber_10q_june_2022.pdf’ saved [1238483/1238483] --2024-05-23 13:36:24-- https://raw.githubusercontent.com/run-llama/llama_index/main/docs/docs/examples/data/10q/uber_10q_sept_2022.pdf Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ... Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1178622 (1.1M) [application/octet-stream] Saving to: ‘data/10q/uber_10q_sept_2022.pdf’ data/10q/uber_10q_s 100%[===================>] 1.12M --.-KB/s in 0.05s 2024-05-23 13:36:25 (22.7 MB/s) - ‘data/10q/uber_10q_sept_2022.pdf’ saved [1178622/1178622]
加载数据¶
march_2022 = SimpleDirectoryReader(
input_files=["./data/10q/uber_10q_march_2022.pdf"]
).load_data()
june_2022 = SimpleDirectoryReader(
input_files=["./data/10q/uber_10q_june_2022.pdf"]
).load_data()
sept_2022 = SimpleDirectoryReader(
input_files=["./data/10q/uber_10q_sept_2022.pdf"]
).load_data()
构建索引¶
我们对每个文档(三月、六月、九月)构建一个向量索引/查询引擎。
march_index = VectorStoreIndex.from_documents(march_2022)
june_index = VectorStoreIndex.from_documents(june_2022)
sept_index = VectorStoreIndex.from_documents(sept_2022)
march_engine = march_index.as_query_engine(similarity_top_k=3, llm=llm)
june_engine = june_index.as_query_engine(similarity_top_k=3, llm=llm)
sept_engine = sept_index.as_query_engine(similarity_top_k=3, llm=llm)
定义过长的查询计划¶
尽管一个 `QueryPlanTool` 可能由许多 `QueryEngineTools` 组成,但在进行 OpenAI API 调用时,最终会从该 `QueryPlanTool` 创建一个 OpenAI 工具。该工具的描述首先是关于查询计划方法的通用说明,然后是每个组成 `QueryEngineTool` 的描述。
目前,每个 OpenAI 工具描述的最大长度为 1024 个字符。当您向 `QueryPlanTool` 添加更多 `QueryEngineTools` 时,您可能会超出此限制。如果超出限制,LlamaIndex 在尝试构建 OpenAI 工具时将引发错误。
让我们通过一个夸大的示例来演示这种情况,我们将给每个查询引擎工具一个非常冗长和重复的描述。
description_10q_general = """\
A Form 10-Q is a quarterly report required by the SEC for publicly traded companies,
providing an overview of the company's financial performance for the quarter.
It includes unaudited financial statements (income statement, balance sheet,
and cash flow statement) and the Management's Discussion and Analysis (MD&A),
where management explains significant changes and future expectations.
The 10-Q also discloses significant legal proceedings, updates on risk factors,
and information on the company's internal controls. Its primary purpose is to keep
investors informed about the company's financial status and operations,
enabling informed investment decisions."""
description_10q_specific = (
"This 10-Q provides Uber quarterly financials ending"
)
from llama_index.core.tools import QueryEngineTool
from llama_index.core.tools import QueryPlanTool
from llama_index.core import get_response_synthesizer
query_tool_sept = QueryEngineTool.from_defaults(
query_engine=sept_engine,
name="sept_2022",
description=f"{description_10q_general} {description_10q_specific} September 2022",
)
query_tool_june = QueryEngineTool.from_defaults(
query_engine=june_engine,
name="june_2022",
description=f"{description_10q_general} {description_10q_specific} June 2022",
)
query_tool_march = QueryEngineTool.from_defaults(
query_engine=march_engine,
name="march_2022",
description=f"{description_10q_general} {description_10q_specific} March 2022",
)
print(len(query_tool_sept.metadata.description))
print(len(query_tool_june.metadata.description))
print(len(query_tool_march.metadata.description))
730 725 726
从上面的打印语句中,我们可以看到,将这些工具组合到 `QueryPlanTool` 中时,我们将很容易超出 1024 个字符的最大限制。
query_engine_tools = [query_tool_sept, query_tool_june, query_tool_march]
response_synthesizer = get_response_synthesizer()
query_plan_tool = QueryPlanTool.from_defaults(
query_engine_tools=query_engine_tools,
response_synthesizer=response_synthesizer,
)
openai_tool = query_plan_tool.metadata.to_openai_tool()
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) Cell In[12], line 1 ----> 1 openai_tool = query_plan_tool.metadata.to_openai_tool() File ~/Code/run-llama/llama_index/llama-index-core/llama_index/core/tools/types.py:74, in ToolMetadata.to_openai_tool(self) 72 """To OpenAI tool.""" 73 if len(self.description) > 1024: ---> 74 raise ValueError( 75 "Tool description exceeds maximum length of 1024 characters. " 76 "Please shorten your description or move it to the prompt." 77 ) 78 return { 79 "type": "function", 80 "function": { (...) 84 }, 85 } ValueError: Tool description exceeds maximum length of 1024 characters. Please shorten your description or move it to the prompt.
将工具描述移至提示¶
解决此问题的一个显而易见的方案是缩短工具描述本身,但即使如此,当工具数量足够多时,我们最终仍然会超出字符限制。
一个更具可扩展性的解决方案是将工具描述移至提示。这解决了字符限制问题,因为没有查询引擎工具的描述,查询计划描述的大小将保持固定。当然,所选 LLM 施加的 token 限制仍然会限制工具描述,但这些限制远大于 1024 字符的限制。
将这些工具描述移至提示涉及两个步骤。首先,我们必须修改 `QueryPlanTool` 的 metadata 属性以省略 `QueryEngineTool` 描述,并对默认的查询计划说明进行微调(告诉 LLM 在提示中查找工具名称和描述)。
from llama_index.core.tools.types import ToolMetadata
introductory_tool_description_prefix = """\
This is a query plan tool that takes in a list of tools and executes a \
query plan over these tools to answer a query. The query plan is a DAG of query nodes.
Given a list of tool names and the query plan schema, you \
can choose to generate a query plan to answer a question.
The tool names and descriptions will be given alongside the query.
"""
# Modify metadata to only include the general query plan instructions
new_metadata = ToolMetadata(
introductory_tool_description_prefix,
query_plan_tool.metadata.name,
query_plan_tool.metadata.fn_schema,
)
query_plan_tool.metadata = new_metadata
query_plan_tool.metadata
ToolMetadata(description='This is a query plan tool that takes in a list of tools and executes a query plan over these tools to answer a query. The query plan is a DAG of query nodes.\n\nGiven a list of tool names and the query plan schema, you can choose to generate a query plan to answer a question.\n\nThe tool names and descriptions will be given alongside the query.\n', name='query_plan_tool', fn_schema=<class 'llama_index.core.tools.query_plan.QueryPlan'>, return_direct=False)
其次,我们必须将工具名称和描述与提出的查询连接起来。
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
agent = FunctionAgent(
tools=[query_plan_tool],
llm=OpenAI(temperature=0, model="gpt-4o"),
)
query = "What were the risk factors in sept 2022?"
# Reconstruct concatenated query engine tool descriptions
tools_description = "\n\n".join(
[
f"Tool Name: {tool.metadata.name}\n"
+ f"Tool Description: {tool.metadata.description} "
for tool in query_engine_tools
]
)
# Concatenate tool descriptions and query
query_planned_query = f"{tools_description}\n\nQuery: {query}"
query_planned_query
"Tool Name: sept_2022\nTool Description: A Form 10-Q is a quarterly report required by the SEC for publicly traded companies,\nproviding an overview of the company's financial performance for the quarter.\nIt includes unaudited financial statements (income statement, balance sheet,\nand cash flow statement) and the Management's Discussion and Analysis (MD&A),\nwhere management explains significant changes and future expectations.\nThe 10-Q also discloses significant legal proceedings, updates on risk factors,\nand information on the company's internal controls. Its primary purpose is to keep\ninvestors informed about the company's financial status and operations,\nenabling informed investment decisions. This 10-Q provides Uber quarterly financials ending September 2022 \n\nTool Name: june_2022\nTool Description: A Form 10-Q is a quarterly report required by the SEC for publicly traded companies,\nproviding an overview of the company's financial performance for the quarter.\nIt includes unaudited financial statements (income statement, balance sheet,\nand cash flow statement) and the Management's Discussion and Analysis (MD&A),\nwhere management explains significant changes and future expectations.\nThe 10-Q also discloses significant legal proceedings, updates on risk factors,\nand information on the company's internal controls. Its primary purpose is to keep\ninvestors informed about the company's financial status and operations,\nenabling informed investment decisions. This 10-Q provides Uber quarterly financials ending June 2022 \n\nTool Name: march_2022\nTool Description: A Form 10-Q is a quarterly report required by the SEC for publicly traded companies,\nproviding an overview of the company's financial performance for the quarter.\nIt includes unaudited financial statements (income statement, balance sheet,\nand cash flow statement) and the Management's Discussion and Analysis (MD&A),\nwhere management explains significant changes and future expectations.\nThe 10-Q also discloses significant legal proceedings, updates on risk factors,\nand information on the company's internal controls. Its primary purpose is to keep\ninvestors informed about the company's financial status and operations,\nenabling informed investment decisions. This 10-Q provides Uber quarterly financials ending March 2022 \n\nQuery: What were the risk factors in sept 2022?"
response = await agent.run(query_planned_query)
response
Added user message to memory: Tool Name: sept_2022 Tool Description: A Form 10-Q is a quarterly report required by the SEC for publicly traded companies, providing an overview of the company's financial performance for the quarter. It includes unaudited financial statements (income statement, balance sheet, and cash flow statement) and the Management's Discussion and Analysis (MD&A), where management explains significant changes and future expectations. The 10-Q also discloses significant legal proceedings, updates on risk factors, and information on the company's internal controls. Its primary purpose is to keep investors informed about the company's financial status and operations, enabling informed investment decisions. This 10-Q provides Uber quarterly financials ending September 2022 Tool Name: june_2022 Tool Description: A Form 10-Q is a quarterly report required by the SEC for publicly traded companies, providing an overview of the company's financial performance for the quarter. It includes unaudited financial statements (income statement, balance sheet, and cash flow statement) and the Management's Discussion and Analysis (MD&A), where management explains significant changes and future expectations. The 10-Q also discloses significant legal proceedings, updates on risk factors, and information on the company's internal controls. Its primary purpose is to keep investors informed about the company's financial status and operations, enabling informed investment decisions. This 10-Q provides Uber quarterly financials ending June 2022 Tool Name: march_2022 Tool Description: A Form 10-Q is a quarterly report required by the SEC for publicly traded companies, providing an overview of the company's financial performance for the quarter. It includes unaudited financial statements (income statement, balance sheet, and cash flow statement) and the Management's Discussion and Analysis (MD&A), where management explains significant changes and future expectations. The 10-Q also discloses significant legal proceedings, updates on risk factors, and information on the company's internal controls. Its primary purpose is to keep investors informed about the company's financial status and operations, enabling informed investment decisions. This 10-Q provides Uber quarterly financials ending March 2022 Query: What were the risk factors in sept 2022? === Calling Function === Calling function: query_plan_tool with args: { "nodes": [ { "id": 1, "query_str": "What were the risk factors in sept 2022?", "tool_name": "sept_2022", "dependencies": [] } ] } Executing node {"id": 1, "query_str": "What were the risk factors in sept 2022?", "tool_name": "sept_2022", "dependencies": []} Selected Tool: ToolMetadata(description="A Form 10-Q is a quarterly report required by the SEC for publicly traded companies,\nproviding an overview of the company's financial performance for the quarter.\nIt includes unaudited financial statements (income statement, balance sheet,\nand cash flow statement) and the Management's Discussion and Analysis (MD&A),\nwhere management explains significant changes and future expectations.\nThe 10-Q also discloses significant legal proceedings, updates on risk factors,\nand information on the company's internal controls. Its primary purpose is to keep\ninvestors informed about the company's financial status and operations,\nenabling informed investment decisions. This 10-Q provides Uber quarterly financials ending September 2022", name='sept_2022', fn_schema=<class 'llama_index.core.tools.types.DefaultToolFnSchema'>, return_direct=False) Executed query, got response. Query: What were the risk factors in sept 2022? Response: The risk factors in September 2022 included failure to meet regulatory requirements related to climate change or to meet stated climate change commitments, which could impact costs, operations, brand, and reputation. The ongoing COVID-19 pandemic and responses to it were also a risk, as they had an adverse impact on business and operations, including reducing the demand for Mobility offerings globally and affecting travel behavior and demand. Catastrophic events such as disease, weather events, war, or terrorist attacks could also adversely impact the business, financial condition, and results of operation. Other risks included errors, bugs, or vulnerabilities in the platform's code or systems, inappropriate or controversial data practices, and the growing use of artificial intelligence. Climate change related physical and transition risks, such as market shifts toward electric vehicles and lower carbon business models, and risks related to extreme weather events or natural disasters, were also a concern. Got output: The risk factors in September 2022 included failure to meet regulatory requirements related to climate change or to meet stated climate change commitments, which could impact costs, operations, brand, and reputation. The ongoing COVID-19 pandemic and responses to it were also a risk, as they had an adverse impact on business and operations, including reducing the demand for Mobility offerings globally and affecting travel behavior and demand. Catastrophic events such as disease, weather events, war, or terrorist attacks could also adversely impact the business, financial condition, and results of operation. Other risks included errors, bugs, or vulnerabilities in the platform's code or systems, inappropriate or controversial data practices, and the growing use of artificial intelligence. Climate change related physical and transition risks, such as market shifts toward electric vehicles and lower carbon business models, and risks related to extreme weather events or natural disasters, were also a concern. ========================
Response(response="The risk factors for Uber in September 2022 included:\n\n1. Failure to meet regulatory requirements related to climate change or to meet stated climate change commitments, which could impact costs, operations, brand, and reputation.\n2. The ongoing COVID-19 pandemic and responses to it were also a risk, as they had an adverse impact on business and operations, including reducing the demand for Mobility offerings globally and affecting travel behavior and demand.\n3. Catastrophic events such as disease, weather events, war, or terrorist attacks could also adversely impact the business, financial condition, and results of operation.\n4. Other risks included errors, bugs, or vulnerabilities in the platform's code or systems, inappropriate or controversial data practices, and the growing use of artificial intelligence.\n5. Climate change related physical and transition risks, such as market shifts toward electric vehicles and lower carbon business models, and risks related to extreme weather events or natural disasters, were also a concern.", source_nodes=[NodeWithScore(node=TextNode(id_='a92c1e5e-6285-4225-8c87-b9dbd2b07d89', embedding=None, metadata={'page_label': '74', 'file_name': 'uber_10q_sept_2022.pdf', 'file_path': 'data/10q/uber_10q_sept_2022.pdf', 'file_type': 'application/pdf', 'file_size': 1178622, 'creation_date': '2024-05-23', 'last_modified_date': '2024-05-23'}, excluded_embed_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], excluded_llm_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], relationships={<NodeRelationship.SOURCE: '1'>: RelatedNodeInfo(node_id='b5e99044-59e9-439a-9e53-802a517b287d', node_type=<ObjectType.DOCUMENT: '4'>, metadata={'page_label': '74', 'file_name': 'uber_10q_sept_2022.pdf', 'file_path': 'data/10q/uber_10q_sept_2022.pdf', 'file_type': 'application/pdf', 'file_size': 1178622, 'creation_date': '2024-05-23', 'last_modified_date': '2024-05-23'}, hash='edddd9bda362411ae2e4d36144b5049c8b2ce5ec26047fa7c04003a9265aa87d'), <NodeRelationship.PREVIOUS: '2'>: RelatedNodeInfo(node_id='04ae9351-0136-491a-8756-41dc2b8071a1', node_type=<ObjectType.TEXT: '1'>, metadata={'page_label': '74', 'file_name': 'uber_10q_sept_2022.pdf', 'file_path': 'data/10q/uber_10q_sept_2022.pdf', 'file_type': 'application/pdf', 'file_size': 1178622, 'creation_date': '2024-05-23', 'last_modified_date': '2024-05-23'}, hash='bdc5ab49a54e18f73a2687096148f9e567a053ea2d3bd3c051956fb359078f5e')}, text='Any failure to\nmeet regulatory requirements related to climate change, or to meet our stated climate change commitments on the timeframe we committed to, or at all, could have\nan adverse impact on our costs and ability to operate, as well as harm our brand, reputation, and consequently, our business.\nGeneral Economic Risks\nOutbreaks of contagious disease, such as the COVID-19 pandemic and the impact of actions to mitigate the such disease or pandemic, have adversely impacted\nand could continue to adversely impact our business, financial condition and results of operations.\nOccurrence of a catastrophic event, including but not limited to disease, a weather event, war, or terrorist attack, could adversely impact our business, financial\ncondition and results of operation. We also face risks related to health epidemics, outbreaks of contagious disease, and other adverse health developments. For\nexample, the ongoing COVID-19 pandemic and responses to it have had, and may continue to have, an adverse impact on our business and operations, including,\nfor example, by reducing the demand for our Mobility offerings globally, and affecting travel behavior and demand. Even as COVID-related restrictions have been\nlifted and many regions around the world are making progress in their recovery from the pandemic, we have experienced and may continue to experience Driver\nsupply constraints, and we are observing that consumer demand for Mobility is recovering faster than driver availability, as such supply constraints have been and\nmay continue to be impacted by concerns regarding the COVID-19 pandemic. Furthermore, to support social distancing, we temporarily suspended our shared\nrides offering globally, and recently re-launched our shared rides offering in certain regions.\n73', start_char_idx=4469, end_char_idx=6258, text_template='{metadata_str}\n\n{content}', metadata_template='{key}: {value}', metadata_seperator='\n'), score=0.8039095664957979), NodeWithScore(node=TextNode(id_='04ae9351-0136-491a-8756-41dc2b8071a1', embedding=None, metadata={'page_label': '74', 'file_name': 'uber_10q_sept_2022.pdf', 'file_path': 'data/10q/uber_10q_sept_2022.pdf', 'file_type': 'application/pdf', 'file_size': 1178622, 'creation_date': '2024-05-23', 'last_modified_date': '2024-05-23'}, excluded_embed_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], excluded_llm_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], relationships={<NodeRelationship.SOURCE: '1'>: RelatedNodeInfo(node_id='b5e99044-59e9-439a-9e53-802a517b287d', node_type=<ObjectType.DOCUMENT: '4'>, metadata={'page_label': '74', 'file_name': 'uber_10q_sept_2022.pdf', 'file_path': 'data/10q/uber_10q_sept_2022.pdf', 'file_type': 'application/pdf', 'file_size': 1178622, 'creation_date': '2024-05-23', 'last_modified_date': '2024-05-23'}, hash='edddd9bda362411ae2e4d36144b5049c8b2ce5ec26047fa7c04003a9265aa87d'), <NodeRelationship.NEXT: '3'>: RelatedNodeInfo(node_id='a92c1e5e-6285-4225-8c87-b9dbd2b07d89', node_type=<ObjectType.TEXT: '1'>, metadata={}, hash='4862564636269739d75565c6c9dc166659cf52e29ec337fe9b85802beeb2ce7d')}, text='platform to platform users. In addition, our release of new software in the past has inadvertently caused, and may in the future cause, interruptions in the\navailability or functionality of our platform. Any errors, bugs, or vulnerabilities discovered in our code or systems after release could result in an interruption in the\navailability of our platform or a negative experience for Drivers, consumers, merchants, Shippers, and Carriers, and could also result in negative publicity and\nunfavorable media coverage, damage to our reputation, loss of platform users, loss of revenue or liability for damages, regulatory inquiries, or other proceedings,\nany of which could adversely affect our business and financial results. In addition, our growing use of artificial intelligence (“AI”) (including machine learning) in\nour offerings presents additional risks. AI algorithms or automated processing of data may be flawed and datasets may be insufficient or contain biased information.\nInappropriate or controversial data practices by us or others could impair the acceptance of AI solutions or subject us to lawsuits and regulatory investigations.\nThese deficiencies could undermine the decisions, predictions or analysis AI applications produce, or lead to unintentional bias and discrimination, subjecting us to\ncompetitive harm, legal liability, and brand or reputational harm.\nWe are subject to climate change risks, including physical and transitional risks, and if we are unable to manage such risks, our business may be adversely\nimpacted.\nWe face climate change related physical and transition risks, which include the risk of market shifts toward electric vehicles (“EVs”) and lower carbon\nbusiness models and risks related to extreme weather events or natural disasters. Climate-related events, including the increasing frequency, severity and duration\nof extreme weather events and their impact on critical infrastructure in the United States and elsewhere, have the potential to disrupt our business, our third-party\nsuppliers, and the business of merchants, Shippers, Carriers and Drivers using our platform, and may cause us to experience higher losses and additional costs to\nmaintain or resume operations. Additionally, we are subject to emerging climate policies such as a regulation adopted in California in May 2021 requiring 90% of\nvehicle miles traveled by rideshare fleets in California to have been in zero emission vehicles by 2030, with interim targets beginning in 2023. In addition, Drivers\nmay be subject to climate-related policies that indirectly impact our business, such as the Congestion Charge Zone and Ultra Low Emission Zone schemes adopted\nin London that impose fees on drivers in fossil-fueled vehicles, which may impact our ability to attract and maintain Drivers on our platform, and to the extent we\nexperience Driver supply constraints in a given market, we may need to increase Driver incentives.\nWe have made climate related commitments that require us to invest significant effort, resources, and management time and circumstances may arise,\nincluding those beyond our control, that may require us to revise the contemplated timeframes for implementing these commitments.\nWe have made climate related commitments, including our commitment to 100% renewable electricity for our U.S. offices by 2025, our commitment to net\nzero climate emissions from corporate operations by 2030, and our commitment to be a net zero company by 2040. In addition, our Supplier Code of Conduct sets\nenvironmental standards for our supply chain, and we recognize that there are inherent climate-related risks wherever business is conducted. Progressing towards\nour climate commitments requires us to invest significant effort, resources, and management time, and circumstances may arise, including those beyond our\ncontrol, that may require us to revise our timelines and/or climate commitments. For example, the COVID-19 pandemic has negatively impacted our ability to\ndedicate resources to make the progress on our climate commitments that we initially anticipated. In addition, our ability to meet our climate commitments is\ndependent on external factors such as rapidly changing regulations, policies and related interpretation, advances in technology such as battery storage, as well the\navailability, cost and accessibility of EVs to Drivers, and the availability of EV charging infrastructure that can be efficiently accessed by Drivers. Any failure to\nmeet regulatory requirements related to climate change, or to meet our stated climate change commitments on the timeframe we committed to, or at all, could have\nan adverse impact on our costs and ability to operate, as well as harm our brand, reputation, and consequently, our business.\nGeneral Economic Risks\nOutbreaks of contagious disease, such as the COVID-19 pandemic and the impact of actions to mitigate the such disease or pandemic, have adversely impacted\nand could continue to adversely impact our business, financial condition and results of operations.\nOccurrence of a catastrophic event, including but not limited to disease, a weather event, war, or terrorist attack, could adversely impact our business, financial\ncondition and results of operation.', start_char_idx=0, end_char_idx=5248, text_template='{metadata_str}\n\n{content}', metadata_template='{key}: {value}', metadata_seperator='\n'), score=0.7967699969539317), NodeWithScore(node=TextNode(id_='474572f4-866f-4efa-aa5f-f898d4ba831a', embedding=None, metadata={'page_label': '13', 'file_name': 'uber_10q_sept_2022.pdf', 'file_path': 'data/10q/uber_10q_sept_2022.pdf', 'file_type': 'application/pdf', 'file_size': 1178622, 'creation_date': '2024-05-23', 'last_modified_date': '2024-05-23'}, excluded_embed_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], excluded_llm_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], relationships={<NodeRelationship.SOURCE: '1'>: RelatedNodeInfo(node_id='2ecd357c-acd3-4398-a0ae-223bf9980f34', node_type=<ObjectType.DOCUMENT: '4'>, metadata={'page_label': '13', 'file_name': 'uber_10q_sept_2022.pdf', 'file_path': 'data/10q/uber_10q_sept_2022.pdf', 'file_type': 'application/pdf', 'file_size': 1178622, 'creation_date': '2024-05-23', 'last_modified_date': '2024-05-23'}, hash='8da53f7e83f88f63304dfcf8186b0ce111a5e161a317d243451266b863e9f2af'), <NodeRelationship.PREVIOUS: '2'>: RelatedNodeInfo(node_id='e2e88da4-92e0-4185-96c6-010a35d94287', node_type=<ObjectType.TEXT: '1'>, metadata={'page_label': '13', 'file_name': 'uber_10q_sept_2022.pdf', 'file_path': 'data/10q/uber_10q_sept_2022.pdf', 'file_type': 'application/pdf', 'file_size': 1178622, 'creation_date': '2024-05-23', 'last_modified_date': '2024-05-23'}, hash='373d1a92181565c8fb2ae2831069e904f4f4d2a9fdc70486b91f102cdac9d442')}, text='Estimates are based on historical experience, where\napplicable, and other assumptions which management believes are reasonable under the circumstances. Additionally, we considered the impacts of the coronavirus\npandemic (“COVID-19”) on the assumptions and inputs (including market data) supporting certain of these estimates, assumptions and judgments. On an ongoing\nbasis, management evaluates estimates, including, but not limited to: fair values of investments and other financial instruments (including the measurement of\ncredit or impairment losses); useful lives of amortizable long-lived assets; fair value of acquired intangible assets and related impairment assessments; impairment\nof goodwill; stock-based compensation; income taxes and non-income tax reserves; certain deferred tax assets and tax liabilities; insurance reserves; and other\ncontingent liabilities. These estimates are inherently subject to judgment and actual results could differ from those estimates.\nCertain Significant Risks and Uncertainties - COVID-19\nCOVID-19 restrictions have had an adverse impact on our business and operations by reducing, in particular, the global demand for Mobility offerings. It is\nnot possible to predict COVID-19’s cumulative and ultimate impact on our future business operations, results of operations, financial position, liquidity, and cash\nflows. The extent of the impact of COVID-19 on our business and financial results will depend largely on future developments, including: outbreaks or variants of\nthe virus, both globally and within the United\n12', start_char_idx=4007, end_char_idx=5573, text_template='{metadata_str}\n\n{content}', metadata_template='{key}: {value}', metadata_seperator='\n'), score=0.7911034852964277)], metadata=None)