Skip to content

Commit 40c9e54

Browse files
committed
Update Codespace with latest changes.
1 parent bb1756e commit 40c9e54

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

.devcontainer/bootstrap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/bin/bash
2+
#
3+
# This script runs during the container prebuild step and is used to cache dependencies
4+
# and other artifacts that are not expected to change frequently.
5+
#
26

37
ROOT_DIR=/workspaces/codespaces-models
48

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@
3737
],
3838
"remoteUser": "codespace",
3939
"containerUser": "codespace",
40-
"updateContentCommand": "${containerWorkspaceFolder}/.devcontainer/bootstrap",
41-
"postStartCommand": "${containerWorkspaceFolder}/.devcontainer/bootstrap",
40+
"onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/bootstrap",
4241
"customizations": {
4342
"codespaces": {
4443
"disableAutomaticConfiguration": true,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ cookbooks/python/openai/data/hotel_invoices/transformed_invoice_json/*
1111
cookbooks/python/openai/data/hotel_invoices/extracted_invoice_json/*
1212
cookbooks/python/openai/data/hotel_invoices/hotel_DB.db
1313
cookbooks/python/openai/hallucination_results.csv
14+
node_modules/

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
azure-ai-inference~=1.0.0b3
1+
azure-ai-inference~=1.0.0b4
22
openai~=1.37.1
33
mistralai~=0.4.2
44
python-dotenv~=1.0.1

samples/python/azure_ai_inference/tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from azure.ai.inference import ChatCompletionsClient
88
from azure.ai.inference.models import (
99
AssistantMessage,
10-
ChatCompletionsFunctionToolCall,
11-
ChatCompletionsFunctionToolDefinition,
10+
ChatCompletionsToolCall,
11+
ChatCompletionsToolDefinition,
1212
CompletionsFinishReason,
1313
FunctionDefinition,
1414
SystemMessage,
@@ -49,7 +49,7 @@ def get_flight_info(origin_city: str, destination_city: str):
4949
)
5050
return json.dump({"error": "No flights found between the cities"})
5151

52-
flight_info = ChatCompletionsFunctionToolDefinition(
52+
flight_info = ChatCompletionsToolDefinition(
5353
function=FunctionDefinition(
5454
name="get_flight_info",
5555
description="""Returns information about the next flight between two cities.
@@ -97,7 +97,7 @@ def get_flight_info(origin_city: str, destination_city: str):
9797

9898
tool_call = response.choices[0].message.tool_calls[0]
9999

100-
if isinstance(tool_call, ChatCompletionsFunctionToolCall):
100+
if isinstance(tool_call, ChatCompletionsToolCall):
101101

102102
function_args = json.loads(tool_call.function.arguments.replace("'", '"'))
103103
print(

0 commit comments

Comments
 (0)