Skip to content

Conversation

@abirharrasse
Copy link

We make it possible for users of MetaGPT to use their together api and get access to the agentic features offered by MetaGPT.

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 16.07143% with 94 lines in your changes missing coverage. Please review.

Project coverage is 62.31%. Comparing base (ab846f6) to head (2415cbc).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
metagpt/provider/together.py 0.00% 92 Missing ⚠️
metagpt/configs/llm_config.py 66.66% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1474      +/-   ##
==========================================
- Coverage   62.59%   62.31%   -0.28%     
==========================================
  Files         287      288       +1     
  Lines       17589    17697     +108     
==========================================
+ Hits        11009    11028      +19     
- Misses       6580     6669      +89     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@RahulVadisetty91 RahulVadisetty91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

You are using timeout=USE_CONFIG_TIMEOUT in multiple places.

@geekan geekan requested a review from better629 October 11, 2024 05:33
# @File : __init__.py

from metagpt import _compat as _ # noqa: F401
from metagpt.provider.google_gemini_api import GeminiLLM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these codes are already in metagpt/provider/__init__.py

from metagpt.const import LLM_API_TIMEOUT
from metagpt.utils.yaml_model import YamlModel

from metagpt.const import METAGPT_ROOT, CONFIG_ROOT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use pre-commit to format code

raise ValueError(f"Please set your API key in {repo_config_path}")
else:
raise ValueError("Please set your API key in config2.yaml")
raise ValueError(f"Please set your API key in config2.yaml")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add f?

@@ -0,0 +1,126 @@
import asyncio
from typing import Optional, Union, AsyncGenerator
from together import Together
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't add together version in requirments.txt

chunk_message = chunk.choices[0].delta.content
if chunk_message:
current_sentence += chunk_message
if chunk_message.endswith(('.', '!', '?', '\n')):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why deal with there special chars?

if chunk_message.endswith(('.', '!', '?', '\n')):
collected_messages.append(current_sentence)
yield current_sentence
print(current_sentence, end='', flush=True) # Print each sentence as it's completed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use log_llm_stream instead of print

from metagpt.utils.exceptions import handle_exception

@register_provider(LLMType.TOGETHER)
class TogetherLLM(BaseLLM):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice that together has openai api compatibility inferface https://docs.together.ai/docs/openai-api-compatibility. So it seems that no need to create a new provider here.

@geekan
Copy link
Collaborator

geekan commented Oct 20, 2024

We know that its api is compatible with the openai api, so in theory no new class is needed. But if I'm wrong, reopen it.

@geekan geekan closed this Oct 20, 2024
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

Successfully merging this pull request may close these issues.

5 participants