modelscope / agentscope

Start building LLM-empowered multi-agent applications in an easier way.
https://doc.agentscope.io/
Apache License 2.0
5.32k stars 328 forks source link

[Feature]: how to i use model for together ai ? #447

Closed dangyuuki123 closed 1 month ago

dangyuuki123 commented 2 months ago

hello, i don't use dashscope because i am not chinese. i want using Together AI api for model how to using this?

DavdGao commented 2 months ago

Welcome to AgentScope. It seems like Together AI supports post request in their documentation.

Therefore, you can use the post request based model wrapper in AgentScope with the following model configuration (fill your api key)

my_model_config = {
    "config_name": "my_together_ai_config",  # whatever you like
    "model_type": "post_api_chat",

    "api_url": "https://api.together.xyz/v1/chat/completions",
    "headers": {
        "Authorization": "Bearer $TOGETHER_API_KEY",
        "Content-Type": "application/json"
    },
    "json_args": {
        "model": "xxxx",
    }
}

agentscope.init(model_configs=my_model_config)
dangyuuki123 commented 2 months ago

@DavdGao thank you so much

DavdGao commented 1 month ago

It seems like the issue is solved. Feel free to open a new one if needed, closing this for now.