Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClientMsgError:(09:59:56.892) invalid model domain #54

Open
Louis24 opened this issue Oct 23, 2024 · 0 comments
Open

ClientMsgError:(09:59:56.892) invalid model domain #54

Louis24 opened this issue Oct 23, 2024 · 0 comments

Comments

@Louis24
Copy link

Louis24 commented Oct 23, 2024

def test_image():
    from sparkai.core.callbacks import StdOutCallbackHandler
    import base64
    image_content = base64.b64encode(open("spark_llama_index.png", 'rb').read())

    spark = ChatSparkLLM(
        spark_app_id=os.environ["SPARKAI_APP_ID"],
        spark_api_key=os.environ["SPARKAI_API_KEY"],
        spark_api_secret=os.environ["SPARKAI_API_SECRET"],
        spark_llm_domain="image",
        streaming=False,
        user_agent="test"

    )
    messages = [ImageChatMessage(
        role="user",
        content=image_content,
        content_type="image"
    ), ImageChatMessage(
        role="user",
        content="这是什么图",
        content_type="text"
    )]
    handler = ChunkPrintHandler()
    a = spark.generate([messages], callbacks=[])
    print(a)
    print(a.generations[0][0].text)
    print(a.llm_output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant