diff --git a/helm_deploy/values-dev.yaml b/helm_deploy/values-dev.yaml index c6813977..83a33fe5 100644 --- a/helm_deploy/values-dev.yaml +++ b/helm_deploy/values-dev.yaml @@ -12,7 +12,6 @@ generic-service: OAUTH_ENDPOINT_URL: "https://sign-in-dev.hmpps.service.justice.gov.uk" COMMUNITY_ENDPOINT_URL: "https://community-api-secure.test.delius.probation.hmpps.dsd.io" DELIUS_ENDPOINT_URL: "https://probation-search-and-delius-dev.hmpps.service.justice.gov.uk" - BEDROCK_MODEL_ID: "p0l8bZABNIF6rA_H6bPt" SENTRY_ENVIRONMENT: dev allowlist: diff --git a/helm_deploy/values-preprod.yaml b/helm_deploy/values-preprod.yaml index b06b3fea..58ad2003 100644 --- a/helm_deploy/values-preprod.yaml +++ b/helm_deploy/values-preprod.yaml @@ -10,7 +10,6 @@ generic-service: OAUTH_ENDPOINT_URL: "https://sign-in-preprod.hmpps.service.justice.gov.uk" COMMUNITY_ENDPOINT_URL: "https://community-api-secure.pre-prod.delius.probation.hmpps.dsd.io" DELIUS_ENDPOINT_URL: "https://probation-search-and-delius-preprod.hmpps.service.justice.gov.uk" - BEDROCK_MODEL_ID: "MiEGDpEB-BRJA_2PSmnQ" SENTRY_ENVIRONMENT: preprod allowlist: diff --git a/helm_deploy/values-prod.yaml b/helm_deploy/values-prod.yaml index 5796c8f1..51e24a51 100644 --- a/helm_deploy/values-prod.yaml +++ b/helm_deploy/values-prod.yaml @@ -11,7 +11,6 @@ generic-service: OAUTH_ENDPOINT_URL: "https://sign-in.hmpps.service.justice.gov.uk" COMMUNITY_ENDPOINT_URL: "https://community-api-secure.probation.service.justice.gov.uk" DELIUS_ENDPOINT_URL: "https://probation-search-and-delius.hmpps.service.justice.gov.uk" - BEDROCK_MODEL_ID: "5QoSN5EB-CIfwTDlCJYn" SENTRY_ENVIRONMENT: prod allowlist: diff --git a/src/main/kotlin/uk/gov/justice/hmpps/probationsearch/contactsearch/ContactSearchController.kt b/src/main/kotlin/uk/gov/justice/hmpps/probationsearch/contactsearch/ContactSearchController.kt index 8a1cc029..f8e4ef4a 100644 --- a/src/main/kotlin/uk/gov/justice/hmpps/probationsearch/contactsearch/ContactSearchController.kt +++ b/src/main/kotlin/uk/gov/justice/hmpps/probationsearch/contactsearch/ContactSearchController.kt @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.* @RestController @RequestMapping("/search/contacts") class ContactSearchController(val contactSearchService: ContactSearchService) { - @PreAuthorize("hasRole('ROLE_PROBATION_CONTACT_SEARCH')") + @PreAuthorize("hasAnyRole('ROLE_PROBATION_CONTACT_SEARCH', 'ROLE_PROBATION_INTEGRAION_ADMIN')") @RequestMapping(method = [RequestMethod.GET, RequestMethod.POST]) fun searchContact( @RequestBody request: ContactSearchRequest, diff --git a/src/main/kotlin/uk/gov/justice/hmpps/probationsearch/contactsearch/ContactSearchService.kt b/src/main/kotlin/uk/gov/justice/hmpps/probationsearch/contactsearch/ContactSearchService.kt index c4de1849..79e0f6f7 100644 --- a/src/main/kotlin/uk/gov/justice/hmpps/probationsearch/contactsearch/ContactSearchService.kt +++ b/src/main/kotlin/uk/gov/justice/hmpps/probationsearch/contactsearch/ContactSearchService.kt @@ -24,7 +24,6 @@ import org.opensearch.search.fetch.subphase.highlight.HighlightBuilder import org.opensearch.search.sort.FieldSortBuilder import org.opensearch.search.sort.SortBuilders import org.opensearch.search.sort.SortOrder -import org.springframework.beans.factory.annotation.Value import org.springframework.data.domain.PageImpl import org.springframework.data.domain.PageRequest import org.springframework.data.domain.Pageable @@ -35,8 +34,7 @@ import org.springframework.data.elasticsearch.core.query.IndexQuery import org.springframework.security.core.context.SecurityContextHolder import org.springframework.stereotype.Service import uk.gov.justice.hmpps.probationsearch.contactsearch.ContactSearchService.SortType -import uk.gov.justice.hmpps.probationsearch.contactsearch.ContactSearchService.SortType.LAST_UPDATED_DATETIME -import uk.gov.justice.hmpps.probationsearch.contactsearch.ContactSearchService.SortType.SCORE +import uk.gov.justice.hmpps.probationsearch.contactsearch.ContactSearchService.SortType.* import uk.gov.justice.hmpps.probationsearch.services.DeliusService import uk.gov.justice.hmpps.sqs.audit.HmppsAuditService import java.time.Instant @@ -50,7 +48,6 @@ class ContactSearchService( private val objectMapper: ObjectMapper, private val deliusService: DeliusService, private val openSearchClient: OpenSearchClient, - @Value("\${bedrock.model.id}") private val bedrockModelId: String, // Temp, remove after upgrading to OpenSearch 2.16 - workaround for https://github.com/opensearch-project/OpenSearch/issues/15034 ) { private val scope = CoroutineScope(Dispatchers.IO) @@ -103,7 +100,6 @@ class ContactSearchService( query.neural { it.field("textEmbedding.knn") .queryText(request.query) - .modelId(bedrockModelId) .k(10) } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 2df3c940..e0fa23de 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -72,6 +72,4 @@ search: mapping: version: 1 -bedrock.model.id: none - sentry.traces-sample-rate: "0.05"