Skip to content

Commit

Permalink
Remove more ANSIBLE_AI_MODEL_MESH_xxx env vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
manstis committed Jan 10, 2025
1 parent 85181e1 commit 6b94cf8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ def __init__(self, **kwargs):

@Register(api_type="http")
class HttpConfigurationSerializer(BaseConfigSerializer):
verify_ssl = serializers.BooleanField(required=False, default=False)
verify_ssl = serializers.BooleanField(required=False, default=True)
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ def __init__(self, **kwargs):

@Register(api_type="llamacpp")
class LlamaCppConfigurationSerializer(BaseConfigSerializer):
verify_ssl = serializers.BooleanField(required=False, default=False)
verify_ssl = serializers.BooleanField(required=False, default=True)
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, provider: t_model_mesh_api_type, config: WCABaseConfiguration

class WCABaseConfigurationSerializer(BaseConfigSerializer):
api_key = serializers.CharField(required=False, allow_null=True, allow_blank=True)
verify_ssl = serializers.BooleanField(required=False, default=False)
verify_ssl = serializers.BooleanField(required=False, default=True)
retry_count = serializers.IntegerField(required=False, default=4)
enable_ari_postprocessing = serializers.BooleanField(required=False, default=False)
health_check_api_key = serializers.CharField(required=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

from ansible_anonymizer import anonymizer
from django.apps import apps
from django.conf import settings
from django_prometheus.conf import NAMESPACE
from prometheus_client import Histogram

Expand Down Expand Up @@ -124,7 +123,7 @@ def process(self, context: CompletionContext) -> None:
except ModelTimeoutError as e:
exception = e
logger.warning(
f"model timed out after {settings.ANSIBLE_AI_MODEL_MESH_API_TIMEOUT} "
f"model timed out after {model_mesh_client.config.timeout} "
f"seconds (per task) for suggestion {suggestion_id}"
)
raise ModelTimeoutException(cause=e)
Expand Down
2 changes: 1 addition & 1 deletion ansible_ai_connect/ai/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def perform_content_matching(
except ModelTimeoutError as e:
exception = e
logger.warn(
f"model timed out after {settings.ANSIBLE_AI_MODEL_MESH_API_TIMEOUT} seconds"
f"model timed out after {model_mesh_client.config.timeout} seconds"
f" for suggestion {suggestion_id}"
)
raise ModelTimeoutException(cause=e)
Expand Down
8 changes: 4 additions & 4 deletions ansible_ai_connect/main/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
# ANSIBLE_AI_MODEL_MESH_MODEL_ID = os.getenv("ANSIBLE_AI_MODEL_MESH_MODEL_NAME")

# Model API Timeout (in seconds). Default is None.
ANSIBLE_AI_MODEL_MESH_API_TIMEOUT = os.getenv("ANSIBLE_AI_MODEL_MESH_API_TIMEOUT")
# ANSIBLE_AI_MODEL_MESH_API_TIMEOUT = os.getenv("ANSIBLE_AI_MODEL_MESH_API_TIMEOUT")

# WCA - General
ANSIBLE_WCA_IDP_URL = os.getenv("ANSIBLE_WCA_IDP_URL") or "https://iam.cloud.ibm.com/identity"
Expand Down Expand Up @@ -185,9 +185,9 @@ def is_ssl_enabled(value: str) -> bool:
AAP_API_URL = os.environ.get("AAP_API_URL")
AAP_API_PROVIDER_NAME = os.environ.get("AAP_API_PROVIDER_NAME", "Ansible Automation Platform")
SOCIAL_AUTH_VERIFY_SSL = is_ssl_enabled(os.getenv("SOCIAL_AUTH_VERIFY_SSL", "True"))
ANSIBLE_AI_MODEL_MESH_API_VERIFY_SSL = is_ssl_enabled(
os.getenv("ANSIBLE_AI_MODEL_MESH_API_VERIFY_SSL", "True")
)
# ANSIBLE_AI_MODEL_MESH_API_VERIFY_SSL = is_ssl_enabled(
# os.getenv("ANSIBLE_AI_MODEL_MESH_API_VERIFY_SSL", "True")
# )
SOCIAL_AUTH_AAP_KEY = os.environ.get("SOCIAL_AUTH_AAP_KEY")
SOCIAL_AUTH_AAP_SECRET = os.environ.get("SOCIAL_AUTH_AAP_SECRET")
SOCIAL_AUTH_AAP_SCOPE = ["read"]
Expand Down
1 change: 0 additions & 1 deletion tools/docker-compose/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ services:
- SECRET_KEY=${SECRET_KEY:-somesecret}
- SEGMENT_WRITE_KEY=${SEGMENT_WRITE_KEY}
- SEGMENT_ANALYTICS_WRITE_KEY=${SEGMENT_ANALYTICS_WRITE_KEY}
- ANSIBLE_AI_MODEL_MESH_API_TIMEOUT=${ANSIBLE_AI_MODEL_MESH_API_TIMEOUT:-120}
- COMPLETION_USER_RATE_THROTTLE=${COMPLETION_USER_RATE_THROTTLE}
- SOCIAL_AUTH_OIDC_OIDC_ENDPOINT=${SOCIAL_AUTH_OIDC_OIDC_ENDPOINT}
- SOCIAL_AUTH_OIDC_KEY=${SOCIAL_AUTH_OIDC_KEY}
Expand Down

0 comments on commit 6b94cf8

Please sign in to comment.