Skip to content

Commit

Permalink
update pixx.co to spaceship.im
Browse files Browse the repository at this point in the history
  • Loading branch information
f1delius committed Jul 5, 2024
1 parent 00fd0a9 commit 9eff8b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def send_message_as_tool(
session_id=None
):
async with aiohttp.ClientSession() as session:
async with session.get(f"https://bots.pixx.co/agents/{tool_id}") as result:
async with session.get(f"https://bots.spaceship.im/agents/{tool_id}") as result:
data = await result.json()
if not data:
return None
Expand All @@ -44,7 +44,7 @@ async def send_message_as_tool(
'm.in_reply_to': {'event_id': event_id}
}
content["m.relates_to"] = thread
client = ClientAPI(base_url="https://matrix.pixx.co",
client = ClientAPI(base_url="https://matrix.spaceship.im",
token=access_token)
event_id = await client.send_message(room_id, content)
return event_id, access_token
Expand Down Expand Up @@ -75,21 +75,21 @@ async def edit_message(event_id, access_token, msg, room_id, workflow_bot, msg_l
"rel_type": "m.replace"
}
}
client = ClientAPI(base_url="https://matrix.pixx.co",
client = ClientAPI(base_url="https://matrix.spaceship.im",
token=access_token)
event_id = await client.send_message(room_id, content)
return event_id


async def invite_bot_to_room(tool_id, session):
result = await session.get(f"https://bots.pixx.co/agents/{tool_id}")
result = await session.get(f"https://bots.spaceship.im/agents/{tool_id}")
if not result.json():
return None
return result.json()["bot_username"]

async def enable_api(conn, userId, session):
try:
email_id = await session.get(f"https://bots.pixx.co/user/{userId}")
email_id = await session.get(f"https://bots.spaceship.im/user/{userId}")
email_id.raise_for_status()
email = email_id.json()["email"]
conn.execute(f"INSERT OR REPLACE INTO bot VALUES ('{userId}', '{email}')")
Expand All @@ -99,7 +99,7 @@ async def enable_api(conn, userId, session):
return True

async def intro_message(agent_id, session):
result = await session.post(f"https://api.pixx.co/api/v1/bots/{agent_id}/intro")
result = await session.post(f"https://api.spaceship.im/api/v1/bots/{agent_id}/intro")
if result.status_code == 200:
return result.json()["data"]
return None
2 changes: 1 addition & 1 deletion src/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
self.owner_id: str = owner_id
self.bot_username = urllib.parse.quote(user_id)
self.bot_username_without_homeserver = self.user_id.replace(
":pixx.co", '')
":spaceship.im", '')

self.superagent_url = superagent_url
self.api_key = api_key
Expand Down
2 changes: 1 addition & 1 deletion src/superagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async def get_tools(superagent_url: str,agent_id: str,api_key: str, session: htt

async def test(api_key):
async with httpx.AsyncClient() as session:
api_url = "https://api.pixx.co/api/v1/agents/98ab633b-c9c0-45ad-ab7e-881e8d9233a7/invoke"
api_url = "https://api.spaceship.im/api/v1/agents/98ab633b-c9c0-45ad-ab7e-881e8d9233a7/invoke"
prompt = "2+2"
headers = {
'Authorization': f'Bearer {api_key}',
Expand Down

0 comments on commit 9eff8b1

Please sign in to comment.