langchain icon indicating copy to clipboard operation
langchain copied to clipboard

feat: Google Calendar Tool (wip)

Open nickscamara opened this issue 2 years ago • 6 comments

Functionality:

  • [X] Create event
  • [ ] View event
  • [ ] View events
  • [ ] Delete event
  • [ ] Reschedule event

Docs:

  • [X] Google calendar, create event example
  • [X] Google calendar ecosystem (not using load_tools yet)

Tests:

  • [X] Simple test for creating event

I removed from load_tools for now, cause not sure if belongs there yet. Instructions:

  • Follow instructions here: https://developers.google.com/calendar/api/quickstart/python
  • When you run for the first time, you will need to authenticate OAuth w/ Google

nickscamara avatar Jan 18 '23 23:01 nickscamara

Got it. I also agree that separating it more would be better. Although I have some doubts about how this could look like.

1 - Would the run method of the Calendar tools look something like this? Where the wrapper doesn't handle the call to google API and where LLMGoogleCalendarChain handles classification and run_events.

    def run(self, query: str) -> str:     
        google_calendar_chain = LLMGoogleCalendarChain(
            ...,
            query=query,
        )
        return google_calendar_chain.run(query)
  • If so, wouldn't the wrapper tool lose its purpose of being a wrapper as most of the google API logic will be in the chain itself?

or

The other option I see is that the wrapper is the one that should be calling the google API. That way it uses the chain to get the output in the right format then it uses the wrapper again to make the call to google API. Which I think makes more sense. Although, the chain wouldn't have access to the google API.

or

Maybe there should be better separation between wrappers and tools? But not sure about this one.

Let me know your thoughts :)

nickscamara avatar Jan 21 '23 19:01 nickscamara

@nickscamara the way i was thinking about it was that nothing that required an LLM should be in the Gcal Utility Wrapper. Eg it would just be create_event, list_events, etc - eg all the methods that interact with Gcal in a deterministic manner

everything that required an LLM would go in the chain class

hwchase17 avatar Jan 23 '23 06:01 hwchase17

This looks very promising, any new progress here at all? @nickscamara

dgde avatar Feb 14 '23 22:02 dgde

just want to know is there any progress ? @nickscamara

or is there any type to support the common Calendar type ? @hwchase17

libratiger avatar Mar 20 '23 03:03 libratiger

@vowelparrot we don't have anything for gcal yet right?

dev2049 avatar May 09 '23 22:05 dev2049

@vowelparrot we don't have anything for gcal yet right?

Not yet in core :) this would be a good one to add. I likely won't get around to it until at least this weekend though

vowelparrot avatar May 09 '23 23:05 vowelparrot

Hi I have actually been working on a GCal client to so I could make a custom tool for a proof of concept. Then I decided to look and see if anything GCal related was in-flight and found this. Is there any way I could help get this one across the line?

rwhiten1 avatar May 24 '23 02:05 rwhiten1

I am the same person as @rwhiten1 , that is an older github account and wanted a fresh start in a new account so I created @prodineeritecht a while ago, but am just now getting around to using it. I'll gladly help get this across the line but had a question for @nickscamara , @vowelparrot , and @hwchase17. When I was looking through the langchain repository, I noticed that gmail was actually created as separate tools for each of the gmail functions, and that pattern seems to make the most sense to me. Do any of you have a problem if I were to refactor this PR or create a new PR to follow that pattern? Also, while I've been an SE for a good long while, I'm still something of a Python noob (scala, java, C# were my main languages) so if I push up anything that goes against Python best practices, let me know and I will gladly change it. I'm also currently between jobs so I have plenty of time to get this all working. I feel like I could have it ready to go either at the end of the week or early next week. Thanks!

prodineeritecht avatar May 24 '23 15:05 prodineeritecht

Closing as stale

eyurtsev avatar Aug 08 '23 14:08 eyurtsev