github_platform#

class besser.agent.platforms.github.github_platform.GitHubPlatform(agent)[source]#

Bases: Platform

The GitHub Platform allows an agent to receive events from GitHub webhooks and make calls to its REST API

This platform implements a webserver exposing an endpoint to receive webhooks events from GitHub. In addition, the platform provides abstractions for interacting with issues (e.g., open, get, comment).

Parameters:

agent (Agent) – the agent the platform belongs to

_agent#

The agent the platform belongs to

Type:

Agent

_secret#

The secret webhook token

Type:

str

_oauth_token#

Personal token for GitHub API requests

Type:

str

_port#

Port of the webhook endpoint

Type:

int

_app#

Web application routing webhooks to our entrypoint

Type:

web.Application

_session#

The session of the GitHubPlatform

Type:

Session

_post_entrypoint#

The method handling the webhooks events

Type:

Request -> web.Response

_abc_impl = <_abc._abc_data object>#
_send(session_id, payload)[source]#

Send a payload message to a specific user.

Parameters:
  • session_id (str) – the user to send the response to

  • payload (Payload) – the payload message to send to the user

assign_user(issue, assignee)[source]#
comment_issue(issue, content)[source]#
get_issue(user, repository, issue_number)[source]#
initialize()[source]#

Initialize the platform. This function is called right before starting the platform.

open_issue(user, repository, title, body)[source]#
reply(session, message)[source]#

Send an agent reply, i.e. a text message, to a specific user.

Parameters:
  • session (Session) – the user session

  • message (str) – the message to send to the user

set_label(issue, label)[source]#
start()[source]#

Start the platform.

stop()[source]#

Terminate the platform execution.