Base code

This commit is contained in:
Kunthawat Greethong
2026-01-08 22:39:53 +07:00
parent 697115c61a
commit c35fa52117
2169 changed files with 626670 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
import asyncio
from services.llm_providers.gemini_provider import gemini_structured_json_response
async def test_simple_schema():
"""Test with a very simple schema to see if structured output works at all"""
# Very simple schema
simple_schema = {
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "integer"}
}
}
simple_prompt = "Generate a person with a name and age."
print("Testing simple schema...")
print(f"Schema: {simple_schema}")
print(f"Prompt: {simple_prompt}")
print("\n" + "="*50 + "\n")
try:
result = gemini_structured_json_response(
prompt=simple_prompt,
schema=simple_schema,
temperature=0.3,
max_tokens=100
)
print("Result:")
print(result)
except Exception as e:
print(f"Error: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
asyncio.run(test_simple_schema())