Commit
·
a98a368
1
Parent(s):
76b9c90
models.py
CHANGED
|
@@ -28,7 +28,13 @@ class CloudEvent(BaseModel):
|
|
| 28 |
)
|
| 29 |
|
| 30 |
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
class FunctionState(BaseModel):
|
| 33 |
IsFunctionCall: bool = False
|
| 34 |
IsFunctionCallResponse: bool = False
|
|
@@ -36,7 +42,6 @@ class FunctionState(BaseModel):
|
|
| 36 |
IsFunctionCallStatus: bool = False
|
| 37 |
IsFunctionStillRunning: bool = False
|
| 38 |
|
| 39 |
-
# Convenience to set the 5-tuple like your C# SetFunctionState
|
| 40 |
def set_tuple(self, call: bool, resp: bool, err: bool, status: bool, running: bool):
|
| 41 |
self.IsFunctionCall = call
|
| 42 |
self.IsFunctionCallResponse = resp
|
|
@@ -44,15 +49,13 @@ class FunctionState(BaseModel):
|
|
| 44 |
self.IsFunctionCallStatus = status
|
| 45 |
self.IsFunctionStillRunning = running
|
| 46 |
|
| 47 |
-
|
| 48 |
class FunctionCallData(BaseModel):
|
| 49 |
-
#
|
| 50 |
-
|
| 51 |
-
|
| 52 |
|
| 53 |
class UserInfo(BaseModel):
|
| 54 |
-
#
|
| 55 |
-
|
| 56 |
|
| 57 |
|
| 58 |
# ---------- LLMServiceObj (field names match C# exactly) ----------
|
|
|
|
| 28 |
)
|
| 29 |
|
| 30 |
|
| 31 |
+
from typing import Any, Dict, Optional, List
|
| 32 |
+
from datetime import datetime, timezone
|
| 33 |
+
from pydantic import BaseModel, Field, ConfigDict # <-- add ConfigDict
|
| 34 |
+
|
| 35 |
+
# ... keep CloudEvent as you had it ...
|
| 36 |
+
|
| 37 |
+
# ---------- Permissive ancillary types ----------
|
| 38 |
class FunctionState(BaseModel):
|
| 39 |
IsFunctionCall: bool = False
|
| 40 |
IsFunctionCallResponse: bool = False
|
|
|
|
| 42 |
IsFunctionCallStatus: bool = False
|
| 43 |
IsFunctionStillRunning: bool = False
|
| 44 |
|
|
|
|
| 45 |
def set_tuple(self, call: bool, resp: bool, err: bool, status: bool, running: bool):
|
| 46 |
self.IsFunctionCall = call
|
| 47 |
self.IsFunctionCallResponse = resp
|
|
|
|
| 49 |
self.IsFunctionCallStatus = status
|
| 50 |
self.IsFunctionStillRunning = running
|
| 51 |
|
|
|
|
| 52 |
class FunctionCallData(BaseModel):
|
| 53 |
+
# Accept any extra keys (v2 style)
|
| 54 |
+
model_config = ConfigDict(extra="allow")
|
|
|
|
| 55 |
|
| 56 |
class UserInfo(BaseModel):
|
| 57 |
+
# Accept any extra keys (v2 style)
|
| 58 |
+
model_config = ConfigDict(extra="allow")
|
| 59 |
|
| 60 |
|
| 61 |
# ---------- LLMServiceObj (field names match C# exactly) ----------
|