Skip to content

Commit

Permalink
fix: renamings; fixed README
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik committed Dec 18, 2023
1 parent dbd90aa commit 621d2b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Supported models:
- anthropic.claude-v2
* Stable Diffusion
- stability.stable-diffusion-xl
* Meta
- meta.llama2-13b-chat-v1
- meta.llama2-70b-chat-v1
* Cohere
- cohere.command-text-v14
- cohere.command-light-text-v14

## Developer environment

Expand Down Expand Up @@ -64,7 +70,7 @@ Copy `.env.example` to `.env` and customize it for your environment:
|DEFAULT_REGION||AWS region e.g. "us-east-1"|
|LOG_LEVEL|INFO|Log level. Use DEBUG for dev purposes and INFO in prod|
|AIDIAL_LOG_LEVEL|WARNING|AI DIAL SDK log level|
|DIAL_USE_FILE_STORAGE|False|Save model artifacts to DIAL File storage (particularly, Stability images are uploaded to the files storage and their base64 encodings are replaced with links to the storage)|
|DIAL_USE_FILE_STORAGE|False|Save model artifacts to DIAL File storage (particularly, Stability images are uploaded to the files storage and their base64 encodings are replaced with links to the storage). The creds for the file storage must be passed in `Authorization` header of the incoming request. The file storage won't be used if the header isn't set.|
|DIAL_URL||URL of the core DIAL server (required when DIAL_USE_FILE_STORAGE=True)|
|WEB_CONCURRENCY|1|Number of workers for the server|
|TEST_SERVER_URL|http://0.0.0.0:5001|Server URL used in the integration tests|
Expand Down
4 changes: 1 addition & 3 deletions aidial_adapter_bedrock/chat_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ async def chat_completion(self, request: Request, response: Response):
model = await get_bedrock_adapter(
region=self.region,
model=request.deployment_id,
file_api_auth=Auth.create_from_headers(
"authorization", request.headers
),
file_api_auth=Auth.from_headers("authorization", request.headers),
)

async def generate_response(
Expand Down
2 changes: 1 addition & 1 deletion aidial_adapter_bedrock/dial_api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def headers(self) -> dict[str, str]:
return {self.name: self.value}

@classmethod
def create_from_headers(
def from_headers(
cls, name: str, headers: Mapping[str, str]
) -> Optional["Auth"]:
value = headers.get(name)
Expand Down

0 comments on commit 621d2b8

Please sign in to comment.