OpenAI Agent Workarounds for Lengthy Tool DescriptionsĀ¶
In this demo, we illustrate a workaround for defining an OpenAI tool
whose description exceeds OpenAI's current limit of 1024 characters.
For simplicity, we will build upon the QueryPlanTool
notebook
example.
If you're opening this Notebook on colab, you will probably need to install 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
llm = OpenAI(temperature=0, model="gpt-4")
Download DataĀ¶
!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]
Load dataĀ¶
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()
Build indicesĀ¶
We build a vector index / query engine over each of the documents (March, June, September).
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)
Defining an Excessively Lengthy Query PlanĀ¶
Although a QueryPlanTool
may be composed from many QueryEngineTools
,
a single OpenAI tool is ultimately created from the QueryPlanTool
when the OpenAI API call is made. The description of this tool begins with
general instructions about the query plan approach, followed by the
descriptions of each constituent QueryEngineTool
.
Currently, each OpenAI tool description has a maximum length of 1024 characters.
As you add more QueryEngineTools
to your QueryPlanTool
, you may exceed
this limit. If the limit is exceeded, LlamaIndex will raise an error when it
attempts to construct the OpenAI tool.
Let's demonstrate this scenario with an exaggerated example, where we will give each query engine tool a very lengthy and redundant description.
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
From the print statements above, we see that we will easily exceed the
maximum character limit of 1024 when composing these tools into the QueryPlanTool
.
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.
Moving Tool Descriptions to the PromptĀ¶
One obvious solution to this problem would be to shorten the tool descriptions themselves, however with sufficiently many tools, we will still eventually exceed the character limit.
A more scalable solution would be to move the tool descriptions to the prompt. This solves the character limit issue, since without the descriptions of the query engine tools, the query plan description will remain fixed in size. Of course, token limits imposed by the selected LLM will still bound the tool descriptions, however these limits are far larger than the 1024 character limit.
There are two steps involved in moving these tool descriptions to the
prompt. First, we must modify the metadata property of the QueryPlanTool
to omit the QueryEngineTool
descriptions, and make a slight modification
to the default query planning instructions (telling the LLM to look for the
tool names and descriptions in the prompt.)
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)
Second, we must concatenate our tool names and descriptions alongside the query being posed.
from llama_index.agent.openai import OpenAIAgent
from llama_index.llms.openai import OpenAI
agent = OpenAIAgent.from_tools(
[query_plan_tool],
max_function_calls=10,
llm=OpenAI(temperature=0, model="gpt-4-0613"),
verbose=True,
)
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 = agent.query(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)