Created
November 24, 2023 06:38
-
-
Save wooparadog/f2f9efedb1257a05d0adb379a69e9216 to your computer and use it in GitHub Desktop.
This file contains 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 asyncio | |
from anthropic import AI_PROMPT, HUMAN_PROMPT, AsyncAnthropic | |
anthropic = AsyncAnthropic() | |
async def run(i): | |
print(f"!!!!!{i}!!!!!!!") | |
completion = await anthropic.completions.create( | |
model="claude-2.1", | |
max_tokens_to_sample=1000, | |
temperature=0, | |
prompt=f"你好${HUMAN_PROMPT} 今天天气怎么样${AI_PROMPT} 对不起,我没有访问实时天气信息的能力。我是 Claude,一个 AI 助手。${HUMAN_PROMPT} 你是谁?${AI_PROMPT} 我是 Claude,一个由 Anthropic 公司开发的 AI 聊天助手。${HUMAN_PROMPT}${AI_PROMPT}", | |
) | |
print(completion.completion) | |
async def main(): | |
await asyncio.gather(*[run(i) for i in range(10)]) | |
asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment