Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cognitive services endpoint to config parameters #6

Merged
merged 5 commits into from
Jun 18, 2024
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
Binary file modified backend/graphrag-wheel/graphrag-0.0.1-py3-none-any.whl
Binary file not shown.
2 changes: 1 addition & 1 deletion backend/graphrag-wheel/note.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ This graphrag wheel file was built from the following repo

https://github.com/microsoft/graphrag

on commit hash 6afec2ae421eabf468e1da8595e1e23d4bda5ecb
on commit hash a389514b4723189803097dc0d602b50d139ee92c

6 changes: 4 additions & 2 deletions backend/src/api/pipeline_settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# this yaml file serves as a configuration template for the graphrag indexing jobs
# some values are hardcoded while others will be dynamically set
input:
type: text
type: blob
file_type: text
file_pattern: .*\.txt$
storage_type: blob
storage_account_blob_url: $STORAGE_ACCOUNT_BLOB_URL
container_name: PLACEHOLDER
base_dir: .
Expand Down Expand Up @@ -35,6 +35,7 @@ llm:
api_version: $GRAPHRAG_API_VERSION
model: $GRAPHRAG_LLM_MODEL
deployment_name: $GRAPHRAG_LLM_DEPLOYMENT_NAME
cognitive_services_endpoint: $GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT
model_supports_json: True
tokens_per_minute: 80000
requests_per_minute: 480
Expand All @@ -56,6 +57,7 @@ embeddings:
batch_size: 16
model: $GRAPHRAG_EMBEDDING_MODEL
deployment_name: $GRAPHRAG_EMBEDDING_DEPLOYMENT_NAME
cognitive_services_endpoint: $GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT
tokens_per_minute: 350000
concurrent_requests: 25
requests_per_minute: 2100
Expand Down
3 changes: 2 additions & 1 deletion backend/src/meta_agent/community/retrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
)

cognitive_services_endpoint = os.environ.get(
"COGNITIVE_SERVICES_ENDPOINT", "https://cognitiveservices.azure.com/.default"
"GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT",
"https://cognitiveservices.azure.com/.default",
)
token_provider = get_bearer_token_provider(
DefaultAzureCredential(), cognitive_services_endpoint
Expand Down
3 changes: 2 additions & 1 deletion backend/src/meta_agent/global_search/retrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
)

cognitive_services_endpoint = os.environ.get(
"COGNITIVE_SERVICES_ENDPOINT", "https://cognitiveservices.azure.com/.default"
"GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT",
"https://cognitiveservices.azure.com/.default",
)
token_provider = get_bearer_token_provider(
DefaultAzureCredential(), cognitive_services_endpoint
Expand Down
5 changes: 3 additions & 2 deletions docs/DEPLOYMENT-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ In the `deploy.parameters.json` file, provide values for the following required
`GRAPHRAG_EMBEDDING_DEPLOYMENT_NAME` | | Yes | Deployment name of the Azure OpenAI embedding model.
`APIM_NAME` | | No | Hostname of the API. Must be a globally unique name. The API will be accessible at `https://<APIM_NAME>.azure-api.net`. If not provided a unique name will be generated.
`RESOURCE_BASE_NAME` | | No | Suffix to apply to all azure resource names. If not provided a unique suffix will be generated.
`AISEARCH_ENDPOINT_SUFFIX` | | No | Suffix to apply to AI search endpoint. Will default to `search.windows.net` for Azure commercial cloud but should be defined for deployments in other Azure clouds.
`REPORTERS` | | No | The type of logging to enable. If not provided, logging will be saved to a file in Azure Storage and to the console in AKS
`AISEARCH_ENDPOINT_SUFFIX` | | No | Suffix to apply to AI search endpoint. Will default to `search.windows.net` for Azure Commercial cloud but should be overriden for deployments in other Azure clouds.
`REPORTERS` | | No | The type of logging to enable. If not provided, logging will be saved to a file in Azure Storage and to the console in AKS.
`GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT` | | No | Endpoint for cognitive services identity authorization. Will default to `https://cognitiveservices.azure.com/.default` for Azure Commercial cloud but should be defined for deployments in other Azure clouds.

## 5. Deploy the solution accelerator
```
Expand Down
6 changes: 6 additions & 0 deletions infra/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ AISEARCH_ENDPOINT_SUFFIX=""
APIM_NAME=""
RESOURCE_BASE_NAME=""
REPORTERS=""
GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT=""

requiredParams=(
CONTAINER_REGISTRY_SERVER
Expand Down Expand Up @@ -152,6 +153,10 @@ populateOptionalParams () {
REPORTERS="blob,console"
printf "\tsetting REPORTERS=blob,console\n"
fi
if [ -z "$GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT" ]; then
GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT="https://cognitiveservices.azure.com/.default"
printf "\tsetting GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT=$GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT\n"
fi
printf "Done.\n"
}

Expand Down Expand Up @@ -353,6 +358,7 @@ deployHelmChart () {
--set "graphragConfig.COSMOS_URI_ENDPOINT=$cosmosEndpoint" \
--set "graphragConfig.GRAPHRAG_API_BASE=$GRAPHRAG_API_BASE" \
--set "graphragConfig.GRAPHRAG_API_VERSION=$GRAPHRAG_API_VERSION" \
--set "graphragConfig.GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT=$GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT" \
--set "graphragConfig.GRAPHRAG_LLM_MODEL=$GRAPHRAG_LLM_MODEL" \
--set "graphragConfig.GRAPHRAG_LLM_DEPLOYMENT_NAME=$GRAPHRAG_LLM_DEPLOYMENT_NAME" \
--set "graphragConfig.GRAPHRAG_EMBEDDING_MODEL=$GRAPHRAG_EMBEDDING_MODEL" \
Expand Down
1 change: 1 addition & 0 deletions infra/helm/graphrag/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ graphragConfig:
COSMOS_URI_ENDPOINT: ""
GRAPHRAG_API_BASE: ""
GRAPHRAG_API_VERSION: ""
GRAPHRAG_COGNITIVE_SERVICES_ENDPOINT: "https://cognitiveservices.azure.com/.default"
GRAPHRAG_LLM_MODEL: ""
GRAPHRAG_LLM_DEPLOYMENT_NAME: ""
GRAPHRAG_EMBEDDING_MODEL: ""
Expand Down
Loading