File tree 2 files changed +95
-67
lines changed
2 files changed +95
-67
lines changed Original file line number Diff line number Diff line change 2
2
3
3
from __future__ import annotations
4
4
5
- from google .generativeai .types import (
6
- GenerationConfig ,
7
- GenerationConfigDict ,
8
- RequestOptions ,
9
- )
5
+ from typing import TYPE_CHECKING
6
+
10
7
from google .generativeai .types .content_types import ToolConfigType
11
8
from google .generativeai .types .safety_types import SafetySettingOptions
9
+ from pydantic import ConfigDict , with_config
12
10
from typing_extensions import NotRequired
13
11
14
12
from ..base import BaseCallParams
15
13
14
+ if TYPE_CHECKING :
15
+ from google .generativeai .types import (
16
+ GenerationConfig ,
17
+ GenerationConfigDict ,
18
+ RequestOptions ,
19
+ )
20
+ else :
21
+ from google .generativeai .types import (
22
+ GenerationConfig as _GenerationConfig ,
23
+ )
24
+ from google .generativeai .types import GenerationConfigDict as _GenerationConfigDict
25
+ from google .generativeai .types import RequestOptions as _RequestOptions
26
+
27
+ @with_config (ConfigDict (arbitrary_types_allowed = True ))
28
+ class GenerationConfigDict (_GenerationConfigDict ): ...
29
+
30
+ class GenerationConfig (_GenerationConfig ):
31
+ __pydantic_config__ = ConfigDict (arbitrary_types_allowed = True )
32
+
33
+ class RequestOptions (_RequestOptions ):
34
+ __pydantic_config__ = ConfigDict (arbitrary_types_allowed = True )
35
+
16
36
17
37
class GeminiCallParams (BaseCallParams ):
18
38
"""The parameters to use when calling the Gemini API.
You can’t perform that action at this time.
0 commit comments