Skip to content

Commit aa03039

Browse files
wip: removing finally block.
1 parent 3a36d6e commit aa03039

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

instrumentation-genai/opentelemetry-instrumentation-openai-v2/src/opentelemetry/instrumentation/openai_v2/patch_responses.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ def traced_method(wrapped, instance, args, kwargs):
5858
except Exception as error:
5959
invocation.fail(Error(type=type(error), message=str(error)))
6060
raise
61-
finally:
62-
invocation.stop()
6361

6462
return traced_method
6563

instrumentation-genai/opentelemetry-instrumentation-openai-v2/tests/test_utils.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,26 @@ def get_current_weather_tool_definition():
183183
}
184184

185185

186+
def get_responses_weather_tool_definition():
187+
return {
188+
"type": "function",
189+
"name": "get_current_weather",
190+
"description": "Get the current weather in a given location",
191+
"parameters": {
192+
"type": "object",
193+
"properties": {
194+
"location": {
195+
"type": "string",
196+
"description": "The city and state, e.g. Boston, MA",
197+
},
198+
},
199+
"required": ["location"],
200+
"additionalProperties": False,
201+
},
202+
"strict": True,
203+
}
204+
205+
186206
EXPECTED_TOOL_DEFINITIONS = [
187207
{
188208
"type": "function",

0 commit comments

Comments
 (0)