first commit
parent
2f384fb72a
commit
1562aee998
|
|
@ -4,8 +4,11 @@
|
|||
|
||||
import aiohttp
|
||||
|
||||
from app.utils.logger import get_logger
|
||||
from config import kakao_settings
|
||||
|
||||
logger = get_logger("kakao")
|
||||
|
||||
|
||||
class KakaoOAuthClient:
|
||||
"""카카오 OAuth API 클라이언트"""
|
||||
|
|
@ -38,10 +41,10 @@ class KakaoOAuthClient:
|
|||
"redirect_uri": self.redirect_uri,
|
||||
"code": code,
|
||||
}
|
||||
print(f"[kakao] Token request - client_id: {self.client_id}, redirect_uri: {self.redirect_uri}")
|
||||
logger.debug(f"Token request - client_id: {self.client_id}, redirect_uri: {self.redirect_uri}")
|
||||
async with session.post(self.TOKEN_URL, data=data) as response:
|
||||
result = await response.json()
|
||||
print(f"[kakao] Token response: {result}")
|
||||
logger.debug(f"Token response: {result}")
|
||||
return result
|
||||
|
||||
async def get_user_info(self, access_token: str) -> dict:
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class ChatgptService:
|
|||
) -> str:
|
||||
prompt_text = prompt.build_prompt(input_data)
|
||||
|
||||
print(f"[ChatgptService] Generated Prompt (length: {len(prompt_text)})")
|
||||
logger.debug(f"[ChatgptService] Generated Prompt (length: {len(prompt_text)})")
|
||||
logger.info(f"[ChatgptService] Starting GPT request with structured output with model: {prompt.prompt_model}")
|
||||
|
||||
# GPT API 호출
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
import os, json
|
||||
from abc import ABCMeta
|
||||
from config import prompt_settings
|
||||
from app.utils.logger import get_logger
|
||||
|
||||
logger = get_logger("prompt")
|
||||
|
||||
class Prompt():
|
||||
prompt_name : str # ex) marketing_prompt
|
||||
|
|
@ -37,8 +40,8 @@ class Prompt():
|
|||
def build_prompt(self, input_data:dict) -> str:
|
||||
self.check_input(input_data)
|
||||
build_template = self.prompt_template
|
||||
print("build_template", build_template)
|
||||
print("input_data", input_data)
|
||||
logger.debug(f"build_template: {build_template}")
|
||||
logger.debug(f"input_data: {input_data}")
|
||||
build_template = build_template.format(**input_data)
|
||||
return build_template
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue