Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
svange committed Feb 3, 2024
2 parents fa751c5 + 0fe92a0 commit 271967a
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 29 deletions.
62 changes: 39 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,79 @@
# Changelog
# CHANGELOG

All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.0.4](https://github.com/svange/openbrain/compare/v1.0.3...v1.0.4) (2023-11-13)

## v1.0.5-dev.1 (2023-11-23)

### Bug Fixes
### Build

* catching AWS client error to allow for no-infra testing in CI pipelines. ([55573ad](https://github.com/svange/openbrain/commit/55573adc8734389ad3ea9f16fc0b280528320ec7))
* build(merge): merge main back into dev ([`04e25ab`](https://github.com/svange/openbrain/commit/04e25ab350fd807e9e1d11a73c4830678652be7c))

# CHANGELOG
### Fix

* fix: update gradio to work with new environment variables. ([`396ab70`](https://github.com/svange/openbrain/commit/396ab709d4e3f0962fffb25e71168cc28349384f))


## v1.0.2-dev.1 (2023-11-13)
## v1.0.4 (2023-11-13)

### Documentation
### Chore

* docs: added info about the SAM template ([`b7b90f4`](https://github.com/svange/openbrain/commit/b7b90f4c658394bd490ce3a4c670c1e729734e31))
* chore(release): 1.0.4 [skip ci]

### Fix
## [1.0.4](https://github.com/svange/openbrain/compare/v1.0.3...v1.0.4) (2023-11-13)

* fix: removing import exceptions in favor of logging warnings so Chalice can stop complaining. ([`4f66cbf`](https://github.com/svange/openbrain/commit/4f66cbf1497534c3355c04278570eb62962afb05))
### Bug Fixes

### Unknown
* catching AWS client error to allow for no-infra testing in CI pipelines. ([55573ad](https://github.com/svange/openbrain/commit/55573adc8734389ad3ea9f16fc0b280528320ec7)) ([`92be7a6`](https://github.com/svange/openbrain/commit/92be7a6068abf025341d3463328353948478a104))

* Merge remote-tracking branch 'origin/main' ([`d8da56d`](https://github.com/svange/openbrain/commit/d8da56dc2920fbe5e75f956b67a9aaf9b4c1d41d))
### Fix

* fix: catching AWS client error to allow for no-infra testing in CI pipelines. ([`55573ad`](https://github.com/svange/openbrain/commit/55573adc8734389ad3ea9f16fc0b280528320ec7))

## v1.0.1 (2023-11-10)
### Unknown

### Build
* Merge branch 'dev' ([`5341bbe`](https://github.com/svange/openbrain/commit/5341bbe4b741af8d8b7ac0ce66f33eb60b4a19c5))

* build: merge dev into main ([`3b47875`](https://github.com/svange/openbrain/commit/3b47875b75ab4e6bbbea7ce20c8047380e239721))

## v1.0.3 (2023-11-13)

### Chore

* chore(release): 1.0.1 [skip ci]
* chore(release): 1.0.3 [skip ci]

## [1.0.3](https://github.com/svange/openbrain/compare/v1.0.2...v1.0.3) (2023-11-13)

### Bug Fixes

* catching AWS client error to allow for no-infra testing in CI pipelines. ([7f5c401](https://github.com/svange/openbrain/commit/7f5c40133266d6fd70656f3dfdb84b8b90738e82))
* catching AWS client error to allow for no-infra testing in CI pipelines. ([7f5c401](https://github.com/svange/openbrain/commit/7f5c40133266d6fd70656f3dfdb84b8b90738e82)) ([`69743cf`](https://github.com/svange/openbrain/commit/69743cfad98bf8c3bb135504f3b55bce5a4dcbfe))

## [1.0.2](https://github.com/svange/openbrain/compare/v1.0.1...v1.0.2) (2023-11-13)
### Fix

* fix: catching AWS client error to allow for no-infra testing in CI pipelines. ([`7f5c401`](https://github.com/svange/openbrain/commit/7f5c40133266d6fd70656f3dfdb84b8b90738e82))

### Bug Fixes

* removing import exceptions in favor of logging warnings so Chalice can stop complaining. ([4f66cbf](https://github.com/svange/openbrain/commit/4f66cbf1497534c3355c04278570eb62962afb05))
## v1.0.2 (2023-11-13)

# CHANGELOG
### Build

* build: Update release branch ([`e2aba1f`](https://github.com/svange/openbrain/commit/e2aba1f745f976242f69df89cc8225e5a94db724))

### Chore

* chore(release): 1.0.2 [skip ci]

## [1.0.2](https://github.com/svange/openbrain/compare/v1.0.1...v1.0.2) (2023-11-13)

### Bug Fixes

* removing import exceptions in favor of logging warnings so Chalice can stop complaining. ([4f66cbf](https://github.com/svange/openbrain/commit/4f66cbf1497534c3355c04278570eb62962afb05)) ([`e413078`](https://github.com/svange/openbrain/commit/e4130784a82630d25f9ba3daf8912359ecf763a1))


## v1.0.2-dev.1 (2023-11-13)

### Chore

* chore(release): release 1.0.2-dev.1 ([`5233fa2`](https://github.com/svange/openbrain/commit/5233fa27159a72aeea2750a8c3d8865ae688e047))

### Documentation

* docs: added info about the SAM template ([`b7b90f4`](https://github.com/svange/openbrain/commit/b7b90f4c658394bd490ce3a4c670c1e729734e31))
Expand Down
22 changes: 16 additions & 6 deletions openbrain/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
load_dotenv()

OB_MODE = config.OB_MODE
AGENCY_API_KEY = os.environ.get("DEV_OB_PROVIDER_API_KEY", "")
CHAT_ENDPOINT = os.environ.get("DEV_API_URL", "") + "/chat"
CHAT_ENDPOINT = os.environ.get("OB_API_URL", "") + "/chat"

DEFAULT_ORIGIN = os.environ.get("DEFAULT_ORIGIN", "https://localhost:5173")
OB_PROVIDER_API_KEY = os.environ.get("OB_PROVIDER_API_KEY", "")


DEFAULT_CLIENT_ID = Defaults.DEFAULT_CLIENT_ID.value
DEFAULT_PROFILE_NAME = Defaults.DEFAULT_PROFILE_NAME.value
PORT = int(os.environ.get("GRADIO_PORT", 7861))
Expand Down Expand Up @@ -65,7 +69,8 @@ def chat(message, chat_history, _profile_name, session_state, _client_id):
session = session_state["session"]
session.headers.update(
{
"x-api-key": AGENCY_API_KEY,
"x-api-key": OB_PROVIDER_API_KEY,
"origin": DEFAULT_ORIGIN,
}
)
response = session.post(CHAT_ENDPOINT, json=chat_message.to_json())
Expand Down Expand Up @@ -128,7 +133,12 @@ def reset(
else:
# Make a POST request to the reset endpoint
session = session_state["session"]
session.headers.update({"x-api-key": AGENCY_API_KEY})
session.headers.update(
{
"x-api-key": OB_PROVIDER_API_KEY,
"origin": DEFAULT_ORIGIN,
}
)
response = session.post(CHAT_ENDPOINT, json=chat_message.to_json())
session_id = response.cookies["Session"]
session_state["session_id"] = session_id
Expand Down Expand Up @@ -455,8 +465,8 @@ def main():
# main_block.launch(auth=auth, auth_message="Please login to continue", share=False, debug=True,
# server_name="0.0.0.0", server_port=7861, show_tips=True, )
# reset the public default profile
agent_config = AgentConfig(client_id=DEFAULT_CLIENT_ID, profile_name=DEFAULT_PROFILE_NAME)
agent_config.save()
# agent_config = AgentConfig(client_id=DEFAULT_CLIENT_ID, profile_name=DEFAULT_PROFILE_NAME)
# agent_config.save()
main_block.launch(
debug=True,
share=False,
Expand Down

0 comments on commit 271967a

Please sign in to comment.