Spaces:
Running
Running
genai (#12)
Browse files- Ars/objects.py +2 -2
- controller/imports.py +1 -1
- requirements.txt +4 -1
Ars/objects.py
CHANGED
@@ -3,7 +3,7 @@ from pydantic import Field, model_validator, BaseModel
|
|
3 |
from typing import List, Optional, Union,Type, TypeVar
|
4 |
from bson import ObjectId
|
5 |
import openai
|
6 |
-
from google
|
7 |
from google.genai import types
|
8 |
import os
|
9 |
from dotenv import load_dotenv
|
@@ -41,7 +41,7 @@ class AIWrapper:
|
|
41 |
elif self.provider == 'gemini':
|
42 |
return self._gemini_chat(prompt,output_schema=output_schema)
|
43 |
|
44 |
-
def _openai_chat(self, prompt: str
|
45 |
response = openai.ChatCompletion.create(
|
46 |
model="gpt-4",
|
47 |
messages=[
|
|
|
3 |
from typing import List, Optional, Union,Type, TypeVar
|
4 |
from bson import ObjectId
|
5 |
import openai
|
6 |
+
from google import genai
|
7 |
from google.genai import types
|
8 |
import os
|
9 |
from dotenv import load_dotenv
|
|
|
41 |
elif self.provider == 'gemini':
|
42 |
return self._gemini_chat(prompt,output_schema=output_schema)
|
43 |
|
44 |
+
def _openai_chat(self, prompt: str) -> str:
|
45 |
response = openai.ChatCompletion.create(
|
46 |
model="gpt-4",
|
47 |
messages=[
|
controller/imports.py
CHANGED
@@ -12,7 +12,7 @@ import fitz
|
|
12 |
from gamification.routes import gamification
|
13 |
from controller.scraper import scrapeCourse
|
14 |
import asyncio
|
15 |
-
from google
|
16 |
from typing import Optional,List
|
17 |
from pydantic import BaseModel
|
18 |
import re
|
|
|
12 |
from gamification.routes import gamification
|
13 |
from controller.scraper import scrapeCourse
|
14 |
import asyncio
|
15 |
+
from google import genai
|
16 |
from typing import Optional,List
|
17 |
from pydantic import BaseModel
|
18 |
import re
|
requirements.txt
CHANGED
@@ -29,7 +29,7 @@ einops
|
|
29 |
google-generativeai
|
30 |
google-auth
|
31 |
google-api-python-client
|
32 |
-
|
33 |
|
34 |
# Authentication
|
35 |
bcrypt
|
@@ -48,6 +48,9 @@ python-multipart
|
|
48 |
pydantic-settings
|
49 |
pydantic-extra-types
|
50 |
|
|
|
|
|
|
|
51 |
# Optional tools
|
52 |
tqdm
|
53 |
beautifulsoup4
|
|
|
29 |
google-generativeai
|
30 |
google-auth
|
31 |
google-api-python-client
|
32 |
+
google-genai
|
33 |
|
34 |
# Authentication
|
35 |
bcrypt
|
|
|
48 |
pydantic-settings
|
49 |
pydantic-extra-types
|
50 |
|
51 |
+
# Windows only (skip on Linux/mac)
|
52 |
+
# Remove pywin32==308, use the latest
|
53 |
+
|
54 |
# Optional tools
|
55 |
tqdm
|
56 |
beautifulsoup4
|