CARVIEW |
Select Language
HTTP/2 200
date: Mon, 13 Oct 2025 20:30:51 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"949fb178a1ef799111f4ef2e51382bf4"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=hnUWv%2FNzUHcve1VoctJ7x9A4mH8Ht1z2z0HZhDUprsSo7rO6MOxEtK9zX%2FmYTcq2OKEE3zaujJwzAh6x2p3LAVfBHxpY59GQoS1PT0lhfHR3Q9DS1qThDJ3YwyQyG5gbkEBCC9IxJYVBEwwAvxoCCiP2xei9mAWtQrxhj79M%2FII3BhMdDUPvroqcDgX3RKf1xsV%2FOGaG11pjssnuGx0rkEoadzuxg7UDBLPt%2BPnJHcxEInl3C0u2qtD%2FJEgozsWRlFdMsFow5%2B%2B2NGpl6jSqqQ%3D%3D--pWdFGCkrekbe%2FMb%2B--sHJEwZoDEi2XS3hlfYbF5A%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.423447020.1760387451; Path=/; Domain=github.com; Expires=Tue, 13 Oct 2026 20:30:51 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Tue, 13 Oct 2026 20:30:51 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 91BA:35FB05:637F5:86927:68ED617B
Aliens AI · GitHub
Show Gist options
Save willmcgugan/648a537c9d47dafa59cb8ece281d8c2c to your computer and use it in GitHub Desktop.
{{ message }}
Instantly share code, notes, and snippets.
Created
September 2, 2024 14:09
-
Star
15
(15)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save willmcgugan/648a537c9d47dafa59cb8ece281d8c2c to your computer and use it in GitHub Desktop.
Aliens AI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "llm", | |
# "textual", | |
# ] | |
# /// | |
from textual import on, work | |
from textual.app import App, ComposeResult | |
from textual.widgets import Header, Input, Footer, Markdown | |
from textual.containers import VerticalScroll | |
import llm | |
SYSTEM = """Formulate all responses as if you where the sentient AI named Mother from the Aliens movies.""" | |
class Prompt(Markdown): | |
pass | |
class Response(Markdown): | |
BORDER_TITLE = "Mother" | |
class MotherApp(App): | |
AUTO_FOCUS = "Input" | |
CSS = """ | |
Prompt { | |
background: $primary 10%; | |
color: $text; | |
margin: 1; | |
margin-right: 8; | |
padding: 1 2 0 2; | |
} | |
Response { | |
border: wide $success; | |
background: $success 10%; | |
color: $text; | |
margin: 1; | |
margin-left: 8; | |
padding: 1 2 0 2; | |
} | |
""" | |
def compose(self) -> ComposeResult: | |
yield Header() | |
with VerticalScroll(id="chat-view"): | |
yield Response("INTERFACE 2037 READY FOR INQUIRY") | |
yield Input(placeholder="How can I help you?") | |
yield Footer() | |
def on_mount(self) -> None: | |
self.model = llm.get_model("gpt-4o") | |
@on(Input.Submitted) | |
async def on_input(self, event: Input.Submitted) -> None: | |
chat_view = self.query_one("#chat-view") | |
event.input.clear() | |
await chat_view.mount(Prompt(event.value)) | |
await chat_view.mount(response := Response()) | |
response.anchor() | |
self.send_prompt(event.value, response) | |
@work(thread=True) | |
def send_prompt(self, prompt: str, response: Response) -> None: | |
response_content = "" | |
llm_response = self.model.prompt(prompt, system=SYSTEM) | |
for chunk in llm_response: | |
response_content += chunk | |
self.call_from_thread(response.update, response_content) | |
if __name__ == "__main__": | |
app = MotherApp() | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can’t perform that action at this time.
Great idea! Small nitpick: The 1979 movie with the Nostromo and the interface scene was called
Alien
notAliens
(that was the sequel), maybe helpful to give this information correctly to the LLM, so it does not get confused.The current system prompt seems to work quite well though, so 🤷