Skip to content

Commit

Permalink
Merge branch 'main' into chore/gh-outta-here
Browse files Browse the repository at this point in the history
  • Loading branch information
amanape authored Jan 21, 2025
2 parents 523a91a + 8ae3648 commit d18855a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion openhands/server/listen_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ async def connect(connection_id: str, environ, auth):
if not signed_token:
logger.error('No github_auth cookie')
raise ConnectionRefusedError('No github_auth cookie')
decoded = jwt.decode(signed_token, config.jwt_secret, algorithms=['HS256'])
if not config.jwt_secret:
raise RuntimeError('JWT secret not found')
decoded = jwt.decode(
signed_token, config.jwt_secret.get_secret_value(), algorithms=['HS256']
)
user_id = decoded['github_user_id']

logger.info(f'User {user_id} is connecting to conversation {conversation_id}')
Expand Down
4 changes: 3 additions & 1 deletion openhands/utils/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def get_embedding_model(strategy: str, llm_config: LLMConfig) -> 'BaseEmbedding'
return AzureOpenAIEmbedding(
model='text-embedding-ada-002',
deployment_name=llm_config.embedding_deployment_name,
api_key=llm_config.api_key,
api_key=llm_config.api_key.get_secret_value()
if llm_config.api_key
else None,
azure_endpoint=llm_config.base_url,
api_version=llm_config.api_version,
)
Expand Down

0 comments on commit d18855a

Please sign in to comment.