Skip to content

Cannot Import AssemblyAI from PyPi #6953

@gentoftech2

Description

@gentoftech2

ERROR
Command failed: pipreqs --force ERROR: Failed on file: /tmp/pdg/dist/code/158c7134876f733aaecf74ff2852c7344b49fea04729bfdb75a290b9e0c6a5ea/code.py Traceback (most recent call last): File "/var/lang/bin/pipreqs", line 8, in sys.exit(main()) File "/var/lang/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 528, in main init(args) File "/var/lang/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 455, in init candidates = get_all_imports(input_path, File "/var/lang/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 131, in get_all_imports raise exc File "/var/lang/lib/python3.9/site-packages/pipreqs/pipreqs.py", line 117, in get_all_imports tree = ast.parse(contents) File "/var/lang/lib/python3.9/ast.py", line 50, in parse return compile(source, filename, mode, flags, File "", line 1 !pip install pyaudio ^ SyntaxError: invalid syntax
CODE Attempts

#1

Import the AssemblyAI module

import assemblyai as aai

Your API token is already set here

aai.settings.api_key = "46eced7ea23f4671904a6eda27d9e955"

transcriber = aai.Transcriber()
transcript_group = transcriber.transcribe_group(
[
"https://cdn.fireflies.ai/x5iIyOJQwNhWfCpV/audio.mp3?Expires=1685801041&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4uZmlyZWZsaWVzLmFpL3g1aUl5T0pRd05oV2ZDcFYvYXVkaW8ubXAzIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjg1ODAxMDQxfX19XX0_&Signature=Pt3D5iY8WDiEYwPOF4DXnnxk1nsUtzSqPh4OHwyLkGrSIMKwXJX6ZA1635PRBRrjYpcam1BmnofDfdSxpNeZK661juaocySixFcHh49ZkXINQTZ3j-513-5IlSm2NdZKx2I37QJdmAfe7sB4bYa8CLwYafcVxBJY1eZqlLG7bz5wnUvQEs1ADzKyWROynR1dneEDoxFJNraTD52lmJl0g5KBirh0Xb8hMGdZ7PUO9IeKIDeZ15FsIlVMmHzXLfnjr6gHeI21p-bls1sHdWsnzvqmMKF75Tc949Liuw4Z1L8DxNL-GeJGxsLdnHrf898mMs17--E2GCQOLQ__&Key-Pair-Id=K25ZJR0UZVF4CM",
"https://cdn.fireflies.ai/PRqroP8Buw1Zle28/audio.mp3?Expires=1685831515&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4uZmlyZWZsaWVzLmFpL1BScXJvUDhCdXcxWmxlMjgvYXVkaW8ubXAzIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjg1ODMxNTE1fX19XX0_&Signature=lcYCpzAEVIAuOsDHk9suKFNfEtIGTpkDuvzgFH2LinQL8ImstUV2brDvnCaTIQFJn7jZGjItcfre18pCeCxp7s8LBA85ko0pUKG5JmuhWyOFkwni-Bv5A06o-riHUr7mAkbXDluWHJ3fJPjcnlIYjHakeAX67cJUuqhqQYLzSEom2Ivwr1vfjkHIj6q19xN8WFqNSWzr2rPjMCKLrUrHOxYx2fRlErJPlvMV5mIN6cnpIgveu0cGquAxuLcK9XxQIXpeWM5Kz0kj0vSHxsAwmAUoToaAUjslmq8GrNMOBkWFeScJu9kUEpRG4kPq1n1tH2GNf3mRsB1UTaw__&Key-Pair-Id=K25ZJR0UZVF4CM",
"https://cdn.fireflies.ai/F5AM4T5Vm2Mn5FT2/audio.mp3?Expires=1685818794&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4uZmlyZWZsaWVzLmFpL0Y1QU00VDVWbTJNbjVGVDIvYXVkaW8ubXAzIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjg1ODE4Nzk0fX19XX0_&Signature=obRimQysNH5jm2htIibgq
DcUa6cmmQGc3T9ZwIsPFHh3W7METiZjSfNVnk9H46MC4sGtBNwE0TXSNE6sKw6MRYPX49iCNTb8B6bqLEv3xxkf4MCiSXLdMBJl2FdY56aAK0zvI5kbciDGLT7Dau0IpbyYMXXM-sdUT1S2Hsh38WdonoDf--uqa-mnnMQGxqrtzYZiDjR5x6J-nK6wN69ZJsJU9CXOzfRb7xaQIgCFS3DX6ilj32bRGPTMZB8QoJ-dpBfvIJEpaVBVd5AIR8MZlB5u8qgunCP3v-mW8nwE5rFQYqQbt3b~Eh2IQh6eT-YzCROB3v9cd3TOprw__&Key-Pair-Id=K25ZJR0UZVF4CM",
],
)

summary = transcript_group.lemur.summarize(context="These are a series of same day recordings during which the topics of digital operations and rented digital operations infrastructure as a consulting business are discusssed.", answer_format="Please describe the concepts of digital operations & rented infrastructure, along with the pain points and problems they address. Use bullet points for the details.")

print(summary)
#2
import pyaudio
import assemblyai as aai

VideoLocation = pd.steps["trigger"]["event"]["body"]

transcriber = aai.Transcriber()
transcript = transcriber.transcribe(VideoLocation)

ask some questions

questions = [
aai.LemurQuestion(question="What is this discussion about?"),
aai.LemurQuestion(question="Summarize the discussion to 5 bullet points"),
]

results = transcript.lemur.question(questions)

for result in results:
print(f"Question: {result.question}")
print(f"Answer: {result.answer}")

#3
!pip install pyaudio
!pip install assemblyai

VideoLocation = pd.steps["trigger"]["event"]["body"]

transcriber = aai.Transcriber()
transcript = transcriber.transcribe(VideoLocation)

ask some questions

questions = [
aai.LemurQuestion(question="What is this discussion about?"),
aai.LemurQuestion(question="Summarize the discussion to 5 bullet points"),
]

results = transcript.lemur.question(questions)

for result in results:
print(f"Question: {result.question}")
print(f"Answer: {result.answer}")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions