Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# Keeps the collector image build context (repo root) small.
# Only config.yaml and ingest_utils/confluence_processor are copied in.
.git
cdk.out
node_modules
frontend
planning-docs
**/__pycache__
**/*.pyc
.venv
venv
# Exclude everything, then re-include only what the collector image needs
*
!config.yaml
!ingest_utils
ingest_utils/confluence_processor/confluence_downloads
ingest_utils/confluence_processor/google_drive_downloads
ingest_utils/confluence_processor/service-credentials.json
ingest_utils/confluence_processor/names.env
ingest_utils/confluence_processor/names.env.copy
ingest_utils/confluence_processor/names.env*
**/__pycache__
**/*.pyc
10 changes: 5 additions & 5 deletions src/backend/chatbot_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
dynamodb = boto3.resource("dynamodb")
ssm = boto3.client("ssm")

# Reject oversized queries before any billable Bedrock/OpenSearch call (S5).
# Reject oversized queries before any billable Bedrock/OpenSearch call
MAX_QUERY_CHARS = 4000

# Cache for prompts
Expand Down Expand Up @@ -187,8 +187,8 @@ def invoke_model(

return response["output"]["message"]["content"][0]["text"]

except Exception as e:
logger.error(f"Error invoking the model: {str(e)}")
except Exception:
logger.exception("Error invoking the model")
return None


Expand Down Expand Up @@ -615,8 +615,8 @@ def lambda_handler(event: Dict[str, Any], context: Any) -> Dict[str, Any]:
),
}

except Exception as e:
logger.error(f"Error in lambda_handler: {e}")
except Exception:
logger.exception("Error in lambda_handler")
return {
"statusCode": 500,
"body": json.dumps("Error processing message"),
Expand Down
4 changes: 4 additions & 0 deletions src/backend/opensearch_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def initialize_opensearch():
use_ssl=True,
verify_certs=True,
connection_class=RequestsHttpConnection,
# AOSS intermittently returns 500s on valid queries; retry through them
max_retries=3,
retry_on_status=(500, 502, 503, 504),
retry_on_timeout=True,
)

return client
Expand Down