
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
This project is a basic CLI-based chat bot that uses Bedrock to resolve questions. It can take input from stdin, CLI arguments or interactively when no parameters have been passed.
pip install bedrock-bot
Usage: bedrock [OPTIONS] [ARGS]...
Options:
-r, --region TEXT The AWS region to use for requests. If no
default region is specified, defaults to us-
east-1
--raw-output TEXT Don't interpret markdown in the AI response
-m, --model [Claude-3-Haiku|Claude-3-Sonnet|Mistral-Large]
The model to use for requests
-v, --verbose Enable verbose logging messages
-i, --input-file FILENAME Read in file(s) to be used in your queries
--help Show this message and exit.
Directly as a chat bot:
$ bedrock
Hello! I am an AI assistant powered by Amazon Bedrock and using the model Claude-3-Haiku. Enter 'quit' or 'exit' at any time to exit. How may I help you today?
(You can clear existing context by starting a query with 'new>' or 'reset>')
> Hi, what is your name?
My name is Claude.
Using CLI arguments:
$ bedrock "Hi, what is your name?"
Hello! I am an AI assistant powered by Amazon Bedrock and using the model Claude-3-Haiku. Enter 'quit' or 'exit' at any time to exit. How may I help you today?
(You can clear existing context by starting a query with 'new>' or 'reset>')
> Hi, what is your name?
My name is Claude. It's nice to meet you!
Using stdin (Note that you can only use this for one-shot questions as input is reserved by your pipe to stdin and is not an interactive TTY any more):
$ echo "Hi, what is your name?" > input-file
$ cat input-file | bedrock
Hello! I am an AI assistant powered by Amazon Bedrock and using the model Claude-3-Haiku. Enter 'quit' or 'exit' at any time to exit. How may I help you today?
(You can clear existing context by starting a query with 'new>' or 'reset>')
> Hi, what is your name?
My name is Claude. I'm an AI created by Anthropic. It's nice to meet you!
Note that you can only do one-shot requests when providing input via stdin
Asking about a file:
$ bedrock --input-file bedrock_bot/models/base_model.py write unit tests using pytest for this file
Hello! I am an AI assistant powered by Amazon Bedrock and using the model Claude-3-Haiku. Enter 'quit' or 'exit' at any time to exit. How may I help you today?
(You can clear existing context by starting a query with 'new>' or 'reset>')
> write unit tests using pytest for this file
To write unit tests for the bedrock_bot/models/base_model.py file using pytest, you can create a test_base_model.py file in the tests directory. Here's an example of how you can structure the tests:
import json
from unittest.mock import patch, MagicMock
import pytest
from bedrock_bot.models.base_model import _BedrockModel, ConversationRole
class TestBedrockModel:
def setup_method(self):
self.model = _BedrockModel("test-model-id")
def test_reset(self):
self.model.append_message(ConversationRole.USER, "Hello")
assert len(self.model.messages) == 1
self.model.reset()
assert len(self.model.messages) == 0
...
Shell auto-complete is also supported.
_BEDROCK_COMPLETE=zsh_source bedrock > ~/.bedrock-completion.zsh
~/.zshrc
: source ~/.bedrock-completion.zsh
_BEDROCK_COMPLETE=bash_source bedrock > ~/.bedrock-completion.bash
~/.bashrc
: source ~/.bedrock-completion.bash
FAQs
Unknown package
We found that bedrock-bot 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.