
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Promptrix is a prompt layout engine for Large Language Models.
from promptrix import promptrixTypes, VolatileMemory, FunctionRegistry, GPT3Tokenizer
from promptrix.Prompt import Prompt
from promptrix.SystemMessage import SystemMessage
from promptrix.UserMessage import UserMessage
from promptrix.AssistantMessage import AssistantMessage
from promptrix.ConversationHistory import ConversationHistory
functions = FunctionRegistry()
tokenizer = GPT3Tokenizer()
memory = VolatileMemory({'input':'', 'history':[]})
max_tokens = 2000
prompt_text = 'You are helpful, creative, clever, and very friendly. '
PROMPT = Prompt([
UserMessage(prompt_text),
ConversationHistory('history', .5), # allow history to use up 1/2 the remaining token budget left after the prompt and input
UserMessage('{{$input}}')
])
async def render_messages_completion():
as_msgs = await PROMPT.renderAsMessages(memory, functions, tokenizer, max_tokens)
msgs = []
if not as_msgs.tooLong:
msgs = as_msgs.output
return msgs
### basic chat loop
while True:
memory.set('input', query)
msgs = asyncio.run(render_messages_completion())
response = ... your favorite llm api (model, msgs, ...)
print(response)
history = memory.get('history')
history.append({'role':USER_PREFIX, 'content': query})
history.append({'role': ASSISTANT_PREFIX, 'content': response})
memory.set('history', history)
FAQs
Promptrix. A prompt layout manager for LLMs
We found that promptrix demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.