Merge pull request 'feat: make OpenClaw model configurable' (#2) from fix-hardcoded-model into main
All checks were successful
Lint and Syntax Check / build (push) Successful in 41s
All checks were successful
Lint and Syntax Check / build (push) Successful in 41s
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
5
main.py
5
main.py
@@ -6,6 +6,7 @@ from _db_com import database
|
|||||||
OPENCLAW_URL = os.getenv("OPENCLAW_URL")
|
OPENCLAW_URL = os.getenv("OPENCLAW_URL")
|
||||||
OPENCLAW_TOKEN = os.getenv("OPENCLAW_TOKEN")
|
OPENCLAW_TOKEN = os.getenv("OPENCLAW_TOKEN")
|
||||||
OPENCLAW_PROXY_AUTH = os.getenv("OPENCLAW_PROXY_AUTH")
|
OPENCLAW_PROXY_AUTH = os.getenv("OPENCLAW_PROXY_AUTH")
|
||||||
|
OPENCLAW_MODEL = os.getenv("OPENCLAW_MODEL")
|
||||||
DATABASE_STORAGE = os.getenv("DATABASE_STORAGE_NAME")
|
DATABASE_STORAGE = os.getenv("DATABASE_STORAGE_NAME")
|
||||||
AGENT_USERNAME = os.getenv("AGENT_USERNAME")
|
AGENT_USERNAME = os.getenv("AGENT_USERNAME")
|
||||||
|
|
||||||
@@ -81,7 +82,7 @@ Inform them that you have to be told the exact details on what to do next, as yo
|
|||||||
else:
|
else:
|
||||||
auth = None
|
auth = None
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
OPENCLAW_URL, headers=headers, json={"message": message, "thinking": "low", "timeoutSeconds": 45, "model": "openrouter/google/gemini-3-flash-preview"}, auth=auth
|
OPENCLAW_URL, headers=headers, json={"message": message, "thinking": "low", "timeoutSeconds": 45, "model": OPENCLAW_MODEL}, auth=auth
|
||||||
)
|
)
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
print(
|
print(
|
||||||
@@ -97,7 +98,7 @@ Inform them that you have to be told the exact details on what to do next, as yo
|
|||||||
|
|
||||||
# SHSF Handler - Serverless
|
# SHSF Handler - Serverless
|
||||||
def main(args):
|
def main(args):
|
||||||
required_data = ["OPENCLAW_URL", "OPENCLAW_TOKEN", "DATABASE_STORAGE_NAME", "AGENT_USERNAME"]
|
required_data = ["OPENCLAW_URL", "OPENCLAW_TOKEN", "DATABASE_STORAGE_NAME", "AGENT_USERNAME", "OPENCLAW_MODEL"]
|
||||||
for var in required_data:
|
for var in required_data:
|
||||||
if not os.getenv(var):
|
if not os.getenv(var):
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user