Giter Site home page Giter Site logo

simple-chat-swift's Introduction

Simple Chat (Swift)

DEPRECATED: this repo is no longer actively maintained. It can still be used as reference, but may contain outdated or unpatched code.

This repository contains an example application to demonstrate the Watson Developer Cloud Swift SDK. It combines the Speech to Text, Conversation, and Text to Speech services to build a voice-to-voice chat app.

The Simple Chat app in action

Tutorial

If you'd prefer to learn by building this app yourself, feel free to follow along with the tutorial.

Project Setup

To run the sample playground or iOS app, be sure to clone the repository and download the Watson Developer Cloud Swift SDK dependency. The dependency will be loaded twice, once as a Git submodule (for use in the playground) and again with Carthage (for use in the iOS app).

$ git clone https://github.com/watson-developer-cloud/simple-chat-swift.git
$ cd simple-chat-swift/simple-chat
$ git submodule init
$ git submodule update
$ carthage update --platform iOS

Provision Services

The sample playground and iOS app both use the Speech to Text, Conversation, and Text to Speech services. Each service must be provisioned. You will need to sign up for a Bluemix account if you do not already have one.

To provision each service:

  1. Open the Bluemix services dashboard.
  2. Select the "Create Service" button.
  3. Select the "Watson" category from the left-hand menu.
  4. Select the service to provision.
  5. Select "Create" to continue. (The default configuration options are fine for this tutorial.)

Credentials

Each of the services you provisioned has its own username and password credentials. The playground and iOS app expect to find these credentials in a Credentials.swift file.

Start by renaming the Credentials.swift.example file in your project directory to Credentials.swift. Then open Credentials.swift in Xcode. This file will record our service credentials.

  1. Open the Bluemix services dashboard.
  2. Select the service whose credentials you would like to record.
  3. Select "Service credentials" from the left-hand navigation menu.
  4. Select "View credentials".
  5. Copy the username and password into Credentials.swift.

Repeat these steps to copy the username and password credentials for the Speech to Text, Conversation, and Text to Speech services.

Resources

Watson Developer Cloud:

Watson Swift SDK:

Swift@IBM:

simple-chat-swift's People

Contributors

germanattanasio avatar glennrfisher avatar jeff-arn avatar leemet16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple-chat-swift's Issues

sample outdated

its difficult trying to use the latest library with this old sample

The project cannot be downloaded. The Credentials.swift file is missing

Download the project to run the Credentials.swift file is missing is that Credentials.swift is a project run red error download error: no such project: 0: file or directory:'/Users/lidongdong/Downloads/simple-chat-swift-master/ simple-chat/Simple Chat/Credentials.swift'
Command, /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc, failed, with, exit, code, 1

ViewController - "Type 'String' has no member 'opus'?

I've followed the directions on the tutorial page, but cannot get this sample (or other watson iOS samples to compile). I consistently see "Type 'String' has no member 'opus' as the compile error.

In the case of this simple-chat-swift example, the compile error shows up in the ViewController on the following line:

var settings = RecognitionSettings(contentType: .opus)

Is there a new/additional configuration step needed to get this to compile?

restkit not found

Hi,

I followed the readme steps to install the packages, but when I run the app I get this error:

dyld: Library not loaded: @rpath/RestKit.framework/RestKit
  Referenced from: /Users/avanees/Library/Developer/CoreSimulator/Devices/4751B654-06EA-46DE-83D8-A89F05C9A96A/data/Containers/Bundle/Application/760AE444-95F5-400A-BE5B-4D8171CD8F63/Simple Chat.app/Frameworks/AssistantV1.framework/AssistantV1
  Reason: image not found

I have xcode 10.0.
I see some error about the incompatible swift version. Could that be the reason of above error? How do I solve that? Thanks in advance!

this is what carthage outputted:

carthage update --platform iOS
*** Cloning swift-sdk
*** Cloning Starscream
*** Cloning restkit
*** Checking out swift-sdk at "0.37.0"
*** Checking out restkit at "1.3.0"
*** Checking out Starscream at "3.0.5"
*** xcodebuild output can be found in /var/folders/p5/hb0k1_7s6h39d5zhlpqw4swcrp1c28/T/carthage-xcodebuild.u4rI9o.log
*** Downloading swift-sdk.framework binary at "0.37.0"
***  Skipped installing swift-sdk.framework binary due to the error:
	"Incompatible Swift version - framework was built with 4.1 (swiftlang-902.0.48 clang-902.0.37.1) and the local version is 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)."

    Falling back to building from the source
*** Building scheme "RestKit" in RestKit.xcodeproj
*** Building scheme "Starscream" in Starscream.xcodeproj
*** Building scheme "AssistantV1" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "ConversationV1" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "LanguageTranslatorV2" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "LanguageTranslatorV3" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "NaturalLanguageClassifierV1" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "NaturalLanguageUnderstandingV1" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "PersonalityInsightsV3" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "SpeechToTextV1" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "AssistantV2" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "DiscoveryV1" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "TextToSpeechV1" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "ToneAnalyzerV3" in WatsonDeveloperCloud.xcodeproj
*** Building scheme "VisualRecognitionV3" in WatsonDeveloperCloud.xcodeproj

Change Voice?

I'm not sure if this is considered an issue or not..but I'm not sure how to change the voice of Watson...could you please help?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.