Skip to content

Commit e769da6

Browse files
authored
Merge pull request #3 from rohit-ganguly/mergemain
Merge from main
2 parents 3f7b0a7 + cd51950 commit e769da6

File tree

18 files changed

+227
-481
lines changed

18 files changed

+227
-481
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@
2929
"extensions": [
3030
"ms-python.python",
3131
"ms-python.vscode-pylance",
32+
"ms-python.vscode-python-envs",
3233
"charliermarsh.ruff",
3334
"mtxr.sqltools",
3435
"mtxr.sqltools-driver-pg",
36+
"esbenp.prettier-vscode",
37+
"mechatroner.rainbow-csv",
3538
"ms-vscode.vscode-node-azure-pack",
36-
"esbenp.prettier-vscode"
39+
"teamsdevapp.vscode-ai-foundry",
40+
"ms-windows-ai-studio.windows-ai-studio"
3741
],
3842
// Set *default* container specific settings.json values on container create.
3943
"settings": {

.github/workflows/app-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
key: mypy${{ matrix.os }}-${{ matrix.python_version }}-${{ hashFiles('requirements-dev.txt', 'src/backend/requirements.txt', 'src/backend/pyproject.toml') }}
124124

125125
- name: Run MyPy
126-
run: python3 -m mypy .
126+
run: python3 -m mypy . --python-version ${{ matrix.python_version }}
127127

128128
- name: Run Pytest
129129
run: python3 -m pytest -s -vv --cov --cov-fail-under=85

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ lint.isort.known-first-party = ["fastapi_app"]
77

88
[tool.mypy]
99
check_untyped_defs = true
10-
python_version = 3.9
1110
exclude = [".venv/*"]
1211

1312
[tool.pytest.ini_options]

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ pytest-snapshot
1414
locust
1515
psycopg2
1616
dotenv-azd
17-
freezegun

src/backend/fastapi_app/api_models.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from enum import Enum
2-
from typing import Any, Optional, Union
2+
from typing import Any, Optional
33

4-
from openai.types.chat import ChatCompletionMessageParam
4+
from openai.types.responses import ResponseInputItemParam
55
from pydantic import BaseModel, Field
6-
from pydantic_ai.messages import ModelRequest, ModelResponse
76

87

98
class AIChatRoles(str, Enum):
@@ -37,7 +36,7 @@ class ChatRequestContext(BaseModel):
3736

3837

3938
class ChatRequest(BaseModel):
40-
messages: list[ChatCompletionMessageParam]
39+
messages: list[ResponseInputItemParam]
4140
context: ChatRequestContext
4241
sessionState: Optional[Any] = None
4342

@@ -103,7 +102,7 @@ class ChatParams(ChatRequestOverrides):
103102
enable_text_search: bool
104103
enable_vector_search: bool
105104
original_user_query: str
106-
past_messages: list[Union[ModelRequest, ModelResponse]]
105+
past_messages: list[ResponseInputItemParam]
107106

108107

109108
class Filter(BaseModel):
Lines changed: 22 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,36 @@
11
[
22
{
3-
"parts": [
4-
{
5-
"content": "good options for ethiopian restaurants?",
6-
"timestamp": "2025-05-07T19:02:46.977501Z",
7-
"part_kind": "user-prompt"
8-
}
9-
],
10-
"instructions": null,
11-
"kind": "request"
3+
"role": "user",
4+
"content": "good options for ethiopian restaurants?"
125
},
136
{
14-
"parts": [
15-
{
16-
"tool_name": "search_database",
17-
"args": "{\"search_query\":\"ethiopian\"}",
18-
"tool_call_id": "call_4HeBCmo2uioV6CyoePEGyZPc",
19-
"part_kind": "tool-call"
20-
}
21-
],
22-
"model_name": "gpt-4o-mini-2024-07-18",
23-
"timestamp": "2025-05-07T19:02:47Z",
24-
"kind": "response"
7+
"id": "madeup",
8+
"call_id": "call_abc123",
9+
"name": "search_database",
10+
"arguments": "{\"search_query\":\"ethiopian\"}",
11+
"type": "function_call"
2512
},
2613
{
27-
"parts": [
28-
{
29-
"tool_name": "search_database",
30-
"content": "Search results for ethiopian: ...",
31-
"tool_call_id": "call_4HeBCmo2uioV6CyoePEGyZPc",
32-
"timestamp": "2025-05-07T19:02:48.242408Z",
33-
"part_kind": "tool-return"
34-
}
35-
],
36-
"instructions": null,
37-
"kind": "request"
14+
"id": "madeupoutput",
15+
"call_id": "call_abc123",
16+
"output": "Search results for ethiopian: ...",
17+
"type": "function_call_output"
3818
},
3919
{
40-
"parts": [
41-
{
42-
"content": "are there any inexpensive chinese restaurants?",
43-
"timestamp": "2025-05-07T19:02:46.977501Z",
44-
"part_kind": "user-prompt"
45-
}
46-
],
47-
"instructions": null,
48-
"kind": "request"
20+
"role": "user",
21+
"content": "are there any inexpensive japanese restaurants?"
4922
},
5023
{
51-
"parts": [
52-
{
53-
"tool_name": "search_database",
54-
"args": "{\"search_query\":\"chinese\",\"price_level_filter\":{\"comparison_operator\":\"<\",\"value\":3}}",
55-
"tool_call_id": "call_4HeBCmo2uioV6CyoePEGyZPc",
56-
"part_kind": "tool-call"
57-
}
58-
],
59-
"model_name": "gpt-4o-mini-2024-07-18",
60-
"timestamp": "2025-05-07T19:02:47Z",
61-
"kind": "response"
24+
"id": "madeup",
25+
"call_id": "call_abc456",
26+
"name": "search_database",
27+
"arguments": "{\"search_query\":\"japanese\",\"price_level_filter\":{\"comparison_operator\":\"<\",\"value\":3}}",
28+
"type": "function_call"
6229
},
6330
{
64-
"parts": [
65-
{
66-
"tool_name": "search_database",
67-
"content": "Search results for chinese: ...",
68-
"tool_call_id": "call_4HeBCmo2uioV6CyoePEGyZPc",
69-
"timestamp": "2025-05-07T19:02:48.242408Z",
70-
"part_kind": "tool-return"
71-
}
72-
],
73-
"instructions": null,
74-
"kind": "request"
31+
"id": "madeupoutput",
32+
"call_id": "call_abc456",
33+
"output": "Search results for japanese: ...",
34+
"type": "function_call_output"
7535
}
7636
]

0 commit comments

Comments
 (0)