-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.py
More file actions
77 lines (51 loc) · 2.25 KB
/
Copy pathtests.py
File metadata and controls
77 lines (51 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
from google import genai
from dotenv import load_dotenv
from google.genai import types
from pydantic import BaseModel
import os
class Gemini_Output_Format(BaseModel):
test: bool
body: str
other: int
class Agent_Caller:
''''''''''''''''''''''
Gemini test code
'''''''''''''''''''''
load_dotenv()
client = genai.Client(api_key = os.getenv("GEMINI_API_Key"))
config_dict = {'system_instruction': 'this is test', 'response_mime_type': 'application/json'}
model_config = types.GenerateContentConfig(**config_dict, response_schema = Gemini_Output_Format)
def call_gemini(self) -> str:
response = Agent_Caller.client.models.generate_content(model = "gemini-3-flash-preview",
contents = "This is a test, confrim that is true",
config = self.model_config)
output = response.parsed
return output
def call_deep_research() -> None:
response = Agent_Caller.client.interactions.create(agent="deep-research-pro-preview-12-2025",
input="this is a test of deep research", # Pass the heavy prompt
background=True,
response_format=Gemini_Output_Format.model_json_schema(),
response_mime_type="application/json"
)
print(f"research started: {response.id}")
if __name__ == "__main__":
print("In agent caller\n")
#Agent_Caller.call_deep_research()
#print("pydantic test")
#pydantic_test = Gemini_Output_Format(test=True, body="test", other=5)
#print(pydantic_test)
#print(pydantic_test.model_dump())
print("\ngemini test")
new_agent = Agent_Caller()
output = new_agent.call_gemini()
print(output)
#dict = {"cat": "meow", "dog":"roof"}
#my_string = ""
#for key, value in dict.items():
# my_string += f"{key}: {value}\n"
#print(my_string)
#print(dict)
#popped = dict.pop("cat")
#print(dict)
#print(f"\npopped : {popped}")