wit-ai / wit-ai/pywit

context, timezone json.dumps issue

Open
#95 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
353
PR merge metrics
No merged PRs in 30d

Description

Do you want to request a feature, report a bug, or ask a question about wit?
Bug
What is the current behavior?
If I tried the pywit message function with this context:
{"timezone":"America/Los_Angeles"} - the generated url (because of json.dumps) contains slashes ''. And it seems does not work the timezone calculation for this type of text: call me at 8 (so without AM or PM).

I changed temporary the wit.py line 76. from this:
params['context'] = json.dumps(context)
to this:
params['context'] = context

Maybe I used a wrong format for context. Can you deliver me a better one or explain why with json.dumps(context) make a wrong url request?

Thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at wit.py line 76 and reproduce a pywit message call with context {"timezone":"America/Los_Angeles"}; inspect how json.dumps affects the generated URL. Check the request format and the handling of “call me at 8” against the reported timezone behavior. Done means the accepted context format and the URL and timezone behavior are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.