Добавлены параметры конфигурации
This commit is contained in:
@@ -4,6 +4,7 @@ from dotenv import load_dotenv
|
||||
|
||||
# from pydantic import BaseModel
|
||||
from pydantic_ai import Agent
|
||||
from pydantic_ai.settings import ModelSettings
|
||||
|
||||
from llm.config import load_config
|
||||
from llm.factory import LLMModelProvider
|
||||
@@ -22,8 +23,16 @@ async def main():
|
||||
# model = LLMModelProvider.create_openai_compatible(model_name="qwen/qwen3-8b",
|
||||
# api_key=os.getenv("API_KEY"),
|
||||
# base_url=os.getenv("BASE_URL"))
|
||||
agent = Agent(model=model)
|
||||
result = await agent.run('Привет, дай мне ответ')
|
||||
agent = Agent(model=model,
|
||||
system_prompt=config.prompts.system,
|
||||
instructions=config.prompts.instructions)
|
||||
settings = ModelSettings(
|
||||
**config.generation.model_dump()
|
||||
)
|
||||
|
||||
user_prompt = config.prompts.user.format(task="Повтори сообщение")
|
||||
result = await agent.run(user_prompt,
|
||||
model_settings=settings)
|
||||
print(result.output)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user