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
| import fastapi_poe as fp | |
| import os | |
| import sseclient | |
| import json | |
| from fastapi_poe import make_app | |
| from together import Together | |
| import requests | |
| import constants | |
| import pillow_heif |
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
| import json | |
| from together import Together | |
| client = Together() | |
| tools = [ | |
| { | |
| "type": "function", | |
| "function": { | |
| "name": "get_current_weather", |
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
| import json | |
| import together | |
| client = together.Together() | |
| #tools | |
| book_travel_tickets = { | |
| "type": "function", | |
| "function": { | |
| "name": "book_travel_tickets", |
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
| import time | |
| from together import Together | |
| client = Together(api_key = "---") | |
| prompt = "How many r's in the word strawberry?" | |
| prefill_tokens_len = len(tokenizer.encode(prompt)) | |
| decode_text = "" |
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
| from together import Together | |
| client = Together(api_key = TOGETHER_API_KEY) | |
| question = "Which is larger 9.9 or 9.11?" | |
| thought = client.chat.completions.create( | |
| model="deepseek-ai/DeepSeek-R1", | |
| messages=[{"role": "user", "content": question}], | |
| stop = ['</think>'] | |
| ) |
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
| from together import Together | |
| client = Together(api_key = TOGETHER_API_KEY) | |
| question = "Which is larger 9.9 or 9.11?" | |
| thought = client.chat.completions.create( | |
| model="deepseek-ai/DeepSeek-R1", | |
| messages=[{"role": "user", "content": "Which is larger 9.9 or 9.11?"}], | |
| stop = ['</think>'] | |
| ) |