- Move from OpenAI to Mistral Embeddings
- Move embedding model settings from tenant to catalog - BUG: error processing configuration for chunking patterns in HTML_PROCESSOR - Removed eveai_chat from docker-files and nginx configuration, as it is now obsolete - BUG: error in Library Operations when creating a new default RAG library - BUG: Added public type in migration scripts - Removed SocketIO from all code and requirements.txt
This commit is contained in:
@@ -18,9 +18,7 @@ sys.path.append(project_root)
|
||||
API_BASE_URL = "http://macstudio.ask-eve-ai-local.com:8080/api/api/v1"
|
||||
TENANT_ID = 2 # Replace with your tenant ID
|
||||
API_KEY = "EveAI-5096-5466-6143-1487-8085-4174-2080-7208" # Replace with your API key
|
||||
SPECIALIST_TYPE = "SPIN_SPECIALIST" # Replace with your specialist type
|
||||
SPECIALIST_ID = 5 # Replace with your specialist ID
|
||||
ROOT_FOLDER = "../.."
|
||||
|
||||
|
||||
def get_auth_token() -> str:
|
||||
@@ -52,15 +50,27 @@ def get_session_id(auth_token: str) -> str:
|
||||
return response.json()["session_id"]
|
||||
|
||||
|
||||
def load_specialist_config() -> Dict[str, Any]:
|
||||
"""Load specialist configuration from YAML file"""
|
||||
config_path = f"{ROOT_FOLDER}/config/specialists/{SPECIALIST_TYPE}/1.0.0.yaml"
|
||||
if not os.path.exists(config_path):
|
||||
print(colored(f"Error: Configuration file not found: {config_path}", "red"))
|
||||
sys.exit(1)
|
||||
def get_specialist_config(auth_token: str, specialist_id: int) -> Dict[str, Any]:
|
||||
"""Get specialist configuration from API"""
|
||||
headers = {
|
||||
'Authorization': f'Bearer {auth_token}',
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
|
||||
with open(config_path, 'r') as f:
|
||||
return yaml.safe_load(f)
|
||||
response = requests.get(
|
||||
f"{API_BASE_URL}/specialist-execution/specialist_arguments",
|
||||
headers=headers,
|
||||
json={
|
||||
'specialist_id': specialist_id
|
||||
}
|
||||
)
|
||||
|
||||
print(colored(f"Status Code: {response.status_code}", "cyan"))
|
||||
if response.status_code == 200:
|
||||
config_data = response.json()
|
||||
return config_data.get('arguments', {})
|
||||
else:
|
||||
raise Exception(f"Failed to get specialist configuration: {response.text}")
|
||||
|
||||
|
||||
def get_argument_value(arg_name: str, arg_config: Dict[str, Any], previous_value: Any = None) -> Any:
|
||||
@@ -163,8 +173,10 @@ def main():
|
||||
auth_token = get_auth_token()
|
||||
|
||||
# Load specialist configuration
|
||||
print(colored(f"Loading specialist configuration {SPECIALIST_TYPE}", "cyan"))
|
||||
config = load_specialist_config()
|
||||
print(colored(f"Loading specialist configuration", "cyan"))
|
||||
config = {
|
||||
'arguments': get_specialist_config(auth_token, SPECIALIST_ID)
|
||||
}
|
||||
previous_args = None
|
||||
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user