Spaces:
Sleeping
Sleeping
File size: 1,318 Bytes
d7527be de2e87c 848a71d 4d2a141 d7527be e116df6 d7527be bd9834b d7527be | 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 | from crewai import Agent, Crew, Process, Task,LLM
from crewai.project import CrewBase, agent, crew, task
import os
from languageexport.tools.custom_tool import SaveTranslationInput
import pandas as pd
name_0="deepseek/deepseek-v3-base:free"
name_1="openrouter/deepseek/deepseek-r1-0528:free"
name_z="openrouter/meta-llama/llama-4-scout:free"
name="openai/gpt-4.1-mini-2025-04-14"
llm=LLM(
model=name_1,
temperature=0.0,
)
import yaml
@CrewBase
class LanguagesExport():
def __init__(self):
agents_config = yaml.safe_load(open(r'languageexport/config/agents.yaml', encoding='utf-8'))
tasks_config = yaml.safe_load(open(r'languageexport/config/tasks.yaml', encoding='utf-8'))
@agent
def translator_researcher(self) -> Agent:
return Agent(
config=self.agents_config['translator_researcher'],
llm=llm,
verbose=True
)
@task
def research_task(self) -> Task:
return Task(
config=self.tasks_config['research_task'],
output_pydantic=SaveTranslationInput,
)
@crew
def crew(self) -> Crew:
return Crew(
agents=[self.translator_researcher()],
tasks=[self.research_task()],
process=Process.sequential,
verbose=True
) |