Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stat committed Nov 6, 2024
1 parent 1deef2a commit 63b5489
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion twitter-langchain/twitter_langchain/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" CDP Twitter Toolkit."""
"""CDP Twitter Toolkit."""

from twitter_langchain.twitter_action import TwitterAction
from twitter_langchain.twitter_api_wrapper import TwitterApiWrapper
Expand Down
6 changes: 2 additions & 4 deletions twitter-langchain/twitter_langchain/twitter_api_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
"""Util that calls Twitter API."""

import tweepy

from typing import Any

from pydantic import BaseModel, model_validator

from langchain_core.utils import get_from_dict_or_env
from pydantic import BaseModel, model_validator

from cdp_agentkit_core.actions.social.twitter import (
post_text,
)


class TwitterApiWrapper(BaseModel):
"""Wrapper for Twitter API."""

Expand All @@ -22,7 +21,6 @@ class TwitterApiWrapper(BaseModel):
@classmethod
def validate_environment(cls, values: dict) -> Any:
"""Validate that Twitter access token, token secret, and tweepy exists in the environment."""

api_key = get_from_dict_or_env(values, "twitter_api_key", "TWITTER_API_KEY")
api_secret = get_from_dict_or_env(values, "twitter_api_secret", "TWITTER_API_SECRET")
access_token = get_from_dict_or_env(values, "twitter_access_token", "TWITTER_ACCESS_TOKEN")
Expand Down
3 changes: 1 addition & 2 deletions twitter-langchain/twitter_langchain/twitter_toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
from cdp_agentkit_core.actions.social.twitter import (
POST_TEXT_PROMPT,
PostTextInput,
post_text,
)
from twitter_langchain.twitter_api_wrapper import TwitterApiWrapper
from twitter_langchain.twitter_action import TwitterAction
from twitter_langchain.twitter_api_wrapper import TwitterApiWrapper


class TwitterToolkit(BaseToolkit):
Expand Down

0 comments on commit 63b5489

Please sign in to comment.