Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/srgchrksv/anthropic-conversational-chat
anthropic conversational chat with UI
https://github.com/srgchrksv/anthropic-conversational-chat
anthropic chat claude fastapi genai marked-js prismjs ui uvicorn
Last synced: 4 days ago
JSON representation
anthropic conversational chat with UI
- Host: GitHub
- URL: https://github.com/srgchrksv/anthropic-conversational-chat
- Owner: srgchrksv
- Created: 2024-03-19T10:42:17.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-19T22:12:08.000Z (8 months ago)
- Last Synced: 2024-04-18T11:23:25.154Z (7 months ago)
- Topics: anthropic, chat, claude, fastapi, genai, marked-js, prismjs, ui, uvicorn
- Language: HTML
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# anthropic conversational chat
I wanted to try all anthropic Claude models and created this simple client UI.
Get yor api key at [https://console.anthropic.com/](https://console.anthropic.com/)
Then create .env file with ANTHROPIC_API_KEY variable.
Install are required packages with:
```
pip install -r requirements.txt
```
And serve client with fastapi and uvicorn:
```bash
uvicorn main:app --reload
```MessagesHistory class to hold conversation, but only Opus model is responsive with history context other models ignore it, responding only to last prompt.
```
class MessagesHistory:
def __init__(self):
self.messages = []def append_message(self, role, message):
self.messages.append({
"role": role,
"content": [
{
"type": "text",
"text": message
}
]
})def get_messages(self):
return self.messages
```